:root{
  --bg:#f7f4f2;--surface:#fff;--surface2:#f1ece9;--ink:#1f1a1c;--mute:#6a6064;--line:#e4dcd8;
  --brand:#b3122d;--btn:#b3122d;--btn-hover:#980f26;--brand-soft:#fbe9ec;--ok:#17734a;--ok-soft:#e5f4ec;--warn:#8f4f00;--warn-soft:#fdf0dc;--ko:#b3122d;--ko-soft:#fbe9ec;
  --shadow:0 1px 2px rgba(31,26,28,.06),0 8px 24px rgba(31,26,28,.07);
  --radius:18px;--radius-sm:12px;
  --sans:ui-sans-serif,system-ui,-apple-system,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --bar-h:66px;--top-h:58px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
  --bg:#141011;--surface:#1e1819;--surface2:#272021;--ink:#f4eeec;--mute:#b1a6aa;--line:#372e30;
  --brand:#ff6a84;--btn:#d42a47;--btn-hover:#bd2340;--brand-soft:#3a1720;--ok:#4cc38a;--ok-soft:#14291f;--warn:#e8a94a;--warn-soft:#33260f;--ko:#ff7d90;--ko-soft:#3a1720;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35)}}
:root[data-theme=dark]{
  --bg:#141011;--surface:#1e1819;--surface2:#272021;--ink:#f4eeec;--mute:#b1a6aa;--line:#372e30;
  --brand:#ff6a84;--btn:#d42a47;--btn-hover:#bd2340;--brand-soft:#3a1720;--ok:#4cc38a;--ok-soft:#14291f;--warn:#e8a94a;--warn-soft:#33260f;--ko:#ff7d90;--ko-soft:#3a1720;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35)}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 var(--sans);-webkit-font-smoothing:antialiased}
body[data-size="l"]{font-size:18px}
h1,h2,h3{font-family:var(--serif);line-height:1.2;margin:0 0 .4em;letter-spacing:-.01em}
h1{font-size:clamp(30px,7vw,46px)}h2{font-size:clamp(22px,4.6vw,28px)}h3{font-size:19px}
p{margin:0 0 .8em}a{color:var(--brand);text-underline-offset:3px}
:focus-visible{outline:3px solid var(--brand);outline-offset:2px;border-radius:8px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:8px;top:-60px;background:var(--btn);color:#fff;padding:10px 14px;border-radius:10px;z-index:100;text-decoration:none}
.skip:focus{top:8px}

/* En-tête + navigation permanente */
.top{position:sticky;top:0;z-index:30;background:var(--bg);border-bottom:1px solid var(--line)}
.top-in{max-width:1040px;margin:0 auto;height:var(--top-h);display:flex;align-items:center;gap:14px;padding:0 16px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-family:var(--serif);font-weight:700;font-size:20px;letter-spacing:-.01em}
.brand img{width:34px;height:34px;border-radius:9px;box-shadow:0 2px 8px rgba(179,18,45,.35)}
.brand b{color:var(--brand);font-weight:700}
.brand span{display:inline-flex;gap:.28em}
.spacer{flex:1}
.iconbtn{width:42px;height:42px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);display:grid;place-items:center;cursor:pointer}
.iconbtn:hover{border-color:var(--brand)}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;height:calc(var(--bar-h) + env(safe-area-inset-bottom));padding-bottom: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(--line);display:grid;grid-template-columns:repeat(5,1fr)}
.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--mute);text-decoration:none;font-size:11.5px;font-weight:600;padding:6px 2px;border:0;background:none;cursor:pointer;font-family:inherit;position:relative}
.tab svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.tab[aria-current=page]{color:var(--brand)}
.tab[aria-current=page]::before{content:"";position:absolute;top:0;width:34px;height:3px;border-radius:0 0 4px 4px;background:var(--brand)}
main{max-width:1040px;margin:0 auto;padding:18px 16px calc(var(--bar-h) + 40px + env(safe-area-inset-bottom));min-height:70vh}
@media (min-width:860px){
  .tabbar{position:static;height:auto;padding:0;border:0;background:none;backdrop-filter:none;display:flex;gap:4px;margin-left:8px}
  .tab{flex-direction:row;gap:8px;font-size:15px;padding:9px 14px;border-radius:12px}
  .tab[aria-current=page]{background:var(--brand-soft)}.tab[aria-current=page]::before{display:none}
  .tab svg{width:20px;height:20px}
  main{padding-bottom:60px}
  .top-in{gap:8px}
}

/* Composants */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin:14px 0;box-shadow:var(--shadow)}
.card.flat{box-shadow:none}
.grid2{display:grid;gap:14px}.grid3{display:grid;gap:14px}
@media (min-width:760px){.grid2{grid-template-columns:1fr 1fr}.grid3{grid-template-columns:repeat(3,1fr)}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 22px;border-radius:14px;border:1px solid var(--btn);background:var(--btn);color:#fff;font:600 16px var(--sans);cursor:pointer;text-decoration:none;transition:transform .12s,background .15s}
.btn:hover{background:var(--btn-hover)}.btn:active{transform:scale(.98)}
.btn[disabled]{opacity:.45;cursor:not-allowed;transform:none}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line)}
.btn.ghost:hover{border-color:var(--brand);background:var(--brand-soft)}
.btn.sm{min-height:38px;padding:0 14px;font-size:14px;border-radius:11px}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.mute{color:var(--mute)}.small{font-size:14px}.tiny{font-size:12.5px}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:99px;border:1px solid currentColor;white-space:nowrap}
.pill.ok{color:var(--ok);background:var(--ok-soft)}.pill.warn{color:var(--warn);background:var(--warn-soft)}.pill.ko{color:var(--ko);background:var(--ko-soft)}.pill.brand{color:var(--brand);background:var(--brand-soft)}.pill.gray{color:var(--mute);background:var(--surface2)}
.seg{display:inline-grid;grid-auto-flow:column;background:var(--surface2);border-radius:14px;padding:4px;gap:4px}
.seg button{border:0;background:none;padding:10px 18px;border-radius:11px;font:600 15px var(--sans);color:var(--mute);cursor:pointer}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.12)}
input[type=text],input[type=date],select,textarea{width:100%;font:16px var(--sans);color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:11px 12px}
textarea{min-height:190px;resize:vertical;font:15px/1.5 ui-monospace,Menlo,Consolas,monospace}
label{display:block;font-weight:600;font-size:14px;margin:10px 0 4px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:7px 14px;border-radius:99px;font:600 14px var(--sans);cursor:pointer}
.chip[aria-pressed=true]{background:var(--btn);border-color:var(--btn);color:#fff}
.eyebrow{font-size:12.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--brand);margin-bottom:6px}

/* Accueil */
.hero{position:relative;overflow:hidden;border-radius:26px;padding:28px 22px;color:#fff;background:linear-gradient(135deg,#c8203f 0%,#a01127 55%,#5f0a1b 100%);box-shadow:0 18px 40px rgba(120,10,30,.28)}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.22),transparent 68%)}
.hero h1{color:#fff;margin-bottom:12px;max-width:16ch}
.hero p{color:rgba(255,255,255,.92);max-width:46ch;font-size:17px}
.hero .btn{background:#fff;color:#8f0f26;border-color:#fff}.hero .btn:hover{background:#f3e8ea}
.hero .btn.ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.6)}.hero .btn.ghost:hover{background:rgba(255,255,255,.14)}
@media (min-width:760px){.hero{padding:48px 44px}}
.story{font-family:var(--serif);font-size:19px;line-height:1.6;max-width:62ch}
.feat .ico{width:46px;height:46px;border-radius:14px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;margin-bottom:10px}
.feat .ico svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.steps{counter-reset:s;display:grid;gap:12px;padding:0;margin:0;list-style:none}
.steps li{counter-increment:s;display:flex;gap:14px;align-items:flex-start}
.steps li::before{content:counter(s);flex:none;width:34px;height:34px;border-radius:50%;background:var(--btn);color:#fff;display:grid;place-items:center;font-weight:700}
.not{display:grid;gap:8px;padding:0;margin:0;list-style:none}.not li{display:flex;gap:10px}.not li::before{content:"✕";color:var(--ko);font-weight:800}

/* Analyse */
.drop{border:2px dashed var(--line);border-radius:var(--radius);padding:26px 16px;text-align:center;background:var(--surface2);transition:border-color .15s,background .15s}
.drop.over{border-color:var(--brand);background:var(--brand-soft)}
.drop svg{width:38px;height:38px;stroke:var(--brand);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.file-ok{display:flex;align-items:center;gap:8px;justify-content:center;margin-top:8px;font-weight:600}
.spin{width:18px;height:18px;border:3px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.ring{--p:0;width:112px;height:112px;border-radius:50%;background:conic-gradient(var(--brand) calc(var(--p)*1%),var(--surface2) 0);display:grid;place-items:center;flex:none}
.ring>div{width:84px;height:84px;border-radius:50%;background:var(--surface);display:grid;place-items:center;text-align:center;line-height:1.1}
.ring b{font:700 26px var(--serif)}.ring span{font-size:11px;color:var(--mute)}
.meter{height:8px;background:var(--surface2);border-radius:99px;overflow:hidden}.meter>i{display:block;height:100%;background:var(--brand);border-radius:99px;transition:width .5s}
.crit{border:1px solid var(--line);border-radius:var(--radius-sm);margin:10px 0;background:var(--surface)}
.crit summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px;cursor:pointer;font-weight:600}
.crit summary::-webkit-details-marker{display:none}
.crit summary::after{content:"›";transform:rotate(90deg);transition:transform .2s;color:var(--mute);font-size:20px}
.crit[open] summary::after{transform:rotate(270deg)}
.crit ul{margin:0;padding:0 14px 14px 30px}.crit li{margin:5px 0}
.crit li small{display:block;color:var(--mute)}
.prio{border-left:5px solid var(--brand)}
.empty{text-align:center;padding:30px 12px;color:var(--mute)}
.empty svg{width:44px;height:44px;stroke:var(--mute);fill:none;stroke-width:1.5;margin-bottom:6px}
.alert{border-radius:var(--radius-sm);padding:12px 14px;margin:10px 0;border:1px solid}
.alert.err{background:var(--ko-soft);color:var(--ko);border-color:var(--ko)}
.alert.info{background:var(--surface2);border-color:var(--line)}

/* Grilles */
.gcard h3{margin-bottom:2px}.gcard .meta{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.fav{background:none;border:0;cursor:pointer;font-size:24px;line-height:1;color:var(--mute);padding:4px}.fav[aria-pressed=true]{color:#e0a100}
table.bar{width:100%;border-collapse:collapse;font-size:14.5px;margin-top:8px}table.bar td,table.bar th{padding:7px 8px;border-bottom:1px solid var(--line);text-align:left}table.bar td:last-child,table.bar th:last-child{text-align:right;white-space:nowrap}

/* Espace */
.check{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}
.check input{width:22px;height:22px;accent-color:var(--brand);flex:none;margin-top:2px}
.hist{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.count{font:700 40px var(--serif);color:var(--brand)}
.spark{display:flex;align-items:flex-end;gap:4px;height:44px}.spark i{flex:1;background:var(--brand);opacity:.85;border-radius:4px 4px 0 0;min-height:4px}

/* Offres */
.plan{position:relative}.plan.best{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand),var(--shadow)}
.plan ul{padding-left:20px;margin:10px 0}.plan li{margin:5px 0}
details.faq{border-bottom:1px solid var(--line);padding:12px 0}details.faq summary{cursor:pointer;font-weight:600}details.faq p{margin:8px 0 0;color:var(--mute)}

/* Toast, modale */
.toast{position:fixed;left:50%;bottom:calc(var(--bar-h) + 18px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:11px 18px;border-radius:99px;font-weight:600;font-size:14.5px;opacity:0;pointer-events:none;transition:.25s;z-index:60;max-width:90vw}
.toast.on{opacity:1;transform:translate(-50%,0)}
@media (min-width:860px){.toast{bottom:28px}}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:grid;place-items:center;z-index:70;padding:16px}
.modal[hidden]{display:none}
.modal>div{background:var(--surface);border-radius:var(--radius);padding:22px;max-width:420px;width:100%;box-shadow:var(--shadow)}
footer.f{border-top:1px solid var(--line);margin-top:30px;padding-top:18px;color:var(--mute);font-size:13.5px}
footer.f a{color:var(--mute)}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{
  .top,.tabbar,.noprint,.toast,footer.f{display:none!important}
  body{background:#fff;color:#000}main{padding:0}.card{box-shadow:none;break-inside:avoid}
  .crit{break-inside:avoid}.crit>*{display:block}details:not([open])>ul{display:block}
}

.ic{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pill{font-family:var(--sans)}
#view:focus,#view:focus-visible{outline:none}
.iconbtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

h2.h3{font-family:var(--serif);font-size:19px;line-height:1.25;margin:0 0 .4em}
