/* Filenexo Photo — habillage : barre de menus, barre d'options, boîte à outils,
   zone de travail sur damier, panneaux Propriétés / Calques / Historique. */
:root{--red:#e5322d;--ink:#161a22;--muted:#5c6577;--line:#e6e9ef;--rail:#0e1320;--rail2:#1a2133;--soft:#f4f6fa;--blue:#2f6fed;
  --font:"Inter",-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
[hidden]{display:none!important}
*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:var(--font);color:var(--ink);background:#eef1f6;overflow:hidden;font-size:13px}
button{font-family:inherit;cursor:pointer}input,select,textarea{font-family:inherit;font-size:.85rem}
.top{height:48px;display:flex;align-items:center;gap:6px;padding:0 10px;background:#fff;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:7px;font-weight:900;font-size:1rem;margin-right:6px;white-space:nowrap}
.brand .mark{display:grid;place-items:center;width:26px;height:26px;border-radius:7px;background:var(--red);color:#fff;font-size:1.1rem}
.brand .prod{font-weight:600;color:var(--muted)}
.menus{display:flex;gap:2px}
.menus .menu{position:relative}
.menus .menu>button{background:none;border:0;padding:6px 9px;border-radius:7px;font-weight:600;font-size:.85rem;color:var(--ink)}
.menus .menu>button:hover,.menus .menu.open>button{background:var(--soft)}
.menus .menu>button.ia{color:var(--red)}
.menus .liste{position:absolute;left:0;top:100%;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 40px rgba(22,26,34,.16);padding:6px;min-width:260px;z-index:60;display:none}
.menus .menu.open .liste{display:block}
.menus .liste button{display:flex;justify-content:space-between;gap:16px;width:100%;text-align:left;border:0;background:none;padding:7px 10px;border-radius:7px;font-size:.85rem}
.menus .liste button:hover{background:var(--soft)}.menus .liste button kbd{font-family:inherit;color:var(--muted);font-size:.75rem}
.menus .liste hr{border:0;border-top:1px solid var(--line);margin:5px 0}
.menus .liste button.coche::before{content:"✓ ";color:var(--blue)}
.titre{border:1px solid transparent;border-radius:8px;padding:5px 9px;font:600 .9rem var(--font);width:180px;min-width:80px;margin-left:8px}
.titre:hover,.titre:focus{border-color:var(--line);outline:none;background:var(--soft)}
.sp{flex:1}
.ic{border:1px solid transparent;background:none;border-radius:8px;width:32px;height:32px;font-size:1rem;display:grid;place-items:center;color:var(--ink)}
.ic:hover{background:var(--soft);border-color:var(--line)}.ic.on{background:#e7efff;border-color:#b7cbf5;color:var(--blue)}
.ic.mini{width:28px;height:28px;font-size:.9rem}
.panneaux-btn{display:none}@media (max-width:760px){.panneaux-btn{display:grid}}
.zoomv{font-size:.78rem;color:var(--muted);min-width:44px;text-align:center}
.btn{background:var(--red);color:#fff;border:0;border-radius:9px;padding:8px 14px;font-weight:700}.btn:hover{background:#c2211d}
.btn2{background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:9px;padding:8px 14px;font-weight:600}
.btn.mini,.btn2.mini{padding:5px 10px;font-size:.78rem}
.dl{position:relative}
.dlmenu{position:absolute;right:0;top:110%;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 40px rgba(22,26,34,.16);padding:8px;min-width:250px;z-index:60}
.dlmenu button{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;text-align:left;border:0;background:none;padding:8px 10px;border-radius:8px;font-weight:600;font-size:.85rem}
.dlmenu button:hover{background:var(--soft)}.dlmenu hr{border:0;border-top:1px solid var(--line);margin:6px 0}

.ctx{height:42px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:4px;padding:0 10px;overflow-x:auto;overflow-y:hidden}
.ctx .g{display:flex;align-items:center;gap:6px;padding-right:8px;margin-right:4px;border-right:1px solid var(--line);white-space:nowrap}
.ctx .g[hidden]{display:none}.ctx .g:last-child{border:0}
.ctx label{display:flex;align-items:center;gap:3px;font-size:.75rem;color:var(--muted)}
.ctx .num{width:56px}.ctx .num.s{width:46px}
.num{width:64px;border:1px solid var(--line);border-radius:7px;padding:4px 6px;font:600 .8rem var(--font)}.num.s{width:50px}
.inp{border:1px solid var(--line);border-radius:7px;padding:5px 7px;font:.85rem var(--font);width:100%}.inp.s{width:80px}
.sel{border:1px solid var(--line);border-radius:7px;padding:4px 6px;font:600 .8rem var(--font);background:#fff}.sel.s{max-width:110px}
.u{font-size:.72rem;color:var(--muted)}
.range{width:90px}
.fgbg{position:relative;width:44px;height:34px;margin-top:2px}
.fgbg .fg,.fgbg .bg{position:absolute;width:24px;height:24px;border:2px solid #fff;box-shadow:0 0 0 1px var(--line);border-radius:4px;padding:0}
.fgbg .fg{left:0;top:0;z-index:2}.fgbg .bg{left:14px;top:12px;z-index:1}.fgbg .swap{position:absolute;right:-4px;top:-6px;border:0;background:none;font-size:.7rem;color:var(--muted);padding:0;width:14px;height:14px}

.app{display:flex;height:calc(100% - 90px)}
.boite{width:76px;background:var(--rail);display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:2px;padding:6px}
.boite button{background:none;border:0;color:#aab3c5;height:30px;border-radius:7px;font-size:.95rem;display:grid;place-items:center}
.boite button:hover{background:var(--rail2);color:#fff}.boite button.on{background:var(--rail2);color:#fff;box-shadow:inset 0 0 0 1px var(--blue)}
.work{flex:1;display:flex;flex-direction:column;min-width:0}
.zone{flex:1;position:relative;overflow:hidden;min-height:0;touch-action:none;background:#e9ecf2}
.zone canvas{position:absolute;left:0;top:0;width:100%;height:100%}#surcouche{pointer-events:none}
.statut{height:26px;display:flex;align-items:center;gap:16px;padding:0 10px;font-size:.74rem;color:var(--muted);background:#fff;border-top:1px solid var(--line);white-space:nowrap;overflow:hidden}
.statut #pos{min-width:90px;font-variant-numeric:tabular-nums}.statut .astuce{overflow:hidden;text-overflow:ellipsis}
.chk{display:flex;align-items:center;gap:4px;cursor:pointer}

.panneaux{width:280px;background:#fff;border-left:1px solid var(--line);overflow:auto;display:flex;flex-direction:column}
.panneaux section{padding:12px;border-bottom:1px solid var(--line)}
.panneaux h3{margin:0 0 10px;font-size:.85rem;display:flex;align-items:center;gap:2px}
.row{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:.8rem;flex-wrap:wrap}.row label{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:.74rem}
.row.fin{justify-content:flex-end;margin-top:16px}
.row input[type=range]{flex:1;min-width:70px}
textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px;resize:vertical;font-size:.9rem}
.lien{border:0;background:none;color:var(--blue);font-weight:600;padding:0;font-size:.8rem}.lien:hover{text-decoration:underline}
.hint{font-size:.78rem;color:var(--muted);line-height:1.45}
.calques{list-style:none;margin:0;padding:0}
.calques li{display:flex;align-items:center;gap:6px;padding:4px 6px;border:1px solid var(--line);border-radius:8px;margin-bottom:4px;font-size:.78rem;cursor:pointer;background:#fff}
.calques li.on{border-color:var(--blue);background:#eef3ff}.calques li .t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calques li.ecret{margin-left:14px}
.calques .vig{width:36px;height:28px;border:1px solid var(--line);border-radius:4px;background:repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 0 0/8px 8px;object-fit:contain;flex:none}
.calques .vig.masque{background:#000}.calques .vig.on{outline:2px solid var(--blue)}
.calques .vig.reglage{display:grid;place-items:center;background:#f4f6fa;font-size:0}
.calques .vig.reglage::after{content:'';width:16px;height:16px;border-radius:50%;border:1px solid #5c6577;background:linear-gradient(90deg,#161a22 50%,#fff 50%)}
.ic.demi{font-size:0}.ic.demi::after{content:'';width:14px;height:14px;border-radius:50%;border:1px solid currentColor;background:linear-gradient(90deg,currentColor 50%,transparent 50%)}
.calques li button{border:0;background:none;color:var(--muted);font-size:.85rem;padding:0 2px;line-height:1}.calques li button.off{opacity:.3}
.histo{list-style:none;margin:0;padding:0;max-height:220px;overflow:auto}
.histo li{padding:4px 8px;font-size:.76rem;border-radius:6px;cursor:pointer}.histo li:hover{background:var(--soft)}.histo li.on{background:#eef3ff;color:var(--blue)}.histo li.futur{color:#aab3c5}
.courbes{width:100%;aspect-ratio:1;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:crosshair;touch-action:none;display:block}
.histogramme{width:100%;height:70px;border:1px solid var(--line);border-radius:8px;background:#fff;display:block}

.popover{position:fixed;z-index:70;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 40px rgba(22,26,34,.18);padding:12px;width:290px}
.popover input[type=color]{width:38px;height:32px;border:1px solid var(--line);border-radius:7px;padding:2px;background:#fff}
.popover input[type=range]{flex:1}.popover .row label{width:100%}
.swatches{display:grid;grid-template-columns:repeat(10,1fr);gap:4px;margin-top:8px}
.swatches button{aspect-ratio:1;border:1px solid var(--line);border-radius:5px}

.modal{position:fixed;inset:0;background:rgba(14,19,32,.45);display:grid;place-items:center;z-index:80}
.modal .box{background:#fff;border-radius:14px;padding:20px 22px;width:min(560px,92vw);max-height:88vh;overflow:auto;box-shadow:0 24px 80px rgba(0,0,0,.3)}
.modal h2{margin:0 0 12px;font-size:1.05rem}
.modal .champ{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0;font-size:.85rem}.modal .champ>span{color:var(--muted)}
.modal .champ .inp,.modal .champ .sel{width:220px}.modal .champ input[type=range]{width:220px}
.modal p{font-size:.85rem;line-height:1.5;color:#2a3040}.modal pre{white-space:pre-wrap;font:.8rem/1.6 var(--font);background:var(--soft);padding:10px;border-radius:8px}
.modal .etat{font-size:.78rem;color:var(--muted);margin:4px 0 8px}.modal .msg{color:var(--red);font-size:.8rem;min-height:1.1em}
.message{position:fixed;left:50%;bottom:40px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:9px 16px;border-radius:10px;font-size:.85rem;z-index:90;box-shadow:0 8px 30px rgba(0,0,0,.25)}
@media (max-width:980px){.panneaux{width:230px}.titre{display:none}}
@media (max-width:760px){
  .top{overflow-x:auto;gap:4px}.menus .menu>button{padding:6px 6px}
  .panneaux{position:fixed;right:0;top:90px;bottom:0;width:250px;transform:translateX(100%);transition:transform .2s;z-index:50;box-shadow:-8px 0 30px rgba(0,0,0,.15)}
  body.panneaux-ouverts .panneaux{transform:none}
  .boite{width:48px;grid-template-columns:1fr}
  .statut{gap:8px}.statut .astuce{display:none}
}
