html, body { height: 100%; margin: 0; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
#app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.08);
}
.title { font-weight: 600; letter-spacing: .2px; }
.controls { display: flex; gap: 8px; }
.btn {
  padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,.12);
  background: transparent; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.main { position: relative; flex: 1; }
#viewer { position: absolute; inset: 0; }

.thumbs {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  border: 1px solid rgba(0,0,0,.12); border-radius: 14px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  padding: 8px;
}
.thumbs-inner { display: flex; gap: 8px; overflow: auto; padding-bottom: 2px; }
.thumb {
  width: 110px; min-width: 110px; height: 62px;
  border-radius: 10px; border: 1px solid rgba(0,0,0,.12);
  overflow: hidden; cursor: pointer; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .label {
  position: absolute; left: 6px; right: 6px; bottom: 6px;
  font-size: 11px; padding: 3px 6px; border-radius: 999px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.08);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb.active { outline: 2px solid rgba(0,0,0,.35); }

.picker {
  position: absolute; left: 12px; top: 12px; right: 12px;
  border: 1px solid rgba(0,0,0,.12); border-radius: 14px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  padding: 10px;
}
.picker-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input {
  min-width: 220px; flex: 1;
  padding: 7px 10px; border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
}
.hidden { display: none; }
.muted { opacity: .75; }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* default: návštěvník nevidí horní lištu ani picker */
.topbar { display: none; }
#picker { display: none; }

/* admin=1: zobraz vše */
body.admin .topbar { display: flex; }
body.admin #picker { display: block; }