/* Néo Éditions — même direction que Néo Infos « pastel » : fond lavande, cartes blanches très
   arrondies, une teinte par famille d'outils, titres Fraunces, texte Figtree. */
:root {
  --paper: #F7F5FC; --surface: #FFFFFF; --paper-2: #EFECF7; --ink: #1F1A33; --ink-2: #4A4560; --muted: #77728A;
  --rule: #E6E2F0; --brand: #6C4CE0; --brand-ink: #FFFFFF; --ok: #1C7A55; --warn: #B0561A; --bad: #B4325E;
  --shadow: 0 1px 2px rgba(31, 26, 51, .05), 0 12px 32px -14px rgba(31, 26, 51, .16);
  --shadow-lg: 0 2px 6px rgba(31, 26, 51, .06), 0 30px 60px -24px rgba(31, 26, 51, .28);
  --tint: 13%; --tint-base: #FFFFFF;
  --c-editeur: #6C4CE0; --c-convertir: #1F6FA8; --c-organiser: #1C7A55; --c-optimiser: #C2532A; --c-securite: #B4325E; --c-cv: #13808F;
  --head: "Fraunces", Georgia, serif; --text: "Figtree", system-ui, -apple-system, sans-serif;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px; --r-pill: 999px;
  --page-bg: #E9E5F3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15131F; --surface: #1F1C2C; --paper-2: #282438; --ink: #F2EFFA; --ink-2: #CFCADD; --muted: #9C97AE;
    --rule: #312D43; --brand: #B4A2FF; --brand-ink: #1B1530; --ok: #7FD3A8; --warn: #F5B27E; --bad: #F49BBA;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -24px rgba(0, 0, 0, .7);
    --tint: 17%; --tint-base: #1F1C2C; --page-bg: #0F0D17;
    --c-editeur: #B4A2FF; --c-convertir: #8CC4F0; --c-organiser: #7FD3A8; --c-optimiser: #F5A27E; --c-securite: #F49BBA; --c-cv: #7DD3DC;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15131F; --surface: #1F1C2C; --paper-2: #282438; --ink: #F2EFFA; --ink-2: #CFCADD; --muted: #9C97AE;
  --rule: #312D43; --brand: #B4A2FF; --brand-ink: #1B1530; --ok: #7FD3A8; --warn: #F5B27E; --bad: #F49BBA;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -24px rgba(0, 0, 0, .7);
  --tint: 17%; --tint-base: #1F1C2C; --page-bg: #0F0D17;
  --c-editeur: #B4A2FF; --c-convertir: #8CC4F0; --c-organiser: #7FD3A8; --c-optimiser: #F5A27E; --c-securite: #F49BBA; --c-cv: #7DD3DC;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; touch-action: manipulation; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--head); font-optical-sizing: auto; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, 100% - 32px); margin: 0 auto; }
main { flex: 1; outline: none; }
.muted { color: var(--muted); }

/* ---------- en-tête */
.mast { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, calc((100% - 1160px) / 2)) 10px;
  background: color-mix(in srgb, var(--paper) 84%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.mark { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 500 22px/1 var(--head); letter-spacing: -0.02em; white-space: nowrap; }
.mark span { font-weight: 800; }
.mark i { width: 22px; height: 22px; border-radius: 9px 50% 50% 50%; background: linear-gradient(135deg, var(--c-editeur), var(--c-securite)); transform: rotate(45deg); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 8px 14px; border-radius: var(--r-pill); }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.who { margin-left: auto; text-decoration: none; font-weight: 700; font-size: 14px; background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: var(--r-pill); white-space: nowrap; }
.who.in { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; }
.who.in b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 18%, var(--tint-base)); color: var(--brand); font-size: 12px; }
body:not(.user) .only-user { display: none; }
.announce { margin: 4px auto 0; width: min(1160px, 100% - 32px); padding: 10px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--brand) var(--tint), var(--tint-base)); font-weight: 600; font-size: 14px; }

.tabbar { display: none; }
.foot { width: min(1160px, 100% - 32px); margin: 56px auto 0; padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.foot p { margin: 4px 0; }
body[data-page="editeur"] .foot { display: none; }

/* ---------- boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-pill); padding: 11px 18px;
  font-weight: 700; font-size: 15px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); text-decoration: none; white-space: nowrap; transition: transform .12s, background .2s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); display: inline-grid; place-items: center; box-shadow: var(--shadow); flex: none; }
.icon-btn.flat { box-shadow: none; background: transparent; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 500; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), .field select, .field textarea, select.input {
  width: 100%; border: 1.5px solid var(--rule); background: var(--surface); border-radius: var(--r-sm); padding: 11px 13px; font-size: 16px; color: var(--ink); font-weight: 500; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: var(--r-pill); padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
input[type=color] { width: 44px; height: 40px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); background: var(--surface); padding: 3px; }
input[type=range] { accent-color: var(--brand); }

/* ---------- pastilles */
.ico { display: inline-grid; place-items: center; flex: none; border-radius: 16px; width: 48px; height: 48px; color: var(--cat, var(--brand));
  background: color-mix(in srgb, var(--cat, var(--brand)) var(--tint), var(--tint-base)); }
.ico svg { width: 24px; height: 24px; }
[data-cat="editeur"] { --cat: var(--c-editeur); } [data-cat="convertir"] { --cat: var(--c-convertir); }
[data-cat="organiser"] { --cat: var(--c-organiser); } [data-cat="optimiser"] { --cat: var(--c-optimiser); }
[data-cat="securite"] { --cat: var(--c-securite); } [data-cat="cv"] { --cat: var(--c-cv); }

/* ---------- accueil */
.hero { padding: 36px 0 18px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px; align-items: start; }
.hero > div:first-child { padding-top: 28px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); font-weight: 700; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--c-editeur), var(--c-securite)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--ink-2); margin: 16px 0 22px; max-width: 34em; }
.hero .pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; background: var(--surface); padding: 6px 12px; border-radius: var(--r-pill); box-shadow: var(--shadow); color: var(--ink-2); }
.pill svg { width: 15px; height: 15px; color: var(--ok); }
.drop { position: relative; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-lg); padding: 30px 24px; text-align: center;
  border: 2px dashed color-mix(in srgb, var(--brand) 35%, transparent); transition: border-color .2s, transform .2s; cursor: pointer; }
.drop.over { border-color: var(--brand); transform: scale(1.01); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.drop .big { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c-editeur) 22%, var(--tint-base)), color-mix(in srgb, var(--c-securite) 18%, var(--tint-base))); color: var(--brand); }
.drop .big svg { width: 34px; height: 34px; }
.drop h2 { font-size: 24px; }
.drop p { color: var(--muted); margin: 8px 0 16px; font-size: 15px; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.suggest { margin-top: 16px; display: grid; gap: 8px; text-align: left; }
.suggest h3 { font: 700 13px/1.2 var(--text); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px; }
.sug { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); border: 0; text-align: left; width: 100%; }
.sug:hover { background: var(--paper-2); }
.sug .ico { width: 38px; height: 38px; border-radius: 12px; }
.sug .ico svg { width: 19px; height: 19px; }
.sug b { display: block; font-size: 15px; }
.sug span { font-size: 13px; color: var(--muted); }
.section { margin-top: 44px; }
.section > h2 { font-size: 30px; margin-bottom: 6px; }
.section > p.sub { color: var(--muted); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 12px; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card h3 { font: 700 17px/1.25 var(--text); letter-spacing: -0.01em; }
.card p { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.big-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { border-radius: var(--r-xl); padding: 24px; background: color-mix(in srgb, var(--cat) var(--tint), var(--tint-base)); text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 210px; transition: transform .15s; }
.feature:hover { transform: translateY(-3px); }
.feature .ico { background: var(--surface); }
.feature h3 { font-size: 26px; margin-top: auto; }
.feature p { margin: 0; color: var(--ink-2); font-size: 15px; }
.cat-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font: 700 14px/1 var(--text); text-transform: uppercase; letter-spacing: .07em; color: var(--cat); }
.cat-title::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--cat); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how div { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.how b { font-family: var(--head); font-size: 28px; color: var(--brand); }
.how p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- page outil */
.tool-head { display: flex; gap: 16px; align-items: center; padding: 28px 0 18px; }
.tool-head .ico { width: 58px; height: 58px; border-radius: 20px; }
.tool-head h1 { font-size: clamp(28px, 4vw, 42px); }
.tool-head p { margin: 4px 0 0; color: var(--muted); }
.tool-body { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
.panel h2 { font: 700 17px/1.2 var(--text); margin-bottom: 14px; letter-spacing: -0.01em; }
.panel .stack { display: grid; gap: 14px; }
.files { display: grid; gap: 8px; margin-top: 14px; }
.file { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: var(--r-md); padding: 10px 12px; }
.file .th { width: 44px; height: 56px; border-radius: 8px; background: var(--surface); flex: none; overflow: hidden; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); box-shadow: var(--shadow); }
.file .th img { width: 100%; height: 100%; object-fit: cover; }
.file .meta { flex: 1; min-width: 0; }
.file .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.file .meta span { color: var(--muted); font-size: 13px; }
.file .handle { cursor: grab; color: var(--muted); touch-action: none; }
.file.dragging { opacity: .6; }
.drop.small { padding: 22px; }
.drop.small .big { width: 54px; height: 54px; border-radius: 18px; margin-bottom: 10px; }
.drop.small h2 { font-size: 19px; }
.result { text-align: center; padding: 26px 18px; }
.result .okmark { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 15%, var(--tint-base)); color: var(--ok); display: grid; place-items: center; margin: 0 auto 12px; }
.result .okmark svg { width: 32px; height: 32px; stroke-width: 2.4; }
.result h2 { font-size: 26px; margin-bottom: 6px; }
.result .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.chain { margin-top: 22px; text-align: left; }
.chain h3 { font: 700 13px/1 var(--text); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.chain .row { gap: 8px; }
.progress { height: 8px; border-radius: 8px; background: var(--paper-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c-editeur), var(--c-securite)); transition: width .2s; }
.progress.indet i { width: 40%; animation: indet 1.1s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.faq { margin-top: 30px; }
.faq details { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--ink-2); margin: 8px 0 0; }

/* ---------- éditeur */
body[data-page="editeur"] { height: 100dvh; overflow: hidden; }
body[data-page="editeur"] main { display: flex; flex-direction: column; min-height: 0; }
.ed-start { width: min(760px, 100% - 32px); margin: 30px auto; }
.ed-start h1 { font-size: clamp(30px, 4.6vw, 48px); margin-bottom: 10px; }
.ed-start > p { color: var(--ink-2); font-size: 17px; margin: 0 0 22px; }
.ed-start .tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.ed-start .tips div { background: var(--surface); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow); font-size: 14px; color: var(--ink-2); }
.ed-start .tips b { display: block; color: var(--ink); margin-bottom: 4px; }
.ed { flex: 1; min-height: 0; display: grid; grid-template-columns: 76px 1fr 300px; grid-template-rows: auto 1fr; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 6px max(12px, env(safe-area-inset-left)) 10px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.ed-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; border: 0; background: transparent; padding: 6px 8px; border-radius: 10px; }
.ed-name:hover { background: var(--surface); }
.ed-top .sp { flex: 1; }
.ed-top .zoom { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; min-width: 46px; text-align: center; color: var(--muted); }
.ed-tools { grid-row: 2; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-right: 1px solid var(--rule); overflow-y: auto; align-items: center; }
.tbtn { width: 54px; border: 0; background: transparent; border-radius: 14px; padding: 8px 2px 6px; display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.tbtn svg { width: 21px; height: 21px; }
.tbtn:hover { background: var(--surface); }
.tbtn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ed-canvas { grid-row: 2; overflow: auto; background: var(--page-bg); padding: 24px 20px 120px; position: relative; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.ed-pages { display: grid; justify-items: center; gap: 22px; }
.pg { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 18px 40px -22px rgba(31,26,51,.45); border-radius: 3px; user-select: none; -webkit-user-select: none; }
.pg > img { display: block; width: 100%; height: 100%; border-radius: 3px; pointer-events: none; }
.pg .num { position: absolute; left: -2px; top: -20px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pg .ov { position: absolute; inset: 0; }
.pg.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.35); animation: pulse 1s infinite; pointer-events: none; }
@keyframes pulse { 50% { opacity: .4; } }
.u { position: absolute; border-radius: 2px; cursor: text; transition: background .12s, box-shadow .12s; }
.mode-text .u:hover, .u.sel { background: rgba(108, 76, 224, .10); box-shadow: 0 0 0 1.5px rgba(108, 76, 224, .55); }
.u.sel { box-shadow: 0 0 0 2px var(--c-editeur); background: rgba(108, 76, 224, .06); }
.show-all .u { background: rgba(108, 76, 224, .07); box-shadow: 0 0 0 1px rgba(108, 76, 224, .25); }
.ov.cross { cursor: crosshair; }
.ov .u { pointer-events: auto; }
.ov.cross .u { pointer-events: none; }
.rubber { position: absolute; border: 2px dashed var(--c-editeur); background: rgba(108, 76, 224, .08); pointer-events: none; }
.rubber.black { border-color: #000; background: rgba(0,0,0,.35); }
.rubber.white { border-color: #999; background: rgba(255,255,255,.75); }
.placer { position: absolute; border: 2px solid var(--c-editeur); cursor: move; touch-action: none; }
.placer img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.placer .h { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-editeur); border: 3px solid #fff; cursor: nwse-resize; touch-action: none; }
.placer .bar { position: absolute; left: 50%; top: -48px; transform: translateX(-50%); display: flex; gap: 6px; }
.ed-side { grid-row: 2; border-left: 1px solid var(--rule); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--paper); }
.ed-side h3 { font: 700 13px/1 var(--text); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ed-side .hint { font-size: 14px; color: var(--ink-2); background: var(--surface); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow); }
.ed-side .hint b { display: block; margin-bottom: 4px; color: var(--ink); }
.thumbs { display: grid; gap: 10px; }
.thumb { position: relative; border: 0; padding: 0; background: transparent; border-radius: 6px; }
.thumb img { width: 100%; display: block; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12); background: #fff; }
.thumb span { position: absolute; bottom: 4px; right: 6px; font-size: 11px; font-weight: 800; background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.thumb[aria-current="true"] img { outline: 3px solid var(--brand); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-2); }
.status-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-chip.exact i { background: var(--ok); }
.status-chip.near i { background: var(--warn); }
.pop { position: fixed; z-index: 60; width: min(420px, calc(100vw - 24px)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 14px; display: grid; gap: 10px; }
.pop textarea, .pop input.txt { width: 100%; border: 1.5px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px; resize: vertical; min-height: 46px; background: var(--paper); color: var(--ink); }
.pop textarea:focus { outline: none; border-color: var(--brand); }
.pop .fontline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pop .fontline b { color: var(--ink); }
.pop .ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pop .ctrls input[type=number] { width: 74px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); padding: 8px; background: var(--paper); }
.pop .acts { display: flex; gap: 8px; justify-content: flex-end; }
.pop .nudge { display: inline-flex; gap: 2px; }
.pop .nudge button { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; }
.pop .nudge svg { width: 16px; height: 16px; }
.pop .link { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 0; font-size: 13px; text-decoration: underline; }
.pagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 4px; }
.pcard { background: var(--surface); border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow); display: grid; gap: 8px; touch-action: none; position: relative; }
.pcard .pimg { aspect-ratio: .72; display: grid; place-items: center; background: var(--paper); border-radius: 8px; overflow: hidden; cursor: grab; }
.pcard .pimg img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s; background: #fff; }
.pcard .blank { width: 70%; aspect-ratio: .707; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pcard .pact { display: flex; justify-content: space-between; align-items: center; }
.pcard .pact b { font-size: 13px; }
.pcard .pact .icon-btn { width: 32px; height: 32px; box-shadow: none; background: var(--paper); }
.pcard .pact .icon-btn svg { width: 16px; height: 16px; }
.pcard.drag { opacity: .5; }
.pcard.target { outline: 3px dashed var(--brand); }
.pages-mode { position: absolute; inset: 0; background: var(--page-bg); overflow: auto; padding: 18px; z-index: 5; }
.pages-mode .bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; position: sticky; top: -18px; background: var(--page-bg); padding: 12px 0; z-index: 2; }
.formlist { display: grid; gap: 10px; }

/* ---------- feuilles / modales */
.scrim { position: fixed; inset: 0; background: rgba(20, 16, 34, .38); z-index: 70; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(520px, 100%); max-height: min(88dvh, 760px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 22px; animation: rise .2s ease-out; }
.sheet.wide { width: min(760px, 100%); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.sheet h2 { font-size: 24px; margin-bottom: 6px; }
.sheet > p { color: var(--ink-2); margin: 0 0 16px; }
.sheet .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sigpad { width: 100%; height: 190px; border-radius: var(--r-md); background: var(--paper); border: 1.5px dashed var(--rule); touch-action: none; display: block; }
.sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.sig { position: relative; border: 1.5px solid var(--rule); background: #fff; border-radius: var(--r-md); padding: 8px; height: 76px; display: grid; place-items: center; }
.sig img { max-width: 100%; max-height: 100%; }
.sig .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--paper-2); display: grid; place-items: center; color: #333; }
.sig .x svg { width: 14px; height: 14px; }
.fontpick { max-height: 260px; overflow: auto; display: grid; gap: 4px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); padding: 4px; }
.fontpick button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.fontpick button:hover, .fontpick button[aria-pressed="true"] { background: var(--paper-2); }
.fontpick small { color: var(--muted); font-size: 12px; }

.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: rise .2s; pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--bad); color: #fff; }
.toast button { margin-left: auto; border: 0; background: rgba(255,255,255,.16); color: inherit; border-radius: 10px; padding: 5px 10px; font-weight: 700; }

/* ---------- CV */
.cv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 22px; align-items: start; padding-top: 22px; }
.cv-form { display: grid; gap: 14px; }
.cv-form .panel h2 { display: flex; align-items: center; justify-content: space-between; }
.cv-entry { background: var(--paper); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; position: relative; }
.cv-entry .rm { position: absolute; top: 8px; right: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper-2); border-radius: var(--r-pill); padding: 6px 8px 6px 12px; font-size: 14px; font-weight: 600; }
.chip button { border: 0; background: var(--surface); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.chip button svg { width: 12px; height: 12px; }
.cv-prev { position: sticky; top: 84px; }
.cv-fab { display: none; }
.cv-prev .sheetprev { background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); aspect-ratio: 210 / 297; overflow: hidden; position: relative; }
.cv-prev .sheetprev img { width: 100%; display: block; }
.cv-prev .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--rule); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.photo-in { display: flex; gap: 12px; align-items: center; }
.photo-in .ph { width: 64px; height: 64px; border-radius: 50%; background: var(--paper-2) center/cover; flex: none; }

/* ---------- compte & documents */
.auth { width: min(440px, 100% - 32px); margin: 34px auto; }
.auth h1 { font-size: 36px; margin-bottom: 6px; }
.auth > p { color: var(--ink-2); margin: 0 0 18px; }
.auth .panel { display: grid; gap: 14px; }
.auth .switch { text-align: center; margin-top: 14px; font-size: 15px; }
.auth .switch button { border: 0; background: none; color: var(--brand); font-weight: 700; text-decoration: underline; }
.perks { display: grid; gap: 8px; margin-top: 18px; }
.perks div { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); }
.perks svg { color: var(--ok); width: 18px; height: 18px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 28px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 44px); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.usage { min-width: 220px; }
.usage .progress { margin-top: 6px; }
.usage span { font-size: 13px; font-weight: 600; color: var(--muted); }
.docs { display: grid; gap: 8px; }
.doc { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow); }
.doc .ico { width: 42px; height: 42px; border-radius: 13px; }
.doc .ico svg { width: 20px; height: 20px; }
.doc .meta { flex: 1; min-width: 0; }
.doc .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .meta span { font-size: 13px; color: var(--muted); }
.doc .acts { display: flex; gap: 6px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.empty h2 { color: var(--ink); font-size: 24px; margin-bottom: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- pages légales & admin */
.legal { width: min(760px, 100% - 32px); margin: 30px auto; }
.legal h1 { font-size: 40px; margin-bottom: 16px; }
.legal h2 { font-size: 22px; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.adm { width: min(1160px, 100% - 32px); margin: 24px auto; display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.kpi b { display: block; font: 700 30px/1.1 var(--head); }
.kpi span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.bars { display: flex; align-items: end; gap: 4px; height: 140px; padding-top: 10px; }
.bars i { flex: 1; background: color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 5px 5px 2px 2px; min-height: 2px; position: relative; }
.bars i:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font: 600 12px var(--text); padding: 3px 7px; border-radius: 6px; white-space: nowrap; font-style: normal; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--rule); text-align: left; }
table.t th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.msg { background: color-mix(in srgb, var(--ok) 14%, var(--tint-base)); color: var(--ok); padding: 12px 16px; border-radius: var(--r-md); font-weight: 700; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 70px 1fr; }
  .ed-side { position: fixed; right: 12px; top: 130px; bottom: 86px; width: 300px; z-index: 30; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 0; background: var(--surface); transform: translateX(120%); transition: transform .2s; }
  .ed-side.open { transform: none; }
}
@media (min-width: 1101px) { .only-narrow { display: none !important; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 18px; gap: 22px; }
  .big-cards { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .tool-body { grid-template-columns: 1fr; }
  .cv { grid-template-columns: 1fr; }
  .cv-prev { position: static; scroll-margin-top: 70px; }
  .cv-fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: var(--shadow-lg); }
  .ed-start .tips { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav, .who { display: none; }
  .mast { justify-content: center; padding-bottom: 8px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--rule); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  body { padding-bottom: 64px; }
  .foot { margin-bottom: 70px; }
  .grid2 { grid-template-columns: 1fr; }
  body[data-page="editeur"] .tabbar { display: none; }
  body[data-page="editeur"] { padding-bottom: 0; }
  body[data-page="editeur"] .mast { display: none; }
  .ed { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .ed-top { padding-top: calc(8px + env(safe-area-inset-top)); }
  .ed-name { max-width: 34vw; }
  .ed-canvas { grid-row: 2; padding: 16px 8px 40px; }
  .ed-tools { grid-row: 3; flex-direction: row; border: 0; border-top: 1px solid var(--rule); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; background: var(--surface); }
  .tbtn { flex: none; width: 62px; }
  .ed-side { top: auto; left: 8px; right: 8px; bottom: 76px; width: auto; max-height: 55dvh; transform: translateY(130%); }
  .hide-sm { display: none !important; }
  .pop { left: 8px !important; right: 8px; bottom: calc(80px + env(safe-area-inset-bottom)) !important; top: auto !important; width: auto; }
  .sheet { border-radius: var(--r-xl) var(--r-xl) 0 0; align-self: end; max-height: 92dvh; }
  .scrim { padding: 0; align-items: end; }
  .hero h1 { font-size: 36px; }
  .doc .acts .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
