:root { --bg:#16181c; --panel:#20232a; --line:#30343c; --text:#e8e9ec; --muted:#9aa0a8; --accent:#e0a84a; --ok:#5fb37a; --bad:#e06b5f;
  --field:#2b2f37; --field2:#3a3f49; --rule:#262a31; --okbg:#2a3b2f; --badbg:#3d2523; --link:var(--accent); --on-accent:#1b1b1b; --tile:200px; --tile-m:105px; color-scheme:dark; }
html[data-theme=clair] { --bg:#f3f3f1; --panel:#ffffff; --line:#d9d9d4; --text:#1d1f23; --muted:#5f646c; --field:#f1f1ee; --field2:#e4e4df;
  --rule:#e6e6e2; --okbg:#e5f3e8; --badbg:#fbe7e4; --link:var(--accent-ink); --ok:#2f8a4b; --bad:#c2412f; color-scheme:light; }
@media (prefers-color-scheme: light) {
  html[data-theme=auto] { --bg:#f3f3f1; --panel:#ffffff; --line:#d9d9d4; --text:#1d1f23; --muted:#5f646c; --field:#f1f1ee; --field2:#e4e4df;
    --rule:#e6e6e2; --okbg:#e5f3e8; --badbg:#fbe7e4; --link:var(--accent-ink); --ok:#2f8a4b; --bad:#c2412f; color-scheme:light; }
}
html { font-size:15px; }
html[data-texte=grand] { font-size:18px; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:1rem/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
a { color:var(--link); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:1.5em; margin:.2em 0 .5em; } h2 { font-size:1.15em; margin:.2em 0 .6em; }
.top { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; padding:10px 20px; background:var(--panel); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:1000; }
.brand { font-weight:600; font-size:1.1em; color:var(--text); }
.top nav { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; flex:1; justify-content:flex-end; }
.top nav a { color:var(--text); }
main { padding:16px 20px 40px; max-width:1800px; margin:0 auto; }
.inline { display:inline; margin:0; }
input, select, textarea, button, .button { font:inherit; color:var(--text); background:var(--field); border:1px solid var(--line); border-radius:6px; padding:7px 10px; }
input:focus, textarea:focus, select:focus { outline:2px solid var(--accent); outline-offset:-1px; }
button, .button { background:var(--accent); color:var(--on-accent); border:0; cursor:pointer; font-weight:600; display:inline-block; }
button:disabled { opacity:.45; cursor:default; }
button.link { background:none; color:var(--text); padding:0; font-weight:normal; }
button.danger { background:var(--bad); color:#fff; }
.small { padding:4px 10px; font-size:.9em; }
label { display:flex; flex-direction:column; gap:4px; margin:0 0 10px; color:var(--muted); font-size:.92em; }
label input, label select, label textarea { color:var(--text); }
label.check { flex-direction:row; align-items:center; gap:6px; }
.searchbox input { width:170px; padding:5px 9px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px 18px; margin:0 0 16px; }
.narrow { max-width:440px; margin:30px auto; }
.muted { color:var(--muted); }
.flash { padding:9px 13px; border-radius:7px; background:var(--okbg); border:1px solid var(--ok); }
.flash.erreur { background:var(--badbg); border-color:var(--bad); }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.row .grow { flex:1; min-width:200px; }
.head { display:flex; flex-wrap:wrap; align-items:baseline; gap:12px; }
.crumbs { color:var(--muted); margin:0 0 6px; }
.folders { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; margin:0 0 20px; }
.folder { position:relative; display:block; aspect-ratio:4/3; border-radius:9px; overflow:hidden; background:var(--panel); border:1px solid var(--line); }
.folder img, .folder .noimg { width:100%; height:100%; object-fit:cover; display:block; opacity:.8; }
.folder .fname { position:absolute; left:0; right:0; bottom:0; padding:22px 10px 8px; background:linear-gradient(transparent,rgba(0,0,0,.85)); color:#fff; font-weight:600; }
.folder .count { position:absolute; top:6px; right:6px; background:rgba(0,0,0,.65); color:#fff; border-radius:10px; padding:1px 8px; font-size:.8em; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(var(--tile),1fr)); gap:10px; }
.tile { position:relative; margin:0; background:var(--panel); border-radius:8px; overflow:hidden; }
.tile img { width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.tile figcaption { font-size:.82em; padding:5px 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
.tile .pick { position:absolute; top:8px; left:8px; width:20px; height:20px; z-index:2; accent-color:var(--accent); }
.stars { color:var(--link); }
.pager { text-align:center; margin:20px 0; display:flex; gap:20px; justify-content:center; }
.viewer { position:relative; display:flex; justify-content:center; align-items:center; background:#0d0e10; border-radius:10px; min-height:300px; margin-bottom:16px; }
.viewer img.big { max-width:100%; max-height:calc(100vh - 140px); display:block; }
.viewer .nav { position:absolute; top:50%; transform:translateY(-50%); font-size:48px; color:#fff; background:rgba(0,0,0,.4); width:52px; height:80px; display:flex; align-items:center; justify-content:center; border-radius:8px; text-decoration:none; z-index:5; }
.viewer .prev { left:8px; } .viewer .next { right:8px; }
.photo-info { display:grid; grid-template-columns:repeat(auto-fit,minmax(360px,1fr)); gap:16px; align-items:start; }
.photo-info .card { margin:0; }
.facts { display:grid; grid-template-columns:auto 1fr; gap:4px 14px; margin:0 0 12px; }
.facts dt { color:var(--muted); } .facts dd { margin:0; overflow-wrap:anywhere; }
.tag { display:inline-block; background:var(--field); border-radius:12px; padding:1px 10px; margin:2px 0; color:var(--text); }
.cloud .tag { margin:3px; }
.minimap { height:240px; border-radius:8px; margin-top:8px; }
.pickmap { height:300px; border-radius:8px; margin:6px 0; }
.bigmap { height:calc(100vh - 110px); border-radius:10px; }
.cols { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:0 14px; }
.cols .wide { grid-column:1/-1; }
.geosearch { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:10px; }
.geosearch input { flex:1; min-width:180px; }
.geosearch button { background:var(--field2); color:var(--text); font-weight:normal; }
.exif input[type=search] { width:100%; margin-bottom:10px; }
.exif details { border-top:1px solid var(--line); padding:6px 0; }
.exif summary { cursor:pointer; font-weight:600; }
.exif table, table.list { width:100%; border-collapse:collapse; font-size:.88em; }
.exif th, .exif td, table.list th, table.list td { text-align:left; vertical-align:top; padding:3px 6px; border-bottom:1px solid var(--rule); overflow-wrap:anywhere; }
.exif th { color:var(--muted); font-weight:normal; width:40%; }
.batch summary { cursor:pointer; font-weight:600; }
.drop { border:2px dashed var(--line); border-radius:10px; padding:36px 16px; text-align:center; cursor:pointer; color:var(--text); position:relative; }
.drop.over { border-color:var(--accent); }
.drop input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.uploads { list-style:none; padding:0; margin:10px 0 0; }
.uploads li { padding:6px 0; border-bottom:1px solid var(--line); display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.uploads progress { flex:1; min-width:120px; }
.uploads li.ok progress { accent-color:var(--ok); } .uploads li.bad { color:var(--bad); }
.cluster { background:var(--accent); color:var(--on-accent); border-radius:50%; display:flex !important; align-items:center; justify-content:center; font-weight:700; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.5); }
.thumbpin { border:2px solid #fff; border-radius:6px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.6); background:#000; }
.thumbpin img { width:100%; height:100%; object-fit:cover; display:block; }
@media (max-width:700px) { main { padding:12px; } .grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); } .photo-info { grid-template-columns:1fr; } .top nav { justify-content:flex-start; } }
.newfolder input { padding:4px 9px; width:170px; }
.sortbar { margin:0 0 10px; }
.chips { margin:6px 0; line-height:2; }
.tag.on { background:var(--accent); color:var(--on-accent); }
.tag.on .muted { color:#3b3b3b; }
.searchform .row { gap:10px; }
label.inl { flex-direction:row; align-items:center; gap:6px; margin:0; }
fieldset { border:1px solid var(--line); border-radius:8px; margin:10px 0; padding:8px 12px; }
legend { color:var(--muted); padding:0 6px; }
.albums-box { margin:10px 0; }
.albums-box .row { margin-top:6px; }
.albums-box .tag button.link { margin-left:6px; color:var(--muted); }
.keybox { width:100%; font-family:ui-monospace,Menlo,monospace; }
.viewer video.big { max-width:100%; max-height:calc(100vh - 140px); display:block; background:#000; }
.tile a { position:relative; display:block; }
.vbadge { position:absolute; right:6px; bottom:6px; background:rgba(0,0,0,.65); color:#fff; font-size:.78em; padding:2px 7px; border-radius:10px; }
footer.version { text-align:center; font-size:.78em; padding:18px 0 24px; }
.danger-zone summary { color:var(--bad); }
.danger-zone input[name=confirmation] { max-width:260px; }
.retouche label { display:block; margin:6px 0; }
.retouche input[type=range] { width:100%; accent-color:var(--accent); }
.retouche output { float:right; color:var(--muted); }
.printprev { max-width:100%; display:block; border-radius:6px; }
/* 1.8 : menus dépliants, groupes de mots-clés, smartphone */
details.fold > summary { cursor:pointer; font-weight:600; list-style:none; display:flex; align-items:center; gap:8px; padding:4px 0; min-height:36px; }
details.fold > summary::-webkit-details-marker { display:none; }
details.fold > summary::before { content:"▸"; color:var(--accent); transition:transform .15s; display:inline-block; width:1em; }
details.fold[open] > summary::before { transform:rotate(90deg); }
details.card.fold > summary { font-size:1.08em; margin:-4px 0; }
details.card.fold[open] > summary { margin-bottom:8px; }
details.fold details.fold { border-top:1px solid var(--line); padding:4px 0; }
details.fold details.fold > summary { font-size:.95em; }
.ptitle { font-size:1.3em; overflow-wrap:anywhere; }
.tag button.x { margin-left:6px; color:var(--muted); padding:0 2px; }
.groupbtns { display:flex; flex-wrap:wrap; gap:8px; margin:4px 0 12px; }
button.chip { background:var(--field); color:var(--text); border:1px solid var(--accent); border-radius:16px; font-weight:normal; padding:6px 14px; }
button.chip:hover { background:var(--accent); color:var(--on-accent); }
label.tagcheck { display:inline-flex; flex-direction:row; align-items:center; margin:3px 6px 3px 0; cursor:pointer; }
label.tagcheck input { position:absolute; opacity:0; width:1px; height:1px; }
label.tagcheck span { background:var(--field); border:1px solid var(--line); border-radius:16px; padding:5px 12px; color:var(--text); }
label.tagcheck input:checked + span { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
label.tagcheck input:focus-visible + span { outline:2px solid var(--accent); }
.selfab { position:fixed; right:16px; bottom:16px; z-index:1100; background:var(--accent); color:var(--on-accent); font-weight:600; padding:12px 18px; border-radius:24px; box-shadow:0 3px 12px rgba(0,0,0,.5); }
.selfab:hover { text-decoration:none; }
.menubtn { display:none; background:none; color:var(--text); font-size:1.5em; padding:2px 10px; margin-left:auto; }
@media (max-width:800px) {
  .top { padding:8px 12px; }
  .menubtn { display:block; }
  .top nav { display:none; flex-basis:100%; flex-direction:column; align-items:stretch; gap:0; }
  body.menu-open .top nav { display:flex; }
  .top nav > a, .top nav > form { padding:11px 4px; border-top:1px solid var(--line); }
  .top nav .searchbox input { width:100%; }
  .top nav button.link { width:100%; text-align:left; }
}
@media (max-width:700px) {
  html { font-size:16px; } html[data-texte=grand] { font-size:19px; }
  input, select, textarea { font-size:max(16px, 1rem); } /* évite le zoom automatique de l'iPhone */
  button, .button { padding:9px 14px; }
  .small { padding:7px 12px; }
  h1 { font-size:1.3em; }
  .card { padding:12px 14px; border-radius:8px; }
  .grid { grid-template-columns:repeat(auto-fill,minmax(var(--tile-m),1fr)); gap:6px; }
  .tile .pick { width:24px; height:24px; top:6px; left:6px; }
  .folders { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px; }
  .viewer { margin:0 -12px 12px; border-radius:0; min-height:200px; }
  .viewer .nav { width:36px; height:56px; font-size:32px; background:rgba(0,0,0,.25); }
  .viewer .prev { left:4px; } .viewer .next { right:4px; }
  .viewer img.big, .viewer video.big { max-height:70vh; }
  .photo-info { gap:10px; }
  .minimap { height:200px; }
  .cols { grid-template-columns:1fr; }
  .facts { grid-template-columns:1fr; gap:0; } .facts dt { margin-top:6px; font-size:.85em; }
  .row > * { flex:1 1 auto; }
  .row > .muted, .row > label.check { flex-basis:100%; }
  .exif th { width:45%; }
}
/* 1.9 : apparence choisie par chaque utilisateur */
.top, .card { box-shadow:0 1px 2px rgba(0,0,0,.06); }
.grid.entiere .tile img { object-fit:contain; background:#0d0e10; }
.grid.sans-legende .tile figcaption { display:none; }
.folders.liste { grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:6px; }
.folders.liste .folder { aspect-ratio:auto; display:flex; align-items:center; gap:10px; padding:6px; color:var(--text); }
.folders.liste .folder img, .folders.liste .folder .noimg { width:48px; height:48px; border-radius:5px; opacity:1; flex:none; }
.folders.liste .folder .fname { position:static; padding:0; background:none; color:var(--text); flex:1; }
.folders.liste .folder .count { position:static; background:var(--field); color:var(--muted); }
.swatches { display:flex; flex-wrap:wrap; gap:6px; }
label.swatch { flex-direction:row; margin:0; cursor:pointer; }
label.swatch input { position:absolute; opacity:0; width:1px; height:1px; }
label.swatch span { display:inline-flex; align-items:center; gap:6px; padding:5px 11px 5px 6px; border:1px solid var(--line); border-radius:16px; color:var(--text); }
label.swatch span::before { content:""; width:18px; height:18px; border-radius:50%; background:var(--c); }
label.swatch input:checked + span { border-color:var(--text); box-shadow:0 0 0 1px var(--text); }
label.swatch input:focus-visible + span { outline:2px solid var(--link); }
@media (max-width:700px) { .tile figcaption { font-size:.72em; padding:3px 5px; } }
/* 1.10 */
.pager.loading { opacity:.5; }
.pager.loading::after { content:" Chargement…"; }
.doublons .grp { display:flex; flex-wrap:wrap; gap:10px; }
.doublons figure { margin:0; width:180px; background:var(--field); border-radius:8px; overflow:hidden; font-size:.85em; }
.doublons figure img { width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.doublons figcaption { padding:6px 8px; overflow-wrap:anywhere; }
.offscreen { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
/* 1.13 : corbeille, partage, favoris, commentaires, chronologie */
.trashlist { display:flex; flex-direction:column; gap:10px; }
.trashitem { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:0; }
.trashitem img { width:72px; height:72px; object-fit:cover; border-radius:6px; background:var(--field); }
.trashitem p { margin:2px 0; }
.sharelink { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 10px; }
.sharelink input { flex:1 1 260px; min-width:0; font-size:.9em; }
.sharelink.expire input { text-decoration:line-through; opacity:.6; }
.fav { color:#e0245e; }
button.on { background:#e0245e; color:#fff; border-color:#e0245e; }
.comment { border-bottom:1px solid var(--line); padding:4px 0; }
.comment p { margin:2px 0; }
.ctext { white-space:pre-wrap; overflow-wrap:anywhere; }
#commentaires textarea { min-height:2.6em; }
.year h2 { margin:18px 0 8px; }
.year h2 a { color:inherit; }
.chead form.inline { display:inline; margin-left:6px; }
