:root{
  --bg:#f5f2ec; --card:#fff; --ink:#2c2620; --muted:#7c6f5c; --line:#ddd3c2;
  --accent:#9c5a3c; --accent2:#b06a44; --ok:#3f7d4f; --err:#b3402e;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
img{display:block;max-width:100%}

.ah{background:#2a2320;color:#e9dcc7;display:flex;justify-content:space-between;align-items:center;padding:12px 24px}
.ah-brand{color:#f3ebd9;font-weight:700}
.ah-brand b{color:var(--accent2)}
.ah-inst{color:var(--accent2);text-transform:uppercase;letter-spacing:.04em}
.ah-r{display:flex;gap:18px;align-items:center}
.ah-web{color:#cdbfa9;font-size:14px}
.ah-web:hover{color:#f3ebd9}

/* rozcestník instancí */
.picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-top:20px}
.pick{display:flex;flex-direction:column;gap:4px;background:var(--card);border:1px solid var(--line);
  border-radius:12px;padding:24px;text-decoration:none}
.pick:hover{border-color:var(--accent);text-decoration:none}
.pick-n{font-size:22px;font-weight:800;color:var(--accent);text-transform:uppercase;letter-spacing:.03em}
.pick-t{font-size:14px;color:var(--muted)}

.wrap{max-width:1000px;margin:0 auto;padding:20px 24px 60px}
.crumb{font-size:13px;color:var(--muted);margin-bottom:14px}
.crumb a{font-weight:600}
h1{font-size:26px;margin:6px 0 20px}
h2{font-size:16px;margin:0 0 12px}
.hint{font-weight:400;font-size:12px;color:var(--muted)}

.flash{padding:10px 14px;border-radius:8px;margin-bottom:16px;font-size:14px}
.flash.ok{background:#e6efe3;color:var(--ok);border:1px solid #bcd6b8}
.flash.err{background:#f6e2dd;color:var(--err);border:1px solid #e0b7ac}

.box{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin-bottom:20px}
.metaform{display:flex;flex-direction:column;gap:12px;max-width:520px}
.metaform label{font-size:13px;font-weight:600;color:var(--muted)}
.metaform input,.metaform textarea,.metaform select{
  width:100%;font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font-weight:400}
button{font:inherit;font-weight:700;background:var(--accent);color:#fff;border:0;padding:9px 18px;border-radius:7px;cursor:pointer}
button:hover{background:var(--accent2)}
button.ghost{background:transparent;color:var(--accent);border:1px solid var(--accent)}
.box form{margin:0}

.alba{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px}
.al{background:#fff;border:1px solid var(--line);border-radius:9px;overflow:hidden;cursor:grab}
.al.dragging{opacity:.4}
.al-ph{position:relative;aspect-ratio:3/2;background:#eee}
.al-ph img{width:100%;height:100%;object-fit:cover}
.al-zamek{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(30,22,14,.3);color:#fff;font-size:26px;text-shadow:0 2px 6px rgba(0,0,0,.5)}
.al-name{padding:8px 10px;font-size:14px;display:flex;justify-content:space-between;gap:6px;align-items:center}
.al-name .cnt{font-size:11px;color:var(--muted);background:var(--bg);border-radius:20px;padding:1px 8px}

.fotky{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}
.ft{position:relative;aspect-ratio:1;border:2px solid transparent;border-radius:6px;overflow:hidden;cursor:grab;background:#eee}
.ft img{width:100%;height:100%;object-fit:cover;pointer-events:none}
/* portret orezavat od shora (obliceje byvaji nahore), ne od stredu */
.ft img.portret,.al-ph img.portret{object-position:top}
.ft.dragging{opacity:.4}
.ft .badge{position:absolute;top:4px;left:4px;background:var(--accent);color:#fff;font-size:10px;font-weight:700;
  padding:2px 6px;border-radius:20px;display:none}
.ft.titulni{border-color:var(--accent)}
.ft.titulni .badge{display:block}
.ft .rot{position:absolute;bottom:4px;right:4px;width:26px;height:26px;padding:0;border-radius:50%;
  background:rgba(255,255,255,.85);color:var(--ink);font-size:15px;line-height:1;display:none;align-items:center;justify-content:center}
.ft .rot[data-smer="l"]{right:34px}
.ft:hover .rot{display:flex}
.ft .rot:hover{background:var(--accent);color:#fff}
.ft .rot:disabled{opacity:.5}
/* multi-vyber (checkbox v rohu) */
.ft .sel{position:absolute;top:5px;right:5px;width:20px;height:20px;margin:0;cursor:pointer;z-index:3;
  opacity:0;transition:opacity .15s}
.ft:hover .sel,.ft .sel:checked{opacity:1}
.ft.selected{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent) inset}
/* zvetsit (lupa) */
.ft .zoom{position:absolute;bottom:4px;left:4px;width:26px;height:26px;padding:0;border-radius:50%;
  background:rgba(255,255,255,.85);color:var(--ink);font-size:13px;line-height:1;display:none;
  align-items:center;justify-content:center;cursor:pointer;border:0}
.ft:hover .zoom{display:flex}
.ft .zoom:hover{background:var(--accent)}
/* plovouci lista vybranych fotek */
.selbar{position:sticky;bottom:10px;margin-top:12px;display:none;align-items:center;gap:10px;flex-wrap:wrap;
  background:var(--ink);color:#fff;border-radius:10px;padding:9px 14px;box-shadow:0 8px 24px -8px rgba(0,0,0,.4);z-index:50}
.selbar.show{display:flex}
.selbar b{font-size:15px}
.selbar button{background:rgba(255,255,255,.16);color:#fff;border:0;border-radius:7px;padding:6px 12px;
  font:inherit;font-weight:600;cursor:pointer}
.selbar button:hover{background:rgba(255,255,255,.32)}
.selbar .selrot{background:var(--accent)}
.selbar .selrot:hover{background:var(--accent2)}
/* modal vetsiho nahledu (otaceni na velkem) */
.lb{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.86);padding:24px}
.lb.open{display:flex}
.lb img{max-width:92vw;max-height:82vh;object-fit:contain;border-radius:4px;background:#222}
.lb-close{position:absolute;top:14px;right:18px;width:42px;height:42px;font-size:26px;border:0;border-radius:50%;
  background:rgba(255,255,255,.16);color:#fff;cursor:pointer}
.lb-close:hover{background:rgba(255,255,255,.32)}
.lb-tools{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);display:flex;gap:14px}
.lb-tools button{width:52px;height:52px;font-size:26px;border:0;border-radius:50%;
  background:rgba(255,255,255,.16);color:#fff;cursor:pointer}
.lb-tools button:hover{background:var(--accent)}
.lb-tools button:disabled{opacity:.5}

/* modal rucniho orezu titulni obalky */
.cropm{position:fixed;inset:0;z-index:1100;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.86);padding:20px}
.cropm.open{display:flex}
.cropm-in{background:var(--card);border-radius:12px;padding:16px 18px;max-width:94vw;max-height:92vh;
  display:flex;flex-direction:column;gap:12px}
.cropm-h{font-size:15px;font-weight:700}
.cropm-cil{font-size:13px;font-weight:600;color:var(--accent)}
.cropm-stage{position:relative;display:inline-block;margin:0 auto;line-height:0;overflow:hidden;
  max-width:88vw;user-select:none;touch-action:none}
.cropm-stage img{display:block;max-width:88vw;max-height:66vh}
.cropbox{position:absolute;box-sizing:border-box;border:2px solid #fff;cursor:move;
  box-shadow:0 0 0 100vmax rgba(0,0,0,.55);outline:1px solid rgba(0,0,0,.5)}
.cropbox .ch{position:absolute;width:16px;height:16px;background:#fff;border:1px solid var(--accent);border-radius:2px}
.cropbox .ch.nw{top:2px;left:2px;cursor:nwse-resize}
.cropbox .ch.ne{top:2px;right:2px;cursor:nesw-resize}
.cropbox .ch.sw{bottom:2px;left:2px;cursor:nesw-resize}
.cropbox .ch.se{bottom:2px;right:2px;cursor:nwse-resize}
.cropm-tools{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

/* formular nove slozky */
.mkdirf{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap}
.mkdirf input{flex:1;min-width:180px;font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink)}
.selbar .selmove{background:var(--accent)}
.selbar .selmove:hover{background:var(--accent2)}

/* modal presunu (strom cilovych slozek) */
.movem{position:fixed;inset:0;z-index:1100;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.7);padding:20px}
.movem.open{display:flex}
.movem-in{background:var(--card);border-radius:12px;padding:16px 18px;width:min(520px,94vw);max-height:88vh;
  display:flex;flex-direction:column;gap:12px}
.movem-h{font-size:15px;font-weight:700}
.movetree{overflow:auto;border:1px solid var(--line);border-radius:8px;padding:6px;min-height:120px;max-height:56vh}
.mt-node{display:flex;align-items:center;gap:2px}
.mt-tog{width:18px;flex:none;text-align:center;color:var(--muted);cursor:default;font-size:11px;user-select:none}
.mt-tog.has{cursor:pointer}
.mt-name{background:transparent;color:var(--ink);border:0;font:inherit;font-weight:500;padding:5px 8px;
  border-radius:6px;text-align:left;flex:1;cursor:pointer}
.mt-name:hover{background:var(--bg)}
.mt-name.sel{background:var(--accent);color:#fff}
.mt-name:disabled{color:var(--muted);cursor:not-allowed;background:transparent}
.mt-kids{margin-left:16px}
.movem-tools{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.titmenu{position:fixed;z-index:1000;max-height:60vh;overflow:auto;background:#fff;border:1px solid var(--line);
  border-radius:8px;box-shadow:0 10px 24px -10px rgba(0,0,0,.35);padding:6px;display:flex;flex-direction:column;gap:4px}
.titmenu-h{font-size:11px;font-weight:700;color:var(--muted);padding:2px 4px}
.titmenu button{background:#fff;color:var(--ink);border:1px solid var(--line);font-weight:500;
  font-size:12.5px;padding:6px 8px;border-radius:6px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.titmenu button:hover{background:var(--bg);border-color:var(--accent);color:var(--accent)}

/* přihlášení + správa uživatelů */
.login-box{max-width:420px;margin:8vh auto 0}
.ah-r{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.metaform .chk{display:flex;align-items:center;gap:8px;font-weight:400}
.metaform .chk input{width:auto;margin:0}
.heslobox{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin:0;display:flex;flex-direction:column;gap:10px}
.heslobox legend{padding:0 6px;font-size:13px;font-weight:600;color:var(--muted)}
.galset{border:1px solid var(--line,#ddd);border-radius:8px;padding:10px 14px;margin:0 0 6px;
  display:flex;flex-wrap:wrap;gap:6px 20px}
.galset[disabled]{opacity:.45}
.galset legend{padding:0 6px;font-size:13px;color:#888}
.row-akce{display:flex;gap:10px}

/* ostatni soubory ve slozce */
.soubory{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.soubory li{display:flex;align-items:center;gap:10px}
.soubory a{display:inline-flex;align-items:center;gap:10px;color:var(--ink)}
.soubory a:hover span{text-decoration:underline}

/* navod */
.navod section ul,.navod section ol{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:6px;line-height:1.5}
.navod section p{line-height:1.5}
.navod code{background:var(--bg);padding:1px 5px;border-radius:4px}
.navod-obsah{line-height:1.9}
.navod section{scroll-margin-top:12px}
