:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2430; --mute: #6b7482; --line: #e2e5ea;
  --acc: #0b6aa8; --acc-ink: #fff; --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
a { color: var(--acc); }

/* ---------- Galéria ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; max-width: 1280px; margin: 0 auto; padding: 12px 16px; color: var(--ink); text-decoration: none; font-weight: 600; }
.brand img { height: 40px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar h1 { margin: 0; font-size: 1.6rem; }
.toolbar h1 small { color: var(--mute); font-weight: 400; font-size: 1rem; }
#q { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .9rem; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 6px 22px rgba(20,30,50,.10); transform: translateY(-2px); }
.card[hidden] { display: none; }
.thumb { position: relative; display: block; aspect-ratio: 16/10; background: hsl(var(--h) 35% 16%); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 100%; height: 100%; display: block; fill: hsl(var(--h) 70% 72%); opacity: .85; }
.badge { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: .75rem; padding: 3px 8px; border-radius: 6px; }
.card.pending { opacity: .6; }
.meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta h2 { margin: 0; font-size: 1.05rem; }
.meta h2 a { color: var(--ink); text-decoration: none; }
.meta p { margin: 0; color: var(--mute); font-size: .9rem; }
.sub { display: flex; gap: 10px; color: var(--mute); font-size: .8rem; flex-wrap: wrap; }
.sub .type { margin-left: auto; letter-spacing: .04em; }
.actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 7px; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9c0ca; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.sm { padding: 5px 10px; font-size: .85rem; }
.alert { background: #fff3f2; border: 1px solid #f3c2bd; padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.empty { color: var(--mute); }
.foot { text-align: center; color: var(--mute); font-size: .85rem; padding: 20px; }

/* ---------- Dialóg embed ---------- */
.dlg { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
.dlg::backdrop { background: rgba(10,15,25,.5); }
.dlg-in { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.dlg header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dlg .x { border: 0; background: none; font-size: 1.6rem; cursor: pointer; line-height: 1; }
.dlg label { font-size: .85rem; color: var(--mute); margin-top: 6px; }
.dlg .row { display: flex; gap: 8px; align-items: center; }
.dlg .row.end { justify-content: flex-end; }
.dlg .opts { gap: 16px; font-size: .9rem; }
.dlg input, .dlg textarea { font: inherit; font-size: .9rem; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; }
.dlg .row > input { flex: 1; min-width: 0; }
.dlg textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; resize: vertical; width: 100%; }
.dlg .chk { display: flex; gap: 8px; align-items: center; color: var(--ink); margin: 0; }

/* ---------- Heslo / 404 ---------- */
.center-box { max-width: 360px; margin: 12vh auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.center-box h1 { font-size: 1.2rem; margin: 0; }
.center-box label { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: .9rem; }
.center-box input { padding: 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.lock-logo { height: 40px; align-self: center; }
.err { color: #b42318; margin: 0; }

/* ---------- Prehliadač ---------- */
body.viewer { overflow: hidden; background: #000; }
.vbar { position: absolute; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); z-index: 10; }
.vbar .back { font-size: 1.3rem; text-decoration: none; color: var(--ink); padding: 0 6px; }
.vlogo { height: 28px; }
.vtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; }
.potree_container { position: absolute; left: 0; right: 0; bottom: 0; top: 48px; }
.is-embed .potree_container { top: 0; }
.embed-ov { position: absolute; right: 10px; bottom: 10px; z-index: 20; display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.55); color: #fff; padding: 5px 6px 5px 12px; border-radius: 8px; font-size: .85rem; max-width: 70%; }
.embed-ov span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.embed-ov a { color: #fff; text-decoration: none; font-size: 1.1rem; padding: 0 6px; }
@media (max-width: 640px) {
  #btnView { display: none; }
  .vlogo { display: none; }
  #q { min-width: 0; width: 100%; }
}

/* jazyková lišta Potree (CS nemá) */
#potree_languages { display: none !important; }

.btn.admin { background: #fff4d6; border-color: #e6c35c; }
.badge-admin { font-size: .8rem; font-weight: 500; background: #fff4d6; border: 1px solid #e6c35c; color: #6b5200; padding: 3px 8px; border-radius: 6px; text-decoration: none; vertical-align: middle; }

/* logo GEOTON vpravo nahoře v prohlížeči (bílé, poloprůhledné; stín kvůli bílému pozadí) */
.geo-mark { position: absolute; top: 12px; right: 12px; z-index: 15; width: 84px; line-height: 0; opacity: .6; transition: opacity .2s; filter: drop-shadow(0 0 2px rgba(0,0,0,.45)); }
.geo-mark:hover { opacity: .9; }
.geo-mark img { width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .geo-mark { width: 60px; top: 8px; right: 8px; } }
