/* =====================================================================
 *  Kruh — mobilná fotogaléria (event archív)
 *  Implementácia design handoffu „design_handoff_kruh_galeria".
 *  Verejná časť: tmavá (default) + svetlá téma, high-fidelity.
 *
 *  Typografia (2 lokálne rodiny, žiadne runtime CDN):
 *   · IBM Plex Mono (400/500/600) — nadpisy, mená, kickery, meta, počítadlá
 *   · IBM Plex Sans (400/500)     — bežný text, tlačidlá, popisy
 * ===================================================================== */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* Web adaptácia: prototyp má 56px pod fake status barom; na webe stačí
     bezpečná zóna + malý padding (žiadny falošný status bar). */
  --pad-top: calc(16px + var(--safe-top));

  /* Admin (fixná svetlá paleta — administrácia sa dizajnovo nemení) */
  --accent: #6f7355;
  --card-bg: #ffffff;
  --text: #1b1913;
  --text-muted: #6b665a;
  --radius: 8px;
}

/* Verejná téma — presné tokeny z handoffu (dark = default) */
html[data-theme="dark"] {
  --bg: #0d0d0c;
  --fg: #f4f1e9;
  --muted: #aaa79e;
  --surface: #181816;
  --border: rgba(244, 241, 233, 0.15);
  --floating: rgba(18, 18, 16, 0.86);
  --overlay: rgba(0, 0, 0, 0.72);
}
html[data-theme="light"] {
  --bg: #f0ede5;
  --fg: #171714;
  --muted: #6f6b62;
  --surface: #e3dfd4;
  --border: rgba(23, 23, 20, 0.15);
  --floating: rgba(240, 237, 229, 0.88);
  --overlay: rgba(0, 0, 0, 0.62);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #f0ede5;               /* základ = svetlý (admin) */
  color: #171714;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[data-theme] body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; }
main { padding-bottom: calc(24px + var(--safe-bottom)); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--fg, #6f7355); outline-offset: 3px; }

/* Animácie (handoff) */
@keyframes eg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes eg-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes eg-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes eg-scrim { from { opacity: 0; } to { opacity: 1; } }
.page-fade { animation: eg-fade 0.4s ease both; }

/* Flash (admin) */
.flash-messages { margin-top: 16px; }
.flash { padding: 10px 14px; border-radius: 8px; }
.flash-error { background: #f6e4e0; color: #7a2e21; }
.flash-success { background: #e4efe0; color: #2f5a29; }

/* =====================================================================
 *  Horná navigácia (archív / event / autori / profil)
 * ===================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: var(--pad-top) 20px 12px;
  background: linear-gradient(var(--bg) 74%, transparent);
}
body.event-page .top-nav,
body.profile-page .top-nav { padding: var(--pad-top) 14px 10px; }

.wordmark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 8px 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--fg); }
.back-link .icon { width: 20px; height: 20px; }

.theme-toggle {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--fg);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle .icon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* =====================================================================
 *  1) Onboarding  (fullbleed cover, vždy tmavý)
 * ===================================================================== */
body.onboarding-page main { padding: 0; }
.onboarding {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  color: #f4f1e9;
  overflow: hidden;
  animation: eg-fade 0.5s ease both;
}
.onboarding-cover { position: absolute; inset: 0; }
.onboarding-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.onboarding-cover.is-empty { background: radial-gradient(120% 90% at 50% 10%, #2a2a26, #0b0b0a); }
.onboarding-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(8,8,7,.35) 0%, rgba(8,8,7,.1) 34%, rgba(8,8,7,.82) 82%, #080807 100%);
}
.onboarding-word {
  position: absolute;
  top: calc(24px + var(--safe-top));
  left: 24px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: #f4f1e9;
}
.onboarding-body {
  position: absolute;
  left: 24px; right: 24px;
  bottom: calc(40px + var(--safe-bottom));
}
.onboarding-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(244,241,233,.72);
  margin: 0 0 16px;
}
.onboarding-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}
.onboarding-desc {
  margin: 16px 0 26px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(244,241,233,.78);
  max-width: 32ch;
}
.onboarding-cta {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: #f4f1e9;
  color: #141413;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.onboarding-cta .icon { width: 18px; height: 18px; }

/* =====================================================================
 *  2) Archív
 * ===================================================================== */
body.archive main, body.autori-page main {
  max-width: 720px;
  margin: 0 auto;
}
.intro { padding: 16px 20px 20px; }
.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: var(--mono);
  font-size: 11px;
}
.intro-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}
.intro-sub { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.event-list {
  list-style: none;
  margin: 0;
  padding: 6px 14px calc(120px + var(--safe-bottom));
  display: grid;
  gap: 26px;
}
.event-item { margin: 0; }
.event-block {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ar, 1 / 1.12);
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  color: #fff;
  text-decoration: none;
  text-align: left;
}
.event-photo { position: absolute; inset: 0; }
.event-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.event-photo.is-empty { background: radial-gradient(120% 80% at 50% 20%, #33332e, #16150f); }
.event-block::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(0,0,0,.78));
}
@media (hover: hover) { .event-block:hover .event-photo img { transform: scale(1.025); } }
.event-copy { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 22px; }
.event-name {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
  color: #fff;
}
.event-line { display: block; margin: 0; font-family: var(--sans); font-size: 13px; color: rgba(255,255,255,.8); }

.empty-state {
  margin: 20vh 22px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
}

/* =====================================================================
 *  3) Event detail
 * ===================================================================== */
body.event-page main, body.profile-page main {
  max-width: 1180px;
  margin: 0 auto;
}
.event-head { padding: 8px 20px 16px; max-width: 640px; }
.event-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
.event-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.event-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 46ch;
}

/* Filter chipy — textová navigácia s podčiarknutím + avatar autora */
.filter-bar {
  position: sticky;
  top: calc(56px + var(--safe-top));
  z-index: 4;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { color: var(--fg); }
.chip.is-active { color: var(--fg); border-bottom-color: currentColor; }
.chip-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  flex: 0 0 auto;
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Masonry mriežka — CSS Grid s row-spanmi (poradie po riadkoch, zarovnané).
   Span sa dopočíta v gallery.js podľa pomeru strán a šírky stĺpca. */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 8px;
  gap: 4px;
  margin: 0;
  padding: 4px 4px calc(120px + var(--safe-bottom));
  list-style: none;
}
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1300px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }

.photo-cell { margin: 0; grid-row-end: span 35; }  /* fallback pred JS */
.photo-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
}
.photo-button img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: eg-fade 0.5s ease both;
}
.filter-empty {
  margin: 12vh 22px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

/* =====================================================================
 *  4) Autori (zoznam)
 * ===================================================================== */
.autori-intro { padding: 6px 20px 14px; }
.autori-intro p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.author-list {
  list-style: none;
  margin: 0;
  padding: 6px 16px calc(120px + var(--safe-bottom));
  display: grid;
  gap: 2px;
}
.author-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.author-avatar {
  flex: 0 0 auto;
  width: 58px; height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-main { flex: 1; min-width: 0; }
.author-name {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.author-sub {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.author-row .chevron { display: flex; color: var(--muted); flex: 0 0 auto; }

/* =====================================================================
 *  5) Profil autora
 * ===================================================================== */
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 24px 18px;
}
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 16px 0 0;
}
.profile-meta {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.profile-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 34ch;
}

/* =====================================================================
 *  6) Lightbox — vždy uhlovo čierny
 * ===================================================================== */
body.no-scroll { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #050505;
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: eg-fade 0.26s ease both;
}
.lightbox[hidden] { display: none; }
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 14px 6px;
  z-index: 2;
}
.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 calc(10px + var(--safe-right)) 0 calc(10px + var(--safe-left));
}
.lightbox-image {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  -webkit-user-select: none; user-select: none;
  animation: eg-fade 0.3s ease both;
}
.lb-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  color: rgba(255,255,255,.9);
  cursor: pointer;
  transition: background 0.2s ease;
}
@media (hover: hover) { .lb-btn:hover { background: rgba(255,255,255,.12); } }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.8);
}
.lb-prev { left: calc(6px + var(--safe-left)); }
.lb-next { right: calc(6px + var(--safe-right)); }
.lb-nav[hidden] { display: none; }
.lightbox-caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 14px 20px calc(24px + var(--safe-bottom));
  color: #f5f3ed;
  font-size: 13.5px;
}
.lb-cap-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #222;
  flex: 0 0 auto;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-author { display: block; }
.lb-equip { display: block; color: #9c9c98; font-size: .92em; margin-top: 2px; }
.lb-counter { color: #9c9c98; white-space: nowrap; font-family: var(--mono); font-size: 12px; }

/* =====================================================================
 *  7) Download sheet
 * ===================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--overlay);
  animation: eg-scrim 0.2s ease both;
}
.sheet-backdrop[hidden] { display: none; }
.download-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 31;
  background: var(--surface);
  color: var(--fg);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(28px + var(--safe-bottom));
  max-width: 460px;
  margin: 0 auto;
  box-shadow: 0 -18px 50px rgba(0,0,0,.4);
  animation: eg-sheet 0.3s cubic-bezier(.2,.8,.2,1) both;
}
.download-sheet[hidden] { display: none; }
.sheet-handle {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: .5;
  margin: 4px auto 16px;
}
.sheet-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 20px;
  margin: 0 4px 8px;
}
.sheet-option {
  width: 100%;
  display: block;
  text-align: left;
  padding: 15px 4px;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
.sheet-option + .sheet-option { border-top: 1px solid var(--border); }
.sheet-option-title { display: block; font-family: var(--sans); font-weight: 500; font-size: 16px; }
.sheet-option-desc { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.sheet-cancel {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  cursor: pointer;
}

/* =====================================================================
 *  Plávajúca spodná lišta (Archív / Autori / Intro)
 * ===================================================================== */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + var(--safe-bottom));
  width: min(calc(100% - 32px), 420px);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--floating);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border-radius: 22px;
  padding: 6px;
}
.nav-tab {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
.nav-tab.is-active { background: var(--fg); color: var(--bg); }
.nav-tab .icon { width: 21px; height: 21px; }

/* =====================================================================
 *  Administrácia — čistý editorial vzhľad (IBM Plex, svetlý)
 * ===================================================================== */
body.admin {
  background: #efece4;
  color: #1b1913;
  font-family: var(--sans);
}
body.admin main { max-width: 1000px; padding: 0 20px calc(64px + var(--safe-bottom)); }

/* Horná lišta (admin-header = wrapper v _nav.html) */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: calc(16px + var(--safe-top)) 0 14px;
  border-bottom: 1px solid #e2dccf;
}
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.admin-nav a {
  color: #6f6a5f;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.admin-nav a:hover { color: #1b1913; background: #e7e1d4; }
.admin-logout { margin: 0; }
.admin-logout button {
  min-height: 40px; padding: 8px 14px;
  border: 1px solid #e2dccf; border-radius: 8px;
  background: #fff; color: #1b1913;
  font-family: var(--sans); font-size: 0.9rem; cursor: pointer;
}
.admin-logout button:hover { background: #f4f1ea; }

.admin-page { margin-top: 26px; }
.admin-page h1 {
  font-family: var(--mono); font-weight: 500;
  font-size: 1.7rem; letter-spacing: -0.02em; margin: 0;
}
.admin-page h2 {
  font-family: var(--mono); font-weight: 500;
  font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 4px;
}
.admin-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.admin-meta { color: #6f6a5f; margin: 6px 0 16px; }
.admin-badge {
  display: inline-block;
  background: #e7e1d4; color: #4a463d;
  border-radius: 999px; padding: 3px 12px;
  font-family: var(--mono); font-size: 0.78rem;
}

/* Tlačidlá */
.btn, .admin-actions a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 10px 18px;
  border: 0; border-radius: 10px;
  background: #6f7355; color: #fff;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #5f6349; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form { display: inline; margin: 0; }
button.danger { background: #9b3f2f; }
button.danger:hover { background: #883425; }

.admin-subsection { margin-top: 32px; padding-top: 24px; border-top: 1px solid #e2dccf; }

/* Tabuľka */
.admin-table {
  width: 100%; border-collapse: collapse; margin-top: 16px;
  background: #fff; border: 1px solid #e2dccf; border-radius: 12px; overflow: hidden;
}
.admin-table th {
  text-align: left; padding: 11px 14px;
  font-family: var(--mono); font-weight: 500; font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: #8a857a;
  background: #f6f3ec; border-bottom: 1px solid #e2dccf;
}
.admin-table td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid #eee8dc; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td a { color: #1b1913; text-decoration: none; font-weight: 500; }
.admin-table td a:hover { text-decoration: underline; }
.admin-row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-row-actions a {
  color: #6f7355; text-decoration: none; font-size: 0.9rem; padding: 6px 8px;
}
.admin-row-actions a:hover { text-decoration: underline; }
.admin-row-actions button {
  min-height: 34px; padding: 6px 12px;
  border: 0; border-radius: 8px;
  background: #9b3f2f; color: #fff;
  font-size: 0.85rem; cursor: pointer;
}

.admin-avatar-sm {
  display: block; width: 38px; height: 38px;
  border-radius: 50%; overflow: hidden; background: #e7e1d4;
}
.admin-avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Formuláre */
.admin-form { display: grid; gap: 5px; max-width: 560px; margin-top: 16px; }
.admin-form label {
  font-family: var(--mono); font-weight: 500; font-size: 0.82rem;
  color: #4a463d; margin-top: 10px;
}
.admin-form input, .admin-form textarea, .admin-form select {
  padding: 11px 13px;
  border: 1px solid #d8d1c5; border-radius: 10px;
  font-size: 1rem; font-family: var(--sans); width: 100%;
  background: #fff; color: #1b1913;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
  outline: 2px solid #6f7355; outline-offset: 1px; border-color: #6f7355;
}
.admin-form-row { display: flex; gap: 12px; }
.admin-form-row > div { flex: 1; }
.admin-checkbox { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.92rem; }
.admin-checkbox input { width: auto; }
.admin-form-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.admin-form-actions a { color: #6f6a5f; }
.admin-hint, .admin-note { color: #6f6a5f; font-size: 0.88rem; }

/* Avatar pole vo formulári */
.avatar-field { display: flex; gap: 16px; align-items: flex-start; margin: 2px 0 4px; }
.avatar-preview {
  flex: 0 0 auto; width: 84px; height: 84px;
  border-radius: 50%; overflow: hidden; background: #e7e1d4;
  display: grid; place-items: center;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-empty { color: #a9a294; font-size: 1.4rem; }
.avatar-field-body { flex: 1; min-width: 0; }
.avatar-field-body input[type="file"] { font-size: 0.9rem; }

/* Kruhový cropper */
.cropper { margin: 12px 0 4px; max-width: 300px; }
.cropper[hidden] { display: none; }
.cropper-view {
  position: relative;
  width: 240px; height: 240px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 1px #d8d1c5;
}
.cropper-view:active { cursor: grabbing; }
.cropper-view img {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  max-width: none;
}
.cropper-zoom {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 0; max-width: 240px;
  font-family: var(--mono); font-size: 0.78rem; color: #4a463d;
}
.cropper-zoom input { flex: 1; }
.cropper-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.cropper-actions #cropperCancel {
  border: 0; background: none; color: #6f6a5f;
  font-family: var(--sans); font-size: 0.9rem; cursor: pointer;
}

/* Mriežka fotiek */
.admin-photo-grid {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
  align-items: start;  /* karty sa neťahajú na výšku najvyššej v riadku */
}
.admin-photo { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2dccf; }
.admin-photo.is-cover { border-color: #6f7355; box-shadow: 0 0 0 1px #6f7355; }
.admin-photo.is-hidden { opacity: 0.5; }
/* Náhľad = celá fotka v skutočných proporciách (na výšku/šírku), bez orezu. */
.admin-photo-thumb { position: relative; background: #e7e1d4; }
.admin-photo-thumb img { width: 100%; height: auto; display: block; }
.admin-photo-noimg {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; color: #8a857a; font-size: 0.82rem;
}
.admin-photo-tag {
  position: absolute; top: 6px; left: 6px;
  background: #6f7355; color: #fff;
  font-family: var(--mono); font-size: 0.66rem; padding: 2px 7px; border-radius: 5px;
}
.admin-photo-tag.hidden-tag { left: auto; right: 6px; background: #9b3f2f; }
.admin-photo-info { padding: 7px 9px; font-size: 0.8rem; color: #6f6a5f; }
.admin-photo-info a { color: #6f6a5f; }
.admin-photo-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 9px 9px; }
.admin-photo-actions button {
  min-height: 32px; padding: 5px 9px;
  border: 0; border-radius: 7px;
  background: #ece7dc; color: #1b1913;
  font-size: 0.78rem; cursor: pointer;
}
.admin-photo-actions button.danger { background: #9b3f2f; color: #fff; }

/* Zaškrtávadlo v rohu náhľadu (hromadný výber) */
.admin-photo-check {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid #d7d0c1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.admin-photo-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: #6f7355; }
.admin-photo:has(.admin-photo-check input:checked) {
  border-color: #6f7355; box-shadow: 0 0 0 2px #6f7355;
}
.admin-photo-author {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem;
  color: #1b1913; background: #ece7dc; padding: 1px 7px; border-radius: 5px; margin-right: 6px;
}

/* Lišta hromadného presunu autora */
.reassign-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 16px 0 0; padding: 10px 12px;
  background: #fff; border: 1px solid #e2dccf; border-radius: 12px;
  font-size: 0.82rem;
}
.reassign-bar .reassign-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.reassign-bar .reassign-all input { width: 16px; height: 16px; accent-color: #6f7355; }
.reassign-count { color: #6f6a5f; font-family: var(--mono); font-size: 0.76rem; }
.reassign-spacer { flex: 1 1 auto; }
.reassign-bar select {
  min-height: 34px; padding: 4px 8px; border: 1px solid #d7d0c1;
  border-radius: 8px; background: #fbf9f4; font-size: 0.82rem;
}
.reassign-bar .btn { padding: 7px 14px; }

/* Priebeh nahrávania */
.upload-progress {
  margin-top: 18px; padding: 16px;
  background: #fff; border: 1px solid #e2dccf; border-radius: 12px;
}
.upload-progress[hidden] { display: none; }
.up-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.up-title { font-family: var(--mono); font-weight: 500; }
.up-count { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; color: #1b1913; }
.up-bar-track {
  height: 10px; margin: 12px 0 8px;
  background: #ece7dc; border-radius: 6px; overflow: hidden;
}
.up-bar { height: 100%; width: 0; background: #6f7355; border-radius: 6px; transition: width 0.2s ease; }
.up-status { margin: 0; color: #6f6a5f; font-size: 0.85rem; }
.up-errors { margin: 10px 0 0; padding-left: 18px; color: #9b3f2f; font-size: 0.82rem; }
.up-errors:empty { display: none; }
.upload-progress .btn { margin-top: 12px; }

/* Živé náhľady nahrávaných fotiek */
.up-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px; margin: 12px 0 0;
}
.up-thumbs:empty { display: none; }
.up-thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden;
  background: #ece7dc; opacity: 0.4; transition: opacity 0.25s ease, box-shadow 0.2s ease;
}
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-thumb.is-active { opacity: 0.8; box-shadow: 0 0 0 2px #6f7355; }
.up-thumb.is-done { opacity: 1; }
.up-thumb.is-error { opacity: 1; box-shadow: 0 0 0 2px #9b3f2f; }
.up-thumb .tick {
  position: absolute; right: 4px; bottom: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #6f7355; color: #fff;
  font-size: 12px; line-height: 18px; text-align: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.up-thumb.is-done .tick, .up-thumb.is-error .tick { opacity: 1; }
.up-thumb .tick.err { background: #9b3f2f; }

/* Prihlásenie */
.admin-login { max-width: 360px; margin: 12vh auto 0; }
.admin-login h1 {
  font-family: var(--mono); font-weight: 500; font-size: 1.6rem;
  letter-spacing: -0.02em; margin: 0 0 16px;
}
.admin-login form { display: grid; gap: 10px; }
.admin-login label { font-family: var(--mono); font-size: 0.82rem; color: #4a463d; }
.admin-login input {
  padding: 11px 13px; border: 1px solid #d8d1c5; border-radius: 10px;
  font-size: 1rem; font-family: var(--sans); background: #fff;
}
.admin-login button {
  min-height: 46px; margin-top: 4px; border: 0; border-radius: 10px;
  background: #6f7355; color: #fff; font-family: var(--sans);
  font-size: 1rem; font-weight: 500; cursor: pointer;
}
.admin-login button:hover { background: #5f6349; }

/* Prehľad — štatistiky */
.admin-stats {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0;
  list-style: none; padding: 0;
}
.admin-stats > div {
  flex: 1; min-width: 130px;
  background: #fff; border: 1px solid #e2dccf; border-radius: 12px; padding: 16px 18px;
}
.admin-stats dt {
  color: #6f6a5f; font-family: var(--mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.admin-stats dd { margin: 6px 0 0; font-family: var(--mono); font-size: 1.8rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
