/* Spoločný vzhľad pre admin aj návštevníka. Farby: biela, tmavo-šedá, krvavá oranžová. */
:root {
  --bg: #ffffff; --surface: #f4f4f3; --line: #e3e3e1; --ink: #1c1c1c; --muted: #6b6b68;
  --accent: #e0401f; --accent-ink: #ffffff; --ok: #2f7d4f; --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --surface: #1e1e1e; --line: #2c2c2c; --ink: #f2f2f0; --muted: #9a9a96;
    --accent: #ff5a33; --accent-ink: #141414; --ok: #5cc78a;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #1e1e1e; --line: #2c2c2c; --ink: #f2f2f0; --muted: #9a9a96;
  --accent: #ff5a33; --accent-ink: #141414; --ok: #5cc78a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
main { max-width: 720px; margin: 0 auto; padding: 0 0 110px; min-width: 0; }
@media (min-width: 900px) { main.wide { max-width: 1040px; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(12px, env(safe-area-inset-top, 0px)) 0 8px; max-width: 1040px; margin: 0 auto; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -0.2px; }
.brand b { color: var(--accent); }
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

h1 { font-size: 26px; line-height: 1.15; margin: 14px 0 6px; letter-spacing: -0.5px; }
h2 { font-size: 18px; margin: 22px 0 10px; letter-spacing: -0.2px; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: inherit; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; padding: 0 6px; }
.btn.danger { color: var(--accent); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip.off { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.search, .field input, .field textarea, .field select { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .flabel { font-size: 14px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.field textarea { min-height: 88px; resize: vertical; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle { flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; border: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

/* mriežka modeliek */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { main.wide .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.model { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; padding: 0; }
.model .ph { aspect-ratio: 3 / 4; background: linear-gradient(160deg, var(--line), var(--surface)); position: relative; }
.model .ph img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
.model .ph .tag { position: absolute; left: 10px; bottom: 10px; }
.model .meta { padding: 10px 12px 12px; }
.model .name { font-weight: 600; }
.model .sub { font-size: 13px; color: var(--muted); }
.model.hidden-m .ph img { opacity: .4; }
.model .check { position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 10px; border: 2px solid #fff; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 2; cursor: pointer; padding: 0; }
.model.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.model.selected .check { background: var(--accent); border-color: var(--accent); }
.model.selected .check::after { content: "✓"; color: #fff; font-size: 16px; font-weight: 700; }
.model .heart { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
.model .heart.on { background: var(--accent); }
.tag { font-size: 12px; background: rgba(0,0,0,.5); color: #fff; padding: 3px 8px; border-radius: 999px; }

/* spodné lišty */
.bulkbar { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); margin: 0 auto; max-width: 680px; padding: 6px 6px 6px 14px; font-size: 14px; white-space: nowrap; border-radius: 16px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 20; overflow-x: auto; }
.bulkbar .acts { display: flex; gap: 0; }
.bulkbar .cnt { min-width: 28px; height: 28px; border-radius: 999px; background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; padding: 0 8px; }
@media (max-width: 360px) { .bulkbar button { padding: 0 7px; } }
.bulkbar button { border: 0; background: transparent; color: inherit; padding: 0 9px; min-height: 44px; font-size: 14px; cursor: pointer; font-weight: 600; border-radius: 10px; }
.bulkbar button.hot { background: var(--accent); color: var(--accent-ink); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b)); z-index: 10; }
.tabbar a { flex: 1; max-width: 160px; text-align: center; text-decoration: none; padding: 6px 4px; color: var(--muted); font-size: 12px; border-radius: 10px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tabbar a .i { font-size: 20px; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* nahrávanie */
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 26px 18px; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--accent); }
.queue { list-style: none; padding: 0; margin: 14px 0 0; }
.queue li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.queue .fn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.queue img, .queue .vthumb { width: 44px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s ease; }
.bar.done > span { background: var(--ok); }

/* médiá v úprave modelky */
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .mgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.mitem { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); aspect-ratio: 3 / 4; }
.mitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mitem .vid { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--ink); border: 0; background: var(--line); cursor: pointer; padding: 0; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox video { max-width: 100%; max-height: 100%; border-radius: 10px; background: #000; }
.lightbox .lb-x { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; }
.mitem .cover { position: absolute; top: 6px; left: 6px; }
.mitem .tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.mitem .tools button { border: 0; background: rgba(255,255,255,.85); color: #1c1c1c; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; padding: 0; }

/* PIN */
.pin { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.pin span { width: 52px; height: 60px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.pin span.on { border-color: var(--accent); }
.pin.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 320px; margin: 0 auto; }
.keys button { min-height: 64px; border-radius: 16px; border: 0; background: var(--surface); font-size: 22px; font-weight: 600; cursor: pointer; }
.keys button.go { background: var(--accent); color: var(--accent-ink); }

/* galéria v detaile */
.hero { border-radius: 18px; overflow: hidden; position: relative; aspect-ratio: 4 / 5; background: var(--surface); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; -webkit-user-drag: none; pointer-events: none; }
@media (min-width: 720px) { .hero { aspect-ratio: 3 / 4; max-height: 78vh; margin: 0 auto; } }
.watermark { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.watermark span { transform: rotate(-28deg); font-size: clamp(22px, 7vw, 40px); font-weight: 700; letter-spacing: 4px; color: rgba(255,255,255,.28); text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.08); }
.gal-count { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.5); color: #fff; padding: 4px 10px; border-radius: 999px; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.8); color: #1c1c1c; font-size: 22px; line-height: 1; cursor: pointer; display: none; }
.gal-nav.prev { left: 10px; } .gal-nav.next { right: 10px; }
@media (hover: hover) { .hero:hover .gal-nav { display: block; } }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.thumbs button { aspect-ratio: 3 / 4; border-radius: 10px; border: 0; padding: 0; cursor: pointer; overflow: hidden; opacity: .55; outline: 2px solid transparent; outline-offset: -2px; background: var(--surface); }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; pointer-events: none; }
.thumbs button[aria-selected="true"] { opacity: 1; outline-color: var(--accent); }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.specs div { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.specs small { display: block; color: var(--muted); font-size: 12px; }
.specs b { font-size: 15px; }
video { width: 100%; border-radius: 14px; background: #000; margin-top: 10px; }

/* ponuky */
.olist { display: grid; gap: 10px; }
.oitem { display: block; text-decoration: none; color: inherit; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.oitem .t { font-weight: 600; }
.stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.qr { width: 200px; height: 200px; margin: 0 auto; display: block; background: #fff; border-radius: 12px; padding: 8px; }
.link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface); padding: 12px; border-radius: 12px; word-break: break-all; }
.picker { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.picker label { display: grid; grid-template-columns: 24px 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker label:last-child { border-bottom: 0; }
.picker img, .picker .noimg { width: 40px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--line); }
.picker input { width: 20px; height: 20px; accent-color: var(--accent); }
.events { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.events li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }

/* hlavička stránky s tlačidlom (Modelky + Nová, Ponuky + Nová ponuka) */
.head { margin-bottom: 14px; }
.head h1 { margin-bottom: 0; }

/* filtre krajina / mesto / typ */
/* filtre: ikona → panel s poľami na písanie aj výber */
.iconbtn { position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.iconbtn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.iconbtn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.searchrow { display: flex; gap: 8px; align-items: center; }
.searchrow .search { flex: 1; min-width: 0; }
.searchrow .iconbtn { width: 48px; height: 48px; }
.fpanel { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0 0 12px; padding: 12px; border-radius: var(--radius); background: var(--surface); }
@media (min-width: 560px) { .fpanel { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.fpanel > .btn { justify-self: start; color: var(--accent); }
.combo { position: relative; display: block; }
.combo-l { position: absolute; left: 12px; top: 6px; font-size: 11px; color: var(--muted); pointer-events: none; }
.combo input { width: 100%; min-height: 50px; padding: 18px 36px 4px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.combo input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.combo-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.combo-list li { padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--surface); }
.combo-list li.cur { font-weight: 700; color: var(--accent); }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.filters select { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; min-width: 0; font-size: 14px; }

/* spodné tlačidlo návštevníka (Odoslať výber / Pridať do výberu) */
.sendbar { position: fixed; left: 16px; right: 16px; bottom: calc(12px + var(--safe-b)); max-width: 688px; margin: 18px auto 0; z-index: 15; }
.sendbar .btn { box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.picklist { list-style: none; padding: 0; margin: 0; }
.picklist li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.picklist img { width: 48px; height: 64px; object-fit: cover; border-radius: 8px; }

/* video v galérii */
.hero video { width: 100%; height: 100%; object-fit: contain; background: #000; margin: 0; border-radius: 0; display: block; }
.thumbs button.is-video { position: relative; }
.thumbs button.is-video::after { content: "▶"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; background: rgba(0,0,0,.35); }

/* poradie fotiek potiahnutím */
.mitem .handle { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 9px; border: 0; background: rgba(255,255,255,.9); color: #1c1c1c; font-size: 18px; cursor: grab; touch-action: none; padding: 0; z-index: 2; }
.mitem.dragging { opacity: .35; }
.mitem.ghost { position: fixed; pointer-events: none; z-index: 60; opacity: .92; box-shadow: 0 12px 30px rgba(0,0,0,.3); transform: scale(1.05); }
.mitem.target { outline: 3px solid var(--accent); outline-offset: -3px; }
.sub { background: var(--bg); border-radius: 12px; padding: 12px; margin: 8px 0; border: 1px solid var(--line); }
.sub.new { border-color: var(--accent); }
.upbadge { position: fixed; right: 12px; bottom: calc(76px + var(--safe-b)); z-index: 21; }

.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.center { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }

/* vlastné potvrdzovacie okno (namiesto confirm) */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center; padding: 12px 12px calc(12px + var(--safe-b)); transition: background .16s; }
.modal.show { background: rgba(0,0,0,.45); }
.modal-box { width: 100%; max-width: 420px; background: var(--bg); color: var(--ink); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); transform: translateY(24px); opacity: 0; transition: transform .16s, opacity .16s; }
.modal.show .modal-box { transform: none; opacity: 1; }
.modal-t { margin: 0 0 18px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.modal-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.danger-solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (min-width: 600px) { .modal { align-items: center; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-box { transition: none; } }

.pinrow { display: flex; gap: 8px; }
.pinrow input { flex: 1; min-width: 0; letter-spacing: 6px; font-size: 18px; font-variant-numeric: tabular-nums; }
.pinrow .btn { flex: none; width: 52px; padding: 0; }
.pinshow { margin: 12px 0 0; font-size: 15px; }
.pinshow b { letter-spacing: 3px; font-size: 18px; }

.loginart { display: block; width: min(150px, 42vw); height: auto; margin: 4px auto 8px; color: var(--ink); }
.loginqr { margin: 28px auto 0; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.loginqr img { display: block; margin: 0 auto 8px; width: 120px; height: 120px; border-radius: 10px; background: #fff; }
.addrow { display: flex; gap: 8px; margin-top: 10px; }
.addrow input { flex: 1; min-width: 0; }
.addrow .btn { flex: none; }
