/* L’atelier H2RM — styles de l’application de coloriage.
   Tous les sélecteurs sont préfixés « .at- » ou placés sous #atelier : rien ne déborde sur style.css.
   Sommaire : jetons · navigation (page atelier) · structure · en-tête · boutons · outils · scène ·
   palette · fenêtres · galerie · comparer · exporter · progression · données · aide ·
   tablette · téléphone · paysage · grands écrans · impression. */

/* ============================================================ Jetons */
.at-page{
  --at-ink:#1d1d1f;
  --at-muted:#636366;            /* texte secondaire, ≥ 4,5:1 sur blanc, #f5f5f7 et #e8e8ed */
  --at-line:#dedee3;
  --at-soft:#e8e8ed;
  --at-paper:#f5f5f7;
  --at-white:#fff;
  --at-blue:#0071e3;
  --at-blue-hover:#0066cc;
  --at-danger:#c5221f;
  --at-gold:#a8700a;             /* étoiles : forme pleine + texte, jamais la couleur seule */
  --at-r:20px;
  --at-nav-h:72px;               /* mis à jour par le script (hauteur réelle de la barre) */
  --at-ease:cubic-bezier(.3,.1,.2,1);
  --at-float-bg:rgba(255,255,255,.88);
  --at-float-ring:0 0 0 1px rgba(0,0,0,.06),0 2px 12px rgba(0,0,0,.06);
  background:var(--at-paper);
}
.at-sprite{position:absolute;width:0;height:0;overflow:hidden}
.at-sr{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* ============================================================ Navigation (page atelier) */
/* Sur téléphone, style.css range la barre sur deux lignes (112 px) : ici on garde une seule ligne
   pour laisser la place au dessin. Bloc isolé, facile à retirer lors de l’harmonisation. */
@media (max-width:759px){
  .at-page #navbar .nav-container{display:flex;height:56px;min-height:0;padding-block:0;gap:10px}
  .at-page #navbar .nav-actions{display:flex;align-items:center;gap:6px;margin-left:auto}
  .at-page #navbar .nav-service{min-height:34px;padding:0 12px;font-size:11px;white-space:nowrap}
  .at-page #navbar .nav-cta{min-height:34px;padding:0 14px}
}
@media (max-width:359px){
  .at-page #navbar .nav-container{gap:6px}
  .at-page #navbar .nav-service{padding:0 9px;font-size:10px}
  .at-page #navbar .nav-cta{padding:0 11px}
  .at-page #navbar .nav-cta span{margin-left:5px}
}

/* ============================================================ Structure */
.at-app{
  position:relative;display:flex;flex-direction:column;gap:12px;
  height:calc(100vh - var(--at-nav-h));height:calc(100dvh - var(--at-nav-h));
  min-height:430px;max-width:1720px;margin:0 auto;padding:14px 24px 18px;
}
.at-app:focus{outline:none}
.at-work{
  flex:1;min-height:0;display:grid;gap:14px;
  grid-template-columns:136px minmax(0,1fr) 344px;
  grid-template-areas:"tools stage pal";
}
.at-noscript{max-width:560px;margin:60px auto;text-align:center}
.at-noscript h1{font-size:28px;letter-spacing:-.03em;line-height:1.2}
.at-noscript p{margin-top:12px;color:var(--at-muted);line-height:1.6}
.at-noscript a{color:var(--at-blue);text-decoration:underline}

/* ============================================================ En-tête */
.at-head{display:flex;align-items:center;gap:12px;min-height:48px;flex:none}
.at-titleblock{flex:0 1 auto;min-width:0}
.at-eyebrow{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--at-muted);line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.at-title{font-size:clamp(20px,1.9vw,28px);font-weight:600;letter-spacing:-.025em;line-height:1.18;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}
.at-stepper{display:flex;gap:6px;flex:none}
.at-head-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}

/* ============================================================ Boutons */
.at-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 16px;border-radius:999px;border:1px solid var(--at-line);background:var(--at-white);color:var(--at-ink);font-size:13px;font-weight:500;line-height:1;white-space:nowrap;transition:background-color .2s var(--at-ease),border-color .2s var(--at-ease),color .2s var(--at-ease),opacity .2s}
.at-btn svg{width:18px;height:18px}
.at-btn-icon{width:38px;padding:0}
.at-btn-solid{background:var(--at-ink);border-color:var(--at-ink);color:#fff}
.at-btn-primary{background:var(--at-blue);border-color:var(--at-blue);color:#fff}
.at-btn-danger{background:var(--at-danger);border-color:var(--at-danger);color:#fff}
.at-btn:disabled{opacity:.45}
@media (hover:hover){
  .at-btn:hover:not(:disabled){background:#f0f0f3}
  .at-btn-solid:hover:not(:disabled){background:#3a3a3d;border-color:#3a3a3d}
  .at-btn-primary:hover:not(:disabled){background:var(--at-blue-hover);border-color:var(--at-blue-hover)}
  .at-btn-danger:hover:not(:disabled){background:#a51d1a;border-color:#a51d1a}
}
.at-page .at-btn:focus-visible,.at-page .at-chip:focus-visible,.at-page .at-tool:focus-visible{outline:3px solid var(--at-blue);outline-offset:3px}

/* Contrôle segmenté (Libre / Défi, onglets) */
.at-seg{display:inline-flex;padding:3px;gap:2px;border-radius:999px;background:var(--at-soft);flex:none}
.at-seg button{height:32px;padding:0 16px;border-radius:999px;font-size:13px;font-weight:500;color:#4a4a4f;transition:background-color .2s var(--at-ease),color .2s var(--at-ease),box-shadow .2s var(--at-ease)}
.at-seg button[aria-pressed=true]{background:#fff;color:var(--at-ink);box-shadow:0 1px 2px rgba(0,0,0,.1),0 2px 8px rgba(0,0,0,.05)}
.at-seg button:focus-visible{outline:3px solid var(--at-blue);outline-offset:1px}
.at-seg-wide{display:flex;width:100%}
.at-seg-wide button{flex:1}

/* ============================================================ Outils */
.at-tools{grid-area:tools;display:flex;flex-direction:column;gap:12px;min-height:0;overflow-y:auto;padding:10px;border-radius:var(--at-r);background:var(--at-white);scrollbar-width:thin}
.at-toolgroup,.at-history{display:flex;flex-direction:column;gap:4px}
.at-history{margin-top:auto;padding-top:10px;border-top:1px solid var(--at-soft)}
.at-tool{display:flex;align-items:center;gap:10px;width:100%;min-height:42px;padding:0 12px;border-radius:12px;font-size:13px;font-weight:500;text-align:left;color:var(--at-ink);transition:background-color .2s var(--at-ease),color .2s var(--at-ease)}
.at-tool svg{width:20px;height:20px}
.at-tool[aria-pressed=true]{background:var(--at-ink);color:#fff}
.at-tool:disabled{color:#a1a1a6}
@media (hover:hover){.at-tool:hover:not(:disabled):not([aria-pressed=true]){background:var(--at-paper)}}
/* Défi : seuls Remplir et Déplacer restent ; Indice apparaît */
.at-app[data-mode=libre] .at-hint-btn{display:none}
.at-app[data-mode=defi] .at-tool[data-tool=brush],.at-app[data-mode=defi] .at-tool[data-tool=eraser],.at-app[data-mode=defi] .at-tool[data-tool=picker]{display:none}
.at-hint-btn{color:var(--at-ink)}
.at-hint-btn.is-on{background:#fff4d6}

/* Réglages du pinceau */
.at-brushopts{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:14px;background:var(--at-paper)}
.at-app:not([data-tool=brush]) .at-brushopts,.at-app[data-mode=defi] .at-brushopts{display:none}
.at-mini-title{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--at-muted)}
.at-sizes{display:flex;gap:4px}
.at-size{flex:1;display:grid;place-items:center;height:36px;min-width:36px;border-radius:10px;color:var(--at-ink);transition:background-color .2s,box-shadow .2s}
.at-size i{display:block;width:var(--d);height:var(--d);border-radius:50%;background:currentColor}
.at-size[aria-pressed=true]{background:#fff;box-shadow:inset 0 0 0 1.5px var(--at-ink)}
.at-size:focus-visible,.at-clip:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
/* Interrupteur « Rester dans la zone » : texte au-dessus, interrupteur dessous (colonne étroite) */
.at-clip{position:relative;display:block;width:100%;padding:4px 6px 34px;border-radius:10px;font-size:12px;font-weight:500;line-height:1.3;text-align:left;color:var(--at-ink)}
.at-clip svg{display:none}
.at-clip::before{content:"";position:absolute;left:6px;bottom:6px;width:32px;height:20px;border-radius:10px;background:#c7c7cc;transition:background-color .2s var(--at-ease)}
.at-clip::after{content:"";position:absolute;left:8px;bottom:8px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .2s var(--at-ease)}
.at-clip[aria-pressed=true]::before{background:var(--at-blue)}
.at-clip[aria-pressed=true]::after{transform:translateX(12px)}

/* ============================================================ Scène */
.at-stage-wrap{grid-area:stage;position:relative;min-width:0;min-height:0;border-radius:var(--at-r);background:#ebebef;overflow:hidden;isolation:isolate}
.at-stage{position:absolute;inset:0;overflow:hidden;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;outline:none}
.at-stage:focus-visible{box-shadow:inset 0 0 0 3px var(--at-blue);border-radius:var(--at-r)}
.at-canvas{position:absolute;left:0;top:0;transform-origin:0 0;background:#fff;border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.05),0 14px 40px rgba(0,0,0,.07)}
.at-canvas.at-moving{will-change:transform}
.at-canvas.at-anim{transition:transform .26s var(--at-ease)}
.at-svg{position:absolute;inset:0;display:block;width:100%;height:100%;border-radius:inherit}
.at-svg #zones path{transition:fill .18s ease}
.at-example-img{position:absolute;inset:0;width:100%;height:100%;border-radius:inherit;opacity:0;pointer-events:none;transition:opacity .2s var(--at-ease)}
.at-app.is-example .at-example-img{opacity:1}
/* Curseurs selon l’outil (pointeurs précis uniquement) */
.at-app[data-tool=fill] .at-stage{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='%23fff' stroke-width='4' d='m18.5 11.2-7.7-7.7-7.4 7.4a1.9 1.9 0 0 0 0 2.7l5 5a1.9 1.9 0 0 0 2.7 0ZM3 12h15.2M20.4 15.2s1.8 2.1 1.8 3.4a1.8 1.8 0 0 1-3.6 0c0-1.3 1.8-3.4 1.8-3.4Z'/%3E%3Cpath stroke='%231d1d1f' stroke-width='1.7' d='m18.5 11.2-7.7-7.7-7.4 7.4a1.9 1.9 0 0 0 0 2.7l5 5a1.9 1.9 0 0 0 2.7 0ZM3 12h15.2M20.4 15.2s1.8 2.1 1.8 3.4a1.8 1.8 0 0 1-3.6 0c0-1.3 1.8-3.4 1.8-3.4Z'/%3E%3C/g%3E%3C/svg%3E") 21 21,pointer}
.at-app[data-tool=picker] .at-stage{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='%23fff' stroke-width='4' d='M15.4 4.3a2.4 2.4 0 0 1 3.4 0l.9.9a2.4 2.4 0 0 1 0 3.4l-1.7 1.7-4.3-4.3ZM12.6 8.6l-8.1 8.1-.9 3.7 3.7-.9 8.1-8.1'/%3E%3Cpath stroke='%231d1d1f' stroke-width='1.7' d='M15.4 4.3a2.4 2.4 0 0 1 3.4 0l.9.9a2.4 2.4 0 0 1 0 3.4l-1.7 1.7-4.3-4.3ZM12.6 8.6l-8.1 8.1-.9 3.7 3.7-.9 8.1-8.1'/%3E%3C/g%3E%3C/svg%3E") 3 21,crosshair}
.at-app[data-tool=brush] .at-stage,.at-app[data-tool=eraser] .at-stage{cursor:crosshair}
.at-app.has-cursor[data-tool=brush] .at-stage,.at-app.has-cursor[data-tool=eraser] .at-stage{cursor:none}
.at-app[data-tool=hand] .at-stage,.at-app.is-space .at-stage{cursor:grab}
.at-app.is-panning .at-stage{cursor:grabbing}

/* Calques ajoutés dans le SVG */
.at-svg .at-lbl{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:600;fill:#5d5d62;text-anchor:middle;dominant-baseline:central}
.at-svg .at-dot{fill:#8e8e93}
.at-svg .at-hint{fill:#0071e3;fill-opacity:.3;stroke:#0071e3;stroke-linejoin:round;animation:at-hint 1.6s ease-in-out both}
.at-svg .at-shake{fill:none;stroke:#d9382c;stroke-linejoin:round;transform-box:fill-box;transform-origin:center;animation:at-shake .42s ease-in-out both}
.at-svg .at-ring{fill:none;stroke-linejoin:round;pointer-events:none}
@keyframes at-hint{0%{fill-opacity:0;stroke-opacity:0}15%{fill-opacity:.38;stroke-opacity:1}50%{fill-opacity:.14}80%{fill-opacity:.38;stroke-opacity:1}100%{fill-opacity:0;stroke-opacity:0}}
@keyframes at-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-1.6%)}40%{transform:translateX(1.4%)}60%{transform:translateX(-.9%)}80%{transform:translateX(.5%)}}
@media (prefers-reduced-motion:reduce){.at-svg .at-hint{animation:none;fill-opacity:.3}.at-svg .at-shake{animation:none}}

/* Interface flottante sur la scène */
.at-stage-ui{position:absolute;inset:0;z-index:2;pointer-events:none}
.at-stage-ui>*{pointer-events:auto}
.at-float{position:absolute;display:flex;align-items:center;gap:6px;min-height:36px;padding:0 13px;border-radius:999px;background:var(--at-float-bg);-webkit-backdrop-filter:saturate(180%) blur(18px);backdrop-filter:saturate(180%) blur(18px);box-shadow:var(--at-float-ring);font-size:12px;font-weight:500;color:var(--at-ink);transition:background-color .2s var(--at-ease),color .2s var(--at-ease),opacity .2s}
.at-float svg{width:18px;height:18px}
.at-example-btn{top:12px;right:12px}
.at-example-btn[aria-pressed=true]{background:var(--at-ink);color:#fff}
.at-example-btn:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
.at-progress{top:12px;left:12px;pointer-events:none;font-variant-numeric:tabular-nums}
.at-progress strong{font-weight:600}
.at-progress-unit{margin-left:.25em}
.at-zoom{bottom:12px;right:12px;padding:0 3px;gap:0}
.at-zoom button{display:grid;place-items:center;width:34px;height:34px;border-radius:999px;color:var(--at-ink)}
.at-zoom button:disabled{opacity:.35}
.at-zoom button:focus-visible{outline:3px solid var(--at-blue);outline-offset:0}
.at-zoom #at-zoom-fit{display:flex;gap:6px;width:auto;padding:0 11px 0 9px;font-size:12px;font-weight:500}
@media (hover:hover){.at-zoom button:hover:not(:disabled),.at-example-btn:hover:not([aria-pressed=true]){background:rgba(0,0,0,.06)}}
.at-zoom-val{min-width:44px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px;color:var(--at-muted)}
.at-save{display:flex;align-items:center;gap:6px;font-size:12px;line-height:1.3;color:var(--at-muted)}
.at-save svg{width:14px;height:14px;flex:none;color:#248a3d}
.at-save[data-state=pending] svg{color:var(--at-muted);opacity:.5}
.at-save[data-state=off] svg,.at-save[data-state=error] svg{color:var(--at-danger)}
.at-save[data-state=error]{color:var(--at-danger)}
.at-save-stage{position:absolute;left:14px;bottom:12px;min-height:36px;max-width:calc(50% - 30px);padding:0 4px;border-radius:999px;pointer-events:none;transition:background-color .2s,box-shadow .2s,padding .2s}
.at-app.is-zoomed .at-save-stage{padding:0 12px;background:var(--at-float-bg);-webkit-backdrop-filter:saturate(180%) blur(18px);backdrop-filter:saturate(180%) blur(18px);box-shadow:var(--at-float-ring)}
.at-save-pal,.at-save-menu{display:none}
.at-cursor{position:absolute;left:0;top:0;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;box-shadow:0 0 0 1px rgba(255,255,255,.9),inset 0 0 0 1.5px rgba(29,29,31,.85);pointer-events:none!important;opacity:0;transition:opacity .12s}
.at-cursor.is-on{opacity:1}
.at-stage-msg{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;text-align:center;background:rgba(235,235,239,.82);font-size:15px;color:var(--at-ink)}
.at-stage-msg p{max-width:340px;line-height:1.5}
.at-toast{position:absolute;left:50%;bottom:66px;transform:translate(-50%,8px);max-width:min(460px,calc(100% - 32px));width:max-content;padding:11px 16px;border-radius:14px;background:rgba(29,29,31,.92);color:#fff;font-size:13px;line-height:1.45;text-align:center;opacity:0;pointer-events:none!important;transition:opacity .2s var(--at-ease),transform .2s var(--at-ease)}
.at-toast.is-on{opacity:1;transform:translate(-50%,0)}
.at-toast:empty{padding:0}
.at-app.is-loading .at-canvas{opacity:.55;transition:opacity .2s}

/* ============================================================ Palette */
.at-palette{grid-area:pal;display:flex;flex-direction:column;gap:14px;min-height:0;overflow-y:auto;padding:18px 18px 16px;border-radius:var(--at-r);background:var(--at-white);scrollbar-width:thin}
.at-current{display:flex;align-items:center;gap:12px;flex:none}
.at-current-chip{width:36px;height:36px;flex:none;border-radius:50%;background:var(--c,#fff);box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);transition:background-color .2s var(--at-ease)}
.at-current-text{flex:1;min-width:0;line-height:1.25}
.at-current-label{display:block;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--at-muted)}
.at-current-text strong{font-size:17px;font-weight:600;letter-spacing:-.015em}
.at-current-extra{display:block;font-size:12px;color:var(--at-muted)}
.at-current-extra:empty{display:none}
.at-fav-btn{display:grid;place-items:center;width:38px;height:38px;flex:none;border-radius:50%;border:1px solid var(--at-line);color:var(--at-muted);transition:color .2s,border-color .2s,background-color .2s}
.at-fav-btn svg{width:19px;height:19px;grid-area:1/1}
.at-fav-btn .at-fav-on{display:none}
.at-fav-btn[aria-pressed=true]{color:var(--at-gold);border-color:#e9cf8e;background:#fff8e6}
.at-fav-btn[aria-pressed=true] .at-fav-on{display:block}
.at-fav-btn[aria-pressed=true] .at-fav-off{display:none}
.at-fav-btn:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
.at-app[data-mode=defi] .at-fav-btn{display:none}
.at-pal-tabs{display:none}
.at-pal-groups{display:flex;flex-direction:column;gap:12px}
.at-pal-group{min-width:0}
.at-pal-gtitle{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;font-size:11px;font-weight:600;letter-spacing:.02em;line-height:1.3;color:var(--at-muted)}
.at-pal-empty{font-size:12px;line-height:1.45;color:var(--at-muted);padding:2px 0}
.at-swatches>.at-pal-empty{grid-column:1/-1}
.at-swatches{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:7px}
.at-sw{position:relative;display:block;width:100%;aspect-ratio:1;border-radius:50%;background:var(--c);box-shadow:inset 0 0 0 1px rgba(0,0,0,.09);transition:transform .15s var(--at-ease),box-shadow .15s var(--at-ease)}
.at-sw svg{position:absolute;left:50%;top:50%;width:54%;height:54%;transform:translate(-50%,-50%);color:#fff;opacity:0;transition:opacity .15s}
.at-sw.is-light svg{color:var(--at-ink)}
.at-sw[aria-pressed=true]{box-shadow:inset 0 0 0 1px rgba(0,0,0,.12),0 0 0 2px #fff,0 0 0 4px var(--at-ink)}
.at-sw[aria-pressed=true] svg{opacity:1}
.at-page .at-sw:focus-visible{outline:3px solid var(--at-blue);outline-offset:4px}
@media (hover:hover){.at-sw:hover{transform:scale(1.09)}}
/* Pastilles numérotées du Défi */
.at-sw-num{display:grid;place-items:center}
.at-sw-n{font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;color:#fff;text-shadow:0 0 2px rgba(0,0,0,.25)}
.at-sw-num.is-light .at-sw-n{color:var(--at-ink);text-shadow:none}
.at-sw-num svg{opacity:0}
.at-sw-num.is-done .at-sw-n{display:none}
.at-sw-num.is-done svg{opacity:1}
.at-sw-num.is-done{opacity:.6}
.at-sw-num[aria-pressed=true]{opacity:1}
.at-sw-num[aria-pressed=true]:not(.is-done) svg{opacity:0}
.at-sw-num[aria-pressed=true]::after{content:"";position:absolute;right:-5px;top:-5px;width:16px;height:16px;border-radius:50%;background:var(--at-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5.5 12.5 4.2 4.2L18.5 8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat;box-shadow:0 0 0 2px #fff}
.at-pal-group[data-group=defi] .at-swatches{gap:10px}
.at-pal-note{display:flex;gap:8px;margin-top:auto;padding-top:12px;border-top:1px solid var(--at-soft);font-size:12px;line-height:1.45;color:var(--at-muted);flex:none}
.at-pal-note svg{width:16px;height:16px;flex:none;margin-top:1px}
.at-app[data-mode=defi] .at-pal-group:not([data-group=defi]),.at-app[data-mode=libre] .at-pal-group[data-group=defi]{display:none!important}
.at-app[data-mode=defi] .at-pal-tabs{display:none!important}
/* Écrans peu hauts : titres de familles masqués visuellement (restent lus) */
@media (min-width:960px) and (max-height:900px){
  .at-pal-group[data-family] .at-pal-gtitle{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-pal-groups{gap:8px}
  .at-pal-group[data-group=favs]{margin-bottom:6px}
  .at-palette{gap:12px;padding-top:16px}
}

/* ============================================================ Fenêtres */
.at-dialog{margin:auto;padding:0;border:0;border-radius:24px;background:#fff;color:var(--at-ink);max-width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:hidden;box-shadow:0 30px 90px rgba(0,0,0,.2)}
.at-dialog::backdrop{background:rgba(29,29,31,.34);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.at-dialog[open]{animation:at-pop .22s var(--at-ease)}
@keyframes at-pop{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.at-dlg{display:flex;flex-direction:column;max-height:inherit;overflow:auto;padding:24px}
.at-dlg-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px;flex:none}
.at-dlg-head .at-eyebrow{margin-bottom:4px}
.at-dlg-title{font-size:24px;font-weight:600;letter-spacing:-.025em;line-height:1.2;text-wrap:balance}
.at-dlg-title:focus{outline:none}
.at-close{display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:50%;background:#ececf0;color:var(--at-ink);transition:background-color .2s}
.at-close svg{width:18px;height:18px}
@media (hover:hover){.at-close:hover{background:#dcdce1}}
.at-page .at-close:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
.at-dlg-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:22px}
.at-confirm-text{margin-top:10px;font-size:15px;line-height:1.55;color:var(--at-muted)}
.at-dlg-confirm{width:min(440px,calc(100% - 32px))}

/* Menu */
.at-dlg-menu{width:320px;margin:calc(var(--at-nav-h) + 66px) 24px auto auto}
.at-dlg-menu .at-dlg{padding:18px}
.at-dlg-menu .at-dlg-head{margin-bottom:8px;align-items:center}
.at-dlg-menu .at-dlg-title{font-size:17px}
.at-menu-body{display:flex;flex-direction:column;gap:2px}
.at-menu-mobile{display:none;flex-direction:column;gap:2px;margin-bottom:6px;padding-bottom:8px;border-bottom:1px solid var(--at-soft)}
.at-menu-mobile .at-seg{margin-bottom:8px}
.at-menu-pair{display:flex;gap:2px}
.at-menu-pair .at-menu-item{flex:1}
.at-menu-pair .at-menu-item:last-child{justify-content:flex-end}
.at-menu-item{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:12px;font-size:15px;text-align:left;color:var(--at-ink);transition:background-color .2s}
.at-menu-item svg{width:20px;height:20px;color:var(--at-muted)}
@media (hover:hover){.at-menu-item:hover{background:var(--at-paper)}}
.at-page .at-menu-item:focus-visible{outline:3px solid var(--at-blue);outline-offset:-1px}
.at-menu-note{display:flex;gap:8px;margin-top:10px;padding:12px 4px 0;border-top:1px solid var(--at-soft);font-size:12px;line-height:1.45;color:var(--at-muted)}
.at-menu-note svg{width:16px;height:16px;flex:none;margin-top:1px}
.at-save-menu{padding:8px 4px 0}

/* ============================================================ Galerie */
.at-dlg-gallery{width:min(1140px,calc(100% - 48px));height:min(900px,calc(100dvh - 48px))}
.at-dlg-gallery .at-dlg{height:100%;padding:26px 30px 0;overflow:hidden}
.at-gal-controls{display:flex;flex-direction:column;gap:12px;flex:none;padding-bottom:16px;border-bottom:1px solid var(--at-soft)}
.at-search{position:relative}
.at-search svg{position:absolute;left:15px;top:50%;width:18px;height:18px;margin-top:-9px;color:var(--at-muted);pointer-events:none}
.at-search input{width:100%;height:46px;padding:0 16px 0 44px;border:1px solid var(--at-line);border-radius:14px;background:var(--at-paper);font:inherit;font-size:16px;color:var(--at-ink);transition:background-color .2s,border-color .2s}
.at-search input::placeholder{color:#7c7c80}
.at-search input:focus{background:#fff;border-color:#c7c7cc}
.at-search input:focus-visible{outline:3px solid var(--at-blue);outline-offset:1px}
.at-chips{display:flex;flex-wrap:wrap;gap:8px}
.at-chip{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;flex:none;border:1px solid var(--at-line);border-radius:999px;background:#fff;font-size:13px;font-weight:500;white-space:nowrap;color:var(--at-ink);transition:background-color .2s,border-color .2s,color .2s}
.at-chip svg{width:16px;height:16px}
.at-chip small{font-size:11px;font-weight:500;color:var(--at-muted);font-variant-numeric:tabular-nums}
.at-chip[aria-pressed=true]{background:var(--at-ink);border-color:var(--at-ink);color:#fff}
.at-chip[aria-pressed=true] small{color:#d2d2d7}
@media (hover:hover){.at-chip:hover:not([aria-pressed=true]){background:var(--at-paper)}}
.at-gal-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.at-select select{height:34px;padding:0 34px 0 14px;border:1px solid var(--at-line);border-radius:999px;-webkit-appearance:none;appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center/13px;font:inherit;font-size:13px;font-weight:500;color:var(--at-ink);cursor:pointer}
.at-select select:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
.at-gal-count{margin-left:auto;font-size:13px;color:var(--at-muted);font-variant-numeric:tabular-nums}
.at-gal-body{flex:1;min-height:0;overflow-y:auto;margin:0 -30px;padding:18px 30px 30px;overscroll-behavior:contain}
.at-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(188px,1fr));gap:14px;list-style:none}
.at-card{display:flex;flex-direction:column;gap:10px;height:100%;padding:8px 8px 12px;border-radius:20px;transition:background-color .2s var(--at-ease)}
.at-page .at-card:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
@media (hover:hover){.at-card:hover{background:var(--at-paper)}.at-card:hover .at-card-thumb img{transform:scale(1.035)}}
.at-card[aria-current=true]{background:var(--at-paper)}
.at-card-thumb{position:relative;display:block;aspect-ratio:1;overflow:hidden;border-radius:14px;background:var(--at-paper);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}
.at-card-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s var(--at-ease)}
.at-card-tag{position:absolute;left:8px;top:8px;padding:4px 9px;border-radius:999px;background:var(--at-ink);color:#fff;font-size:11px;font-weight:600;line-height:1.3}
.at-card-body{display:flex;flex-direction:column;gap:3px;padding:0 4px}
.at-card-title{font-size:15px;font-weight:600;letter-spacing:-.012em;line-height:1.3}
.at-card-meta{font-size:12px;line-height:1.4;color:var(--at-muted)}
.at-card-state{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;min-height:18px;margin-top:2px;font-size:12px;line-height:1.4}
.at-card-progress{color:#0058b0;font-weight:500}
.at-stars{display:inline-flex;align-items:center;gap:1px;color:var(--at-gold)}
.at-stars svg{width:14px;height:14px}
.at-stars .is-empty{color:#c7c7cc}
.at-gal-empty{display:flex;flex-direction:column;align-items:center;gap:16px;padding:60px 20px;text-align:center;color:var(--at-muted);font-size:15px}

/* ============================================================ Comparer */
.at-dlg-compare{width:min(1180px,calc(100% - 48px))}
.at-compare-tabs{display:none;margin-bottom:14px}
.at-compare-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.at-fig{min-width:0}
.at-fig-img{aspect-ratio:1;overflow:hidden;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--at-line)}
.at-fig img{display:block;width:100%;height:100%;object-fit:contain}
.at-fig figcaption{margin-top:10px;font-size:13px;font-weight:600;text-align:center}

/* ============================================================ Exporter */
.at-dlg-export{width:min(620px,calc(100% - 32px))}
.at-export-body{display:flex;flex-direction:column;gap:22px}
.at-ex-sec h3{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;line-height:1.3;color:var(--at-muted);margin-bottom:10px}
.at-ex-help{margin:-4px 0 10px;font-size:13px;color:var(--at-muted)}
.at-ex-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.at-ex-card{display:flex;align-items:center;gap:12px;min-height:64px;padding:12px 14px;border:1px solid var(--at-line);border-radius:16px;text-align:left;transition:background-color .2s,border-color .2s}
.at-ex-card svg{width:24px;height:24px;flex:none;color:var(--at-blue)}
.at-ex-card strong{display:block;font-size:14px;font-weight:600;line-height:1.3}
.at-ex-card small{display:block;margin-top:2px;font-size:12px;color:var(--at-muted)}
.at-ex-card:disabled{opacity:.5}
@media (hover:hover){.at-ex-card:hover:not(:disabled){background:var(--at-paper)}}
.at-page .at-ex-card:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}
.at-print-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.at-radios{display:inline-flex;padding:3px;gap:2px;border:0;border-radius:999px;background:var(--at-soft)}
.at-radios label{position:relative;cursor:pointer}
.at-radios input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.at-radios span{display:block;height:32px;padding:0 15px;border-radius:999px;font-size:13px;font-weight:500;line-height:32px;color:#4a4a4f;transition:background-color .2s,color .2s}
.at-radios input:checked+span{background:#fff;color:var(--at-ink);box-shadow:0 1px 2px rgba(0,0,0,.1),0 2px 8px rgba(0,0,0,.05)}
.at-radios input:focus-visible+span{outline:3px solid var(--at-blue);outline-offset:1px}
.at-ex-links{display:flex;flex-wrap:wrap;gap:8px}
.at-dl{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 14px;border:1px solid var(--at-line);border-radius:999px;font-size:13px;font-weight:500;transition:background-color .2s,border-color .2s}
.at-dl svg{width:16px;height:16px;color:var(--at-blue)}
.at-dl small{font-size:12px;font-weight:400;color:var(--at-muted)}
@media (hover:hover){.at-dl:hover{background:var(--at-paper)}}
.at-page .at-dl:focus-visible{outline:3px solid var(--at-blue);outline-offset:2px}

/* ============================================================ Défi réussi */
.at-dlg-success{width:min(430px,calc(100% - 32px));text-align:center}
.at-dlg-success .at-dlg{position:relative;align-items:center;padding:34px 28px 26px}
.at-dlg-success .at-dlg-actions{justify-content:center}
.at-close-corner{position:absolute;top:14px;right:14px}
.at-stars-big{display:flex;gap:6px;margin-bottom:14px;color:var(--at-gold)}
.at-stars-big svg{width:40px;height:40px}
.at-stars-big .is-empty{color:#d1d1d6}
.at-stars-big svg:not(.is-empty){animation:at-star .5s var(--at-ease) both}
.at-stars-big svg:nth-child(2){animation-delay:.08s}
.at-stars-big svg:nth-child(3){animation-delay:.16s}
@keyframes at-star{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}

/* ============================================================ Progression */
.at-dlg-progress{width:min(560px,calc(100% - 32px))}
.at-prog-total{display:flex;align-items:center;gap:16px;padding:16px 18px;border-radius:16px;background:var(--at-paper);margin-bottom:16px}
.at-prog-total svg{width:34px;height:34px;color:var(--at-gold);flex:none}
.at-prog-total strong{display:block;font-size:26px;font-weight:600;letter-spacing:-.02em;line-height:1.1;font-variant-numeric:tabular-nums}
.at-prog-total span{font-size:13px;color:var(--at-muted)}
.at-prog-list{list-style:none;display:flex;flex-direction:column}
.at-prog-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 14px;padding:12px 2px;border-bottom:1px solid var(--at-soft)}
.at-prog-item:last-child{border-bottom:0}
.at-prog-name{font-size:14px;font-weight:500}
.at-prog-count{font-size:13px;color:var(--at-muted);font-variant-numeric:tabular-nums}
.at-prog-bar{grid-column:1/-1;height:5px;border-radius:3px;background:var(--at-soft);overflow:hidden}
.at-prog-bar i{display:block;height:100%;border-radius:3px;background:var(--at-ink);transition:width .3s var(--at-ease)}
.at-badge{display:inline-flex;align-items:center;gap:5px;margin-left:8px;padding:2px 9px 2px 6px;border-radius:999px;background:#fff4d6;color:#7a5200;font-size:11px;font-weight:600;vertical-align:1px}
.at-badge svg{width:14px;height:14px}

/* ============================================================ Mes données */
.at-dlg-data{width:min(480px,calc(100% - 32px))}
.at-data-intro,.at-data-tip{font-size:14px;line-height:1.55;color:var(--at-muted)}
.at-data-tip{margin-top:14px}
.at-data-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}
.at-data-stats div{padding:12px 14px;border-radius:14px;background:var(--at-paper)}
.at-data-stats dt{font-size:12px;color:var(--at-muted);line-height:1.3}
.at-data-stats dd{margin-top:4px;font-size:20px;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.at-data-status{margin-top:12px;font-size:13px;color:var(--at-danger)}
.at-data-status:empty{display:none}

/* ============================================================ Aide */
.at-dlg-help{width:min(640px,calc(100% - 32px))}
.at-help-body{display:flex;flex-direction:column;gap:22px}
.at-help-body h3{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;line-height:1.3;color:var(--at-muted);margin-bottom:10px}
.at-help-body p{font-size:14px;line-height:1.6;color:#3a3a3d}
.at-help-list{list-style:none;display:flex;flex-direction:column;gap:10px}
.at-help-list li{display:flex;gap:12px;font-size:14px;line-height:1.5;color:#3a3a3d}
.at-help-list svg{width:20px;height:20px;flex:none;margin-top:1px;color:var(--at-ink)}
.at-keys{display:flex;flex-direction:column}
.at-keys div{display:grid;grid-template-columns:minmax(0,15em) minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--at-soft);font-size:13px;line-height:1.5}
.at-keys dd{color:#3a3a3d}
.at-keys kbd{display:inline-block;min-width:22px;padding:1px 6px;border:1px solid var(--at-line);border-bottom-width:2px;border-radius:6px;background:#fff;font:inherit;font-size:12px;text-align:center}

/* ============================================================ Tablette (700 – 959 px) */
@media (max-width:959px){
  .at-app{padding:12px 18px 14px;gap:10px}
  .at-work{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:"stage stage" "tools hist" "pal pal";gap:10px}
  .at-tools{display:contents}
  .at-toolgroup,.at-history{flex-direction:row;gap:4px;padding:5px;border-radius:18px;background:var(--at-white)}
  .at-toolgroup{grid-area:tools}
  .at-history{grid-area:hist;margin:0;border:0}
  .at-tool{flex:1;flex-direction:column;justify-content:center;gap:3px;min-height:50px;padding:4px 8px;font-size:11px;text-align:center}
  .at-history .at-tool{flex:none;width:76px}
  .at-brushopts{grid-area:stage;align-self:end;justify-self:center;z-index:3;flex-direction:row;align-items:center;gap:6px;margin-bottom:12px;padding:4px;border-radius:999px;background:var(--at-float-bg);-webkit-backdrop-filter:saturate(180%) blur(18px);backdrop-filter:saturate(180%) blur(18px);box-shadow:var(--at-float-ring)}
  .at-brushopts .at-mini-title{display:none}
  .at-size{border-radius:999px;height:34px;min-width:38px}
  .at-clip{display:flex;align-items:center;gap:7px;width:auto;border-radius:999px;min-height:34px;padding:2px 46px 2px 9px;white-space:nowrap}
  .at-clip svg{display:block;width:18px;height:18px;flex:none}
  .at-clip::before{left:auto;right:6px;bottom:auto;top:50%;margin-top:-10px}
  .at-clip::after{left:auto;right:20px;bottom:auto;top:50%;margin-top:-8px}
  .at-app[data-tool=brush]:not([data-mode=defi]) .at-zoom{bottom:62px}
  .at-palette{padding:10px 14px 12px;gap:10px;border-radius:18px;overflow:visible}
  .at-current{gap:10px}
  .at-current-chip{width:28px;height:28px}
  .at-current-label{display:none}
  .at-current-text strong{font-size:15px}
  .at-current-text{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;flex:0 1 auto}
  .at-current-extra{display:inline}
  .at-fav-btn{width:34px;height:34px}
  .at-pal-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:3px;margin:-3px}
  .at-pal-tabs::-webkit-scrollbar{display:none}
  .at-tab{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--tab);box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);color:var(--at-ink);transition:box-shadow .15s}
  .at-tab svg{width:17px;height:17px}
  .at-tab.is-icon{background:var(--at-paper)}
  .at-tab[aria-pressed=true]{box-shadow:inset 0 0 0 1px rgba(0,0,0,.1),0 0 0 2px #fff,0 0 0 4px var(--at-ink)}
  .at-page .at-tab:focus-visible{outline:3px solid var(--at-blue);outline-offset:4px}
  .at-pal-groups{display:block}
  .at-pal-group{display:none}
  .at-pal-group.is-active,.at-app[data-mode=defi] .at-pal-group[data-group=defi]{display:block}
  .at-pal-gtitle{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-swatches{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:5px;margin:-5px}
  .at-swatches::-webkit-scrollbar{display:none}
  .at-sw{flex:0 0 calc((100% - 56px) / 8);max-width:48px}
  .at-pal-group[data-group=defi] .at-sw{flex-basis:40px}
  .at-pal-empty{min-height:34px;display:flex;align-items:center}
  .at-pal-note{margin-top:0;padding-top:8px;font-size:11px}
  .at-pal-note svg{width:14px;height:14px}
  .at-save-stage{display:none}
  .at-save-pal{display:flex;margin-left:auto}
  .at-head-opt .at-btn-text{display:none}
  .at-head-opt{width:38px;padding:0}
  .at-dlg-menu{margin-top:calc(var(--at-nav-h) + 60px)}
  .at-compare-grid{gap:12px}
}
@media (min-width:700px) and (max-width:959px){
  .at-sw{flex-basis:44px}
}

/* ============================================================ Téléphone (< 700 px) */
@media (max-width:699px){
  .at-app{padding:8px 10px 10px;gap:8px;min-height:400px}
  .at-head{gap:8px;min-height:40px}
  .at-gallery-btn{width:40px;height:40px;padding:0}
  .at-gallery-btn .at-btn-text,.at-stepper,.at-head-opt{display:none}
  .at-eyebrow{font-size:10px;letter-spacing:.08em}
  .at-title{font-size:17px}
  .at-titleblock{flex:1}
  .at-head-actions{gap:6px}
  .at-head .at-seg button{height:30px;padding:0 11px;font-size:12px}
  .at-head #at-menu-btn{width:40px;height:40px}
  .at-work{gap:8px}
  .at-toolgroup,.at-history{padding:3px;gap:2px;border-radius:16px}
  .at-tool{min-height:40px;min-width:38px;padding:0;border-radius:13px}
  .at-history .at-tool{width:40px}
  .at-tool-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-stage-wrap{border-radius:16px}
  .at-example-btn{top:8px;left:8px;right:auto;width:36px;padding:0;justify-content:center}
  .at-float-text{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-progress{top:8px;left:50%;transform:translateX(-50%);min-height:30px;padding:0 11px;white-space:nowrap}
  .at-progress-unit{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-zoom{top:8px;bottom:auto;right:8px;min-height:36px}
  .at-zoom button{width:32px;height:32px}
  .at-zoom-val{display:none}
  .at-zoom #at-zoom-fit{width:32px;padding:0;justify-content:center}
  .at-app[data-tool=brush]:not([data-mode=defi]) .at-zoom{bottom:auto}
  .at-brushopts{margin-bottom:8px;gap:2px}
  .at-size{min-width:34px;height:32px}
  .at-clip{font-size:11px;padding:2px 44px 2px 8px;min-height:32px}
  .at-toast{bottom:14px;font-size:13px}
  .at-app[data-tool=brush]:not([data-mode=defi]) .at-toast{bottom:58px}
  .at-palette{padding:8px 10px 10px;gap:8px;border-radius:16px}
  .at-current{gap:8px;min-height:30px}
  .at-current-chip{width:24px;height:24px}
  .at-current-text strong{font-size:14px}
  .at-current-extra{font-size:11px}
  .at-fav-btn{width:32px;height:32px}
  .at-fav-btn svg{width:17px;height:17px}
  .at-tab{width:32px;height:32px}
  .at-pal-tabs{gap:5px}
  .at-swatches{gap:7px}
  .at-sw{flex-basis:calc((100% - 49px) / 8)}
  .at-save-pal{font-size:11px}
  .at-menu-mobile{display:flex}
  /* Fenêtres en feuille pleine largeur */
  .at-dialog{max-width:100%;width:100%;margin:auto 0 0;border-radius:22px 22px 0 0;max-height:calc(100dvh - 24px)}
  .at-dialog[open]{animation-name:at-sheet}
  .at-dlg{padding:20px 18px calc(20px + env(safe-area-inset-bottom))}
  .at-dlg-title{font-size:21px}
  .at-dlg-gallery{height:100dvh;max-height:100dvh;border-radius:0}
  .at-dlg-gallery .at-dlg{padding:16px 16px 0}
  .at-dlg-gallery .at-dlg-head{margin-bottom:12px}
  .at-gal-controls{gap:10px;padding-bottom:12px}
  .at-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:2px 16px}
  .at-chips::-webkit-scrollbar{display:none}
  .at-gal-body{margin:0 -16px;padding:14px 12px 24px}
  .at-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .at-card{padding:6px 6px 10px;border-radius:16px}
  .at-card-title{font-size:14px}
  .at-compare-tabs{display:flex}
  .at-compare-grid{grid-template-columns:1fr}
  .at-compare-grid .at-fig{display:none}
  .at-compare-grid[data-show=blank] .at-fig[data-fig=blank],.at-compare-grid[data-show=example] .at-fig[data-fig=example],.at-compare-grid[data-show=mine] .at-fig[data-fig=mine]{display:block}
  .at-fig-img{max-width:min(100%,calc(100dvh - 260px));margin:0 auto}
  .at-ex-actions{grid-template-columns:1fr}
  .at-data-stats{grid-template-columns:1fr 1fr}
  .at-keys div{grid-template-columns:1fr;gap:2px}
  .at-dlg-menu{margin:auto 0 0}
}
@keyframes at-sheet{from{transform:translateY(24px);opacity:.4}to{transform:none;opacity:1}}
@media (max-width:699px) and (max-height:740px){
  .at-pal-note{display:none}
}
@media (max-width:359px){
  .at-head .at-seg{display:none}
  .at-tool{min-width:36px}
  .at-history .at-tool{width:37px}
  .at-sw{flex-basis:calc((100% - 42px) / 8)}
  .at-swatches{gap:6px}
  .at-save-pal span{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
}

/* ============================================================ Paysage peu haut (téléphones à l’horizontale) */
@media (max-width:959px) and (max-height:540px) and (orientation:landscape){
  .at-app{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,46%) auto;grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"stage head head" "stage tools hist" "stage pal pal";gap:8px 10px;padding:8px 12px 10px;min-height:300px}
  .at-head{grid-area:head;min-width:0}
  .at-work{display:contents}
  .at-gallery-btn .at-btn-text,.at-stepper,.at-head-opt{display:none}
  .at-gallery-btn{width:38px;padding:0}
  .at-titleblock{flex:1}
  .at-title{font-size:16px}
  .at-tool-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-tool{min-height:36px;padding:0}
  .at-history .at-tool{width:38px}
  .at-palette{overflow-y:auto}
  .at-pal-note{display:none}
  .at-menu-mobile{display:flex}
  .at-progress{left:50%;transform:translateX(-50%)}
  .at-float-text{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .at-example-btn{width:36px;padding:0;justify-content:center;left:8px;right:auto;top:8px}
  .at-zoom-val{display:none}
  .at-zoom #at-zoom-fit{width:32px;padding:0;justify-content:center}
}

/* ============================================================ Grands écrans */
@media (min-width:1500px){
  .at-work{grid-template-columns:152px minmax(0,1fr) 380px;gap:18px}
  .at-app{padding:18px 32px 22px}
  .at-tool{min-height:44px;font-size:14px}
}

/* Pied de page discret */
.at-footer{padding-bottom:20px}
.at-footer .footer-bottom{border-top:0;padding-top:14px;font-size:11px;align-items:center}
.at-footer .footer-bottom p{color:var(--at-muted)}

/* ============================================================ Impression */
.at-print{display:none}
@media print{
  @page{size:A4 portrait;margin:14mm}
  .at-page{background:#fff!important}
  .at-page>:not(.at-print){display:none!important}
  .at-page .at-print{display:block!important;color:#000;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif}
  .at-print-title{margin:4mm 0 1.5mm;font-size:20pt;font-weight:600;letter-spacing:-.01em;line-height:1.2}
  .at-print-sub{margin:0 0 9mm;font-size:10pt;color:#555}
  .at-print-img{display:block;width:180mm;height:180mm;margin:0 auto;object-fit:contain}
  .at-print-foot{margin-top:9mm;font-size:9pt;color:#666}
}

/* Lisibilité : textes secondaires à 12 px minimum */
.at-pal-note,.at-footer .footer-bottom,.at-pal-gtitle,.at-save-pal{font-size:12px}
