/* Pages publiques — mêmes règles que le panel (theme-flat.css) : bichrome, plat, sans ombre ni verre.
   Tokens : panel-tokens.css (--t-bg fond, --t-fg texte + accent). Rayons du panel : 4 / 8 / 10 (contrôles) / 12 (panneaux). */
:root{
  --r-ctl:10px;--r-panel:12px;
  --pub-bg:var(--bg);--pub-card:var(--surface-solid);--pub-line:var(--border);--pub-soft:var(--secondary);
  --pub-text:var(--text);--pub-muted:var(--muted);
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);font-family:var(--font-body);line-height:1.6;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a{color:inherit}
:where(a,button,summary,input):focus-visible{outline:2px solid color-mix(in srgb,var(--t-fg) 55%,transparent);outline-offset:1px}
.pub-wrap{width:min(1140px,100% - 40px);margin-inline:auto}

/* Barre du haut = .topbar du panel */
.pub-nav{position:sticky;top:12px;z-index:30;display:flex;align-items:center;gap:18px;margin:12px auto 0;padding:10px 12px 10px 16px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel)}
.pub-logo{display:flex;align-items:center;gap:9px;margin-right:auto;font-weight:800;font-size:1.02rem;letter-spacing:-.01em;color:var(--important);text-decoration:none}
.pub-logo img{width:auto;height:30px;object-fit:contain}
.pub-nav nav{display:flex;gap:2px}
.pub-nav nav a{padding:6px 12px;border-radius:var(--r-ctl);font-size:.84rem;font-weight:650;color:var(--muted);text-decoration:none;transition:background .15s,color .15s}
.pub-nav nav a:hover{background:var(--tint-hover);color:var(--text)}

/* Boutons = .primary / .secondary du panel */
.btn-p,.btn-s{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;padding:0 16px;border:1px solid transparent;border-radius:var(--r-ctl);font:700 .82rem var(--font-body);text-decoration:none;cursor:pointer;transition:background .15s,border-color .15s}
.btn-p{background:var(--t-fg);color:var(--btn-ink)}
.btn-p:hover{background:color-mix(in srgb,var(--t-fg) 86%,var(--t-bg))}
.btn-s{background:transparent;border-color:var(--border);color:var(--text)}
.btn-s:hover{background:var(--tint-hover);border-color:color-mix(in srgb,var(--t-fg) 30%,var(--t-bg))}

/* Typo = .eyebrow / h1 / h2 du panel */
.eyebrow{display:block;margin:0 0 .45rem;font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--important)}
h1{margin:0 0 14px;font-size:clamp(2.1rem,4.6vw,3.3rem);line-height:1.05;font-weight:800;letter-spacing:-.03em;color:var(--important);text-wrap:balance}
h2{margin:0 0 8px;font-size:clamp(1.5rem,2.8vw,2.1rem);line-height:1.12;font-weight:800;letter-spacing:-.02em;color:var(--important);text-wrap:balance}
.lead{max-width:56ch;margin:0;color:var(--muted);font-size:1.02rem}
.cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}

.hero{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:clamp(28px,5vw,64px);align-items:center;padding:clamp(40px,7vw,88px) 0 clamp(36px,6vw,72px)}
section.blk{padding:clamp(36px,6vw,72px) 0;border-top:1px solid var(--border-subtle)}
.sec-head{max-width:640px;margin-bottom:26px}

/* Cartes = .glass-card du panel en mode plat : fond uni + fine bordure */
.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
.card{padding:20px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel);transition:border-color .15s,background .15s}
.card:hover{border-color:var(--t-fg);background:var(--tint-hover)}
.card .ico{display:grid;place-items:center;width:36px;height:36px;margin-bottom:14px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--secondary);color:var(--text)}
.card .ico svg{width:18px;height:18px}
.card h3{margin:0 0 5px;font-size:.98rem;font-weight:800;color:var(--important)}.card p{margin:0;color:var(--muted);font-size:.87rem}

/* Aperçu du panel : sidebar plate, active = --secondary, comme sidebar + theme-flat */
.win{display:grid;grid-template-columns:176px minmax(0,1fr);overflow:hidden;border:1px solid var(--border);border-radius:var(--r-panel);background:var(--bg)}
.win-side{display:grid;align-content:start;gap:2px;padding:14px 10px;background:var(--sidebar);border-right:1px solid var(--border)}
.win-side .brand{display:flex;align-items:center;gap:8px;padding:2px 8px 14px;color:var(--text);font-weight:800;font-size:.9rem}
.win-side .brand img{width:auto;height:22px;object-fit:contain}
.win-side .nav{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:var(--r-ctl);color:var(--muted);font-size:.78rem;font-weight:650}
.win-side .nav svg{width:15px;height:15px;flex:none}
.win-side .nav.on{background:var(--secondary);color:var(--text)}
.win-main{display:grid;align-content:start;gap:11px;padding:14px;min-width:0}
.win-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 13px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel)}
.win-top b{font-size:.92rem;font-weight:800;color:var(--important)}
.avs{display:flex}.avs i{width:20px;height:20px;margin-left:-6px;border-radius:var(--radius-xs);border:2px solid var(--surface-solid);background:var(--t-fg)}.avs i:nth-child(2){opacity:.65}.avs i:nth-child(3){opacity:.35}.avs i:first-child{margin-left:0}
.tabs{display:flex;gap:6px;flex-wrap:wrap}
.tab{padding:5px 12px;border:1px solid transparent;border-radius:var(--r-ctl);background:transparent;color:var(--muted);font-size:.74rem;font-weight:700;white-space:nowrap}
.tab.on{background:var(--secondary);border-color:var(--border);color:var(--text)}
.gtitle{display:flex;align-items:center;gap:8px;margin:2px 0 -3px;font-size:.8rem;font-weight:800;color:var(--important)}
.gcount{padding:0 8px;border:1px solid var(--border);border-radius:var(--r-ctl);color:var(--muted);font-size:.66rem}
.row{display:flex;align-items:center;gap:10px;padding:9px 13px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-ctl);font-size:.78rem;min-width:0}
.row strong{margin-right:auto;font-size:.84rem;color:var(--important);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row small{color:var(--muted);white-space:nowrap}
.pill{padding:1px 9px;border:1px solid var(--border);border-radius:var(--r-ctl);background:transparent;font-size:.68rem;font-weight:700;white-space:nowrap;color:var(--muted)}
.pill.ok{color:var(--ai-green);border-color:color-mix(in srgb,var(--ai-green) 45%,var(--t-bg))}
.pill.pr,.pill.wa{color:var(--text);background:var(--secondary)}
.caption{margin:10px 2px 0;color:var(--muted);font-size:.74rem}
.crumb{display:flex;align-items:center;gap:6px;font-size:.72rem;color:var(--muted)}
.crumb span{padding:2px 9px;border:1px solid var(--border);border-radius:var(--r-ctl);font-weight:700;color:var(--text)}
.crumb span:last-child{background:var(--secondary)}
.tools{display:flex;gap:8px;align-items:center}
.tools .search{flex:1;min-width:0;height:34px;padding:0 11px;display:flex;align-items:center;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-solid);color:var(--muted);font-size:.76rem}
.tools .b{height:34px;padding:0 12px;display:flex;align-items:center;border:1px solid var(--border);border-radius:var(--r-ctl);font-size:.74rem;font-weight:700;white-space:nowrap}
.fico{flex:none;width:15px;height:15px;color:var(--muted)}

/* Capture réelle */
.shot{margin:0}
.shot-img{display:block;width:100%;height:auto;border:1px solid var(--border);border-radius:var(--r-panel);background:var(--surface-solid)}
.shot-img[hidden],.shot .win[hidden]{display:none}

/* Panneaux d'aperçu */
.showcase{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:14px}
.pane{display:grid;gap:12px;align-content:start;padding:18px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel)}
.pane-h{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pane-h h3{margin:0;font-size:.95rem;font-weight:800;color:var(--important)}
.pane-h .eb{font-size:.66rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.kpi{padding:12px;border:1px solid var(--border-subtle);border-radius:var(--r-ctl);background:var(--secondary)}
.kpi b{display:block;font-size:1.25rem;font-weight:800;color:var(--important);font-variant-numeric:tabular-nums}.kpi span{font-size:.72rem;color:var(--muted);font-weight:600}
.live{display:inline-flex;align-items:center;gap:7px;font-size:.7rem;font-weight:700;color:var(--muted)}
.live i{width:7px;height:7px;border-radius:50%;background:var(--muted)}
.live.on i{background:var(--ai-green);animation:livepulse 2s infinite}
@keyframes livepulse{50%{opacity:.35}}
.modes{display:grid;gap:7px}
.mode{display:flex;gap:11px;align-items:flex-start;padding:11px 12px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-solid)}
.mode.on{border-color:var(--t-fg);background:var(--secondary)}
.mode i{flex:none;width:16px;height:16px;margin-top:2px;border:2px solid var(--border);border-radius:50%}
.mode.on i{border-color:var(--t-fg);background:radial-gradient(circle,var(--t-fg) 4px,transparent 5px)}
.mode b{display:block;font-size:.84rem;color:var(--important)}.mode small{color:var(--muted);font-size:.76rem;line-height:1.4}

/* Thèmes : pastille bichrome comme .theme-swatch du panel */
.themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}
.themes button{display:flex;align-items:center;gap:9px;padding:8px 11px 8px 8px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-ctl);color:var(--text);font:700 .78rem var(--font-body);cursor:pointer;transition:border-color .15s,background .15s}
.themes button:hover{background:var(--tint-hover)}
.themes button[aria-pressed=true]{border-color:var(--t-fg);background:var(--secondary)}
.themes i{flex:none;width:22px;height:22px;border:1px solid var(--border);border-radius:6px}

details{padding:14px 16px;margin-top:8px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-ctl)}
summary{cursor:pointer;font-weight:800;color:var(--important);list-style:none;display:flex;justify-content:space-between;gap:12px}
summary::after{content:"+";color:var(--muted);font-weight:800}details[open] summary::after{content:"–"}
summary::-webkit-details-marker{display:none}
details p{margin:9px 0 0;color:var(--muted);font-size:.9rem}

.final{display:grid;gap:14px;justify-items:center;padding:clamp(32px,5vw,56px) 20px;text-align:center;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel)}
.final .cta{justify-content:center;margin-top:6px}
footer.pub-foot{display:flex;flex-wrap:wrap;gap:12px 28px;justify-content:space-between;align-items:center;padding:30px 0 44px;color:var(--muted);font-size:.8rem}
footer.pub-foot div{display:flex;gap:18px;flex-wrap:wrap}
footer.pub-foot a,footer.pub-foot button{all:unset;cursor:pointer;color:var(--muted);font-weight:600}
footer.pub-foot a:hover,footer.pub-foot button:hover{color:var(--text);text-decoration:underline}
footer.pub-foot button:focus-visible{outline:2px solid color-mix(in srgb,var(--t-fg) 55%,transparent);outline-offset:3px}

@media(max-width:900px){.hero{grid-template-columns:1fr}.pub-nav nav{display:none}}
@media(max-width:640px){.win{grid-template-columns:1fr}.win-side{display:none}.tools .b:not(:first-of-type){display:none}.hero{padding-top:28px}.btn-p,.btn-s{flex:1 1 100%}.pub-wrap{width:calc(100% - 28px)}}
.pub-nav .btn-p,.pub-nav .btn-s{flex:0 0 auto}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* Capture du panel : chargement et erreur (plus de maquette de remplacement) */
.shot-box{position:relative;aspect-ratio:16/10;overflow:hidden;border:1px solid var(--border);border-radius:var(--r-panel);background:var(--surface-solid)}
.shot-box .shot-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:top left;border:0;border-radius:0}
.shot-state{display:grid;place-content:center;justify-items:center;gap:10px;text-align:center;color:var(--muted)}
.shot-box .shot-state{position:absolute;inset:0}
.shot-state[hidden]{display:none}
.shot-error svg{width:34px;height:34px}
.shot-error p{margin:0;font-size:.9rem;font-weight:700;color:var(--text)}
.stats-error{padding:26px 12px;border:1px dashed var(--border);border-radius:var(--r-ctl)}
.shot-loading{background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--t-fg) 7%,transparent),transparent) var(--bg);background-size:200% 100%;animation:shotshimmer 1.4s linear infinite}
@keyframes shotshimmer{to{background-position:-200% 0}}
.kpis[hidden],.pane [hidden]{display:none}

/* Agrandissement de la capture (modale) */
.shot-zoom{position:absolute;top:10px;right:10px;z-index:2;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-solid);color:var(--text);cursor:pointer;transition:background .15s,border-color .15s}
.shot-zoom:hover{background:var(--secondary);border-color:var(--t-fg)}
.shot-zoom[hidden]{display:none}
.shot-zoom svg,.shot-dialog-close svg{width:16px;height:16px}
.shot-box .shot-img.zoomable{cursor:zoom-in}
.shot-dialog{width:min(1440px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;overflow:auto;border:1px solid var(--border);border-radius:var(--r-panel);background:var(--surface-solid);color:var(--text)}
.shot-dialog::backdrop{background:rgba(8,12,28,.6);backdrop-filter:blur(3px)}
.shot-dialog img{display:block;width:100%;height:auto}
.shot-dialog-close{position:sticky;top:10px;float:right;margin:10px 10px -44px 0;z-index:2;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-solid);color:var(--text);cursor:pointer}
.shot-dialog-close:hover{background:var(--secondary)}

/* Créer / rejoindre un projet : étapes */
.flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.flow-card{padding:22px;background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--r-panel)}
.flow-card header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}
.flow-card h3{margin:0;font-size:1.05rem;font-weight:800;color:var(--important)}
.flow-tag{padding:1px 9px;border:1px solid var(--border);border-radius:var(--r-ctl);font-size:.68rem;font-weight:700;color:var(--muted)}
.steps{list-style:none;margin:0;padding:0}
.steps li{position:relative;display:flex;gap:14px;padding-bottom:20px}
.steps li:last-child{padding-bottom:0}
.steps li:not(:last-child)::before{content:"";position:absolute;left:15px;top:34px;bottom:2px;width:1px;background:var(--border)}
.step-n{flex:none;display:grid;place-items:center;width:31px;height:31px;border:1px solid var(--border);border-radius:50%;background:var(--secondary);color:var(--important);font-size:.82rem;font-weight:800}
.step-n svg{width:15px;height:15px}
.steps li.done .step-n{background:var(--t-fg);border-color:var(--t-fg);color:var(--btn-ink)}
.steps li>span:last-child{padding-top:4px}
.steps b{display:block;font-size:.92rem;color:var(--important)}
.steps small{display:block;margin-top:2px;color:var(--muted);font-size:.82rem;line-height:1.45}

/* Statistiques : tuiles qui remplissent le panneau + compte à rebours */
.stats-pane{align-content:stretch;grid-template-rows:auto 1fr auto}
.stats-pane .kpis{align-items:stretch}
.stats-pane .kpi{display:flex;flex-direction:column;justify-content:center;gap:6px;padding:16px 8px;text-align:center}
.stats-pane .kpi b{font-size:clamp(1.7rem,3.4vw,2.3rem);line-height:1}
.refresh{display:flex;align-items:center;gap:14px;padding:12px 14px;border:1px solid var(--border-subtle);border-radius:var(--r-ctl);background:var(--secondary)}
.ring-wrap{position:relative;flex:none;width:56px;height:56px}
.ring{width:100%;height:100%;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:5}
.ring-bg{stroke:var(--border)}
.ring-fg{stroke:var(--t-fg);stroke-linecap:round;transition:stroke-dashoffset .25s linear}
.ring-wrap b{position:absolute;inset:0;display:grid;place-items:center;font-size:.95rem;font-weight:800;color:var(--important);font-variant-numeric:tabular-nums}
.refresh-txt strong{display:block;font-size:.84rem;color:var(--important);font-variant-numeric:tabular-nums}
.refresh-txt span{display:block;margin-top:2px;font-size:.74rem;color:var(--muted)}

/* Section « Apprendre » */
.flow+.grid3{margin-top:14px}
.flow-card>p{margin:0 0 16px;color:var(--muted);font-size:.9rem}
.chips,.ticks,.tracks{margin:0;padding:0;list-style:none}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px}
.chips li{padding:3px 11px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--secondary);font-size:.76rem;font-weight:700;color:var(--text)}
.ticks{display:grid;gap:9px}
.ticks li{display:flex;gap:10px;align-items:flex-start;color:var(--muted);font-size:.86rem;line-height:1.45}
.ticks svg{flex:none;width:16px;height:16px;margin-top:2px;color:var(--t-fg)}
.tracks{display:grid;gap:7px;margin-bottom:18px}
.tracks li{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--secondary)}
.tracks b{display:block;font-size:.88rem;color:var(--important)}
.tracks small{display:block;color:var(--muted);font-size:.76rem}
.tracks .pill{margin-left:auto}

/* Cartes Cours / Projets : même hauteur, listes de points alignées en bas */
.flow-card{display:flex;flex-direction:column}
.flow-card .ticks{margin-top:auto}
.tk-ico{flex:none;display:grid;place-items:center;width:32px;height:32px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface-solid);color:var(--text)}
.tk-ico svg{width:16px;height:16px}
.tracks li>span:nth-child(2){min-width:0}
