/* Administrácia – nadväzuje na styles.css */
.adm { background: var(--bg); }
.adm .field input[type="date"] { padding-top: 24px; min-height: 58px; }
.adm .field--date label { transform: translateY(-9px) scale(.78); color: var(--accent-dk); }
.linkbtn { background: none; border: 0; padding: 4px 0; font: 600 .95rem var(--font); color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.linkbtn:hover { color: var(--ink); text-decoration-color: var(--accent); }
.linkbtn--danger:hover { color: #b3261e; text-decoration-color: #b3261e; }
.muted { color: var(--muted); }
.count { color: var(--muted); font-weight: 400; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* Prihlásenie */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 40%, #fff, var(--bg)); }
.login__card { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 36px 32px 30px; box-shadow: 0 40px 80px -40px rgba(14,22,32,.35); animation: rise .8s var(--ease) both; }
.login__card .logo { margin-bottom: 28px; }
.login__card h1 { font-size: 1.8rem; font-weight: 400; font-variation-settings: "wdth" 108; }
.login__lead { color: var(--muted); margin: 8px 0 24px; }

/* Horná lišta */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(243,244,245,.97); border-bottom: 1px solid var(--line); }
.bar__in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); height: 68px; display: flex; align-items: center; gap: 28px; }
.tabs { display: flex; gap: 4px; background: #e6e9ec; padding: 4px; border-radius: 999px; }
.tabs button { border: 0; background: none; font: 600 .95rem var(--font); padding: 8px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-2); transition: background-color .25s, color .25s, box-shadow .25s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14,22,32,.12); }
.bar__end { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: .95rem; }
.bar__end a { font-weight: 600; color: var(--ink-2); text-decoration: none; }
.bar__end a:hover { color: var(--accent-dk); }

.adm__main { padding-top: 40px; padding-bottom: 80px; }
.adm__head { margin-bottom: 24px; }
.adm__head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 300; font-variation-settings: "wdth" 110; letter-spacing: -0.03em; }
.adm__head p { color: var(--muted); margin-top: 6px; }
.box { background: var(--surface); border-radius: 18px; padding: clamp(20px, 3vw, 32px); margin-bottom: 20px; border: 1px solid var(--line); }
.box h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 18px; letter-spacing: -0.01em; }
.grid2 { display: grid; grid-template-columns: 1fr 220px; gap: 0 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

/* Nahrávanie */
.drop { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 42px 20px; border: 1.5px dashed #c8cfd5; border-radius: 14px; background: var(--bg); cursor: pointer; transition: border-color .25s, background-color .25s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-lt); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.drop__icon::before, .drop__icon::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink); }
.drop__icon::before { width: 16px; height: 1.5px; margin: -.75px 0 0 -8px; }
.drop__icon::after { width: 1.5px; height: 16px; margin: -8px 0 0 -.75px; }
.drop__t { font-weight: 600; }
.drop__t u { text-decoration-color: var(--accent); text-underline-offset: 4px; }
.drop__s { color: var(--muted); font-size: .9rem; }

.queue { margin-top: 20px; }
.queue__bar { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.queue__actions { display: flex; gap: 10px; }
.sel { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.adm select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.queue__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qitem { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); animation: rise .45s var(--ease) both; transition: opacity .3s; }
.qitem img { width: 72px; height: 56px; object-fit: cover; border-radius: 8px; }
.qitem__fields { display: grid; grid-template-columns: 1fr 170px; gap: 8px; }
.qitem__cap { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); min-width: 0; }
.qitem__cap:focus, .adm select:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--glow); }
.qitem__state { font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.qitem--busy .qitem__state { color: var(--accent-dk); }
.qitem--done { opacity: .6; }
.qitem--done .qitem__state { color: #2e7d4f; }
.qitem--err .qitem__state { color: #b3261e; white-space: normal; max-width: 220px; }
.qitem__x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--muted); }
.qitem__x:hover { color: #b3261e; }

/* Fotky na webe */
.photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg); transition: opacity .3s; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo__meta { padding: 10px 12px 12px; display: grid; gap: 6px; font-size: .9rem; }
.photo__cap { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo__cap em { color: var(--muted); }
.tag { justify-self: start; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-lt); color: var(--accent-dk); }
.photo__del { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 999px; padding: 6px 12px; background: rgba(255,255,255,.92); font: 600 .82rem var(--font); cursor: pointer; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s, color .2s; }
.photo:hover .photo__del, .photo__del:focus-visible { opacity: 1; transform: none; }
.photo__del:hover { color: #b3261e; }
.is-busy { opacity: .4; pointer-events: none; }
@media (hover: none) { .photo__del { opacity: 1; transform: none; } }

/* Novinky */
.nimg { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.nimg__prev { display: flex; align-items: center; gap: 14px; }
.nimg__prev img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; }
.nimg__pick { cursor: pointer; }
.nlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nitem { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg); transition: opacity .3s; }
.nitem img, .nitem__noimg { width: 96px; height: 68px; object-fit: cover; border-radius: 8px; background: #e3e6e9; display: block; }
.nitem__body { display: grid; gap: 2px; min-width: 0; }
.nitem time { font-size: .82rem; color: var(--accent-dk); font-weight: 600; }
.nitem p { margin: 0; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nitem__act { display: flex; gap: 16px; }

/* Hlášky */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: .95rem; box-shadow: 0 16px 40px -16px rgba(14,22,32,.5); animation: rise .4s var(--ease) both; transition: opacity .4s, transform .4s; }
.toast--err { background: #b3261e; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

@media (max-width: 760px) {
  .bar__in { gap: 14px; }
  .bar .logo__img { height: 24px; }
  .bar__end a { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .qitem { grid-template-columns: 60px 1fr auto; }
  .qitem img { width: 60px; height: 48px; }
  .qitem__fields { grid-template-columns: 1fr; }
  .qitem__state { grid-column: 2; }
  .nitem { grid-template-columns: 72px 1fr; }
  .nitem img, .nitem__noimg { width: 72px; height: 56px; }
  .nitem__act { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Galéria – karty s úpravou */
.photo { display: flex; flex-direction: column; }
.photo__img { position: relative; }
.badge { position: absolute; left: 8px; top: 8px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(14,22,32,.78); color: #fff; }
.badge--new { background: var(--accent); }
.photo__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 12px 12px; margin-top: auto; }
.photo__actions .linkbtn { font-size: .86rem; }
.photo__edit { display: grid; gap: 8px; padding: 0 12px 12px; }
.photo__edit input, .photo__edit select { font: inherit; font-size: .92rem; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface); min-width: 0; width: 100%; }
.photo__btns { display: flex; align-items: center; gap: 12px; }
.photo.is-editing .photo__actions, .photo.is-editing .photo__meta { display: none; }
.photo--restore { justify-content: center; align-items: center; text-align: center; padding: 20px; border: 1px dashed var(--line); background: var(--surface); }
.photo--restore p { margin: 0 0 6px; color: var(--muted); font-size: .92rem; }
.photo__del { display: none; }

/* Fotky na webe */
@media (max-width: 760px) { .tabs button { padding: 8px 12px; font-size: .88rem; } }

/* Úprava fotky – širšia karta, väčšie pole na popis, AI */
.photo.is-editing { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(240px, 420px) 1fr; gap: 0 22px; align-items: start; padding: 12px; background: var(--surface); box-shadow: 0 0 0 2px var(--accent) inset; }
.photo.is-editing .photo__img img { border-radius: 10px; }
.photo.is-editing .photo__edit { padding: 0; gap: 12px; }
.photo__lbl { display: grid; gap: 5px; font-size: .86rem; color: var(--muted); }
.photo__edit textarea { font: inherit; font-size: 1rem; line-height: 1.45; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: var(--surface); width: 100%; min-height: 92px; resize: vertical; }
.photo__edit textarea:focus, .qitem__cap:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--glow); }
.photo__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.photo__len { font-size: .8rem; color: var(--muted); }
.aibtn { font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent-dk); background: var(--accent-lt); border: 1px solid rgba(179,128,0,.35); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: background .2s; justify-self: start; }
.aibtn:hover { background: #ffe9a0; }
.aibtn:disabled { opacity: .65; cursor: progress; }
.capbox { display: grid; gap: 6px; min-width: 0; }
.qitem__cap { resize: vertical; min-height: 64px; line-height: 1.4; width: 100%; }
.qitem { align-items: start; }
@media (max-width: 700px) { .photo.is-editing { grid-template-columns: 1fr; gap: 12px; } }
.qitem__fields { align-items: start; } .qitem__cat { align-self: start; }

.iconbtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .95rem; color: var(--ink-2); }
.iconbtn:disabled { opacity: .35; cursor: default; }

.setup { margin: 0 0 22px; padding: 14px 18px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3c98b; color: #6b4300; font-size: .95rem; display: grid; gap: 6px; }
.setup p { margin: 0; }

/* ---------- Upraviť web (vizuálny editor) ---------- */
.editor__head { display: flex; justify-content: space-between; align-items: end; gap: 20px 32px; flex-wrap: wrap; margin-bottom: 16px; }
.editor__head h1 { margin-bottom: 6px; }
.editor__head p { max-width: 72ch; margin: 0; }
.editor__tools { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: none; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.editor__stage { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #dfe3e7; height: calc(100vh - 100px); min-height: 420px; }
.editor__stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; margin: 0 auto; transition: width .3s; }
.editor__stage.is-mobile iframe { width: 390px; max-width: 100%; border-inline: 1px solid var(--line); }

/* Reklama: formulár vľavo, náhľad vpravo (lepí sa pri posúvaní) */
.ads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.ads__form .box { margin-bottom: 16px; }
.ads__preview { position: sticky; top: 96px; display: grid; gap: 14px; }
.ads__preview canvas { width: 100%; max-height: calc(100dvh - 200px); object-fit: contain; border-radius: 14px; background: var(--ink); box-shadow: 0 24px 50px -30px rgba(14,22,32,.5); }
/* posúvanie fotky ťahaním – až keď je fotka vložená, inak sa na mobile dá cez náhľad normálne scrollovať */
.ads__preview canvas.has-img { cursor: grab; touch-action: none; }
.ads__preview canvas.is-drag { cursor: grabbing; }
.ads__photo { margin-top: 16px; display: grid; gap: 6px; }
.ads__photo label, .ads__label { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin: 14px 0 8px; }
.ads__photo label { margin: 0; }
.ads__photo input[type=range] { width: 100%; accent-color: var(--ink); }
.ads__photo .muted, .ads__hint { font-size: .85rem; margin: 6px 0 0; }
.ads__two { grid-template-columns: 1fr 1fr; }
.ads .seg { flex-wrap: wrap; }
.ads__tplhead { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.ads__tplhead .ads__label { margin-bottom: 0; }
.ads__tpls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-height: 560px; overflow-y: auto; padding: 2px; }
.ads__tpls button { display: block; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; transition: border-color .2s; }
.ads__tpls button:hover { border-color: var(--line); }
.ads__tpls button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.ads__tpls canvas { width: 100%; height: auto; border-radius: 6px; display: block; background: var(--ink); }
@media (max-width: 560px) { .ads__tpls { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ads__label .muted { font-weight: 400; }
.ads__tune { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.ads__tune summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.ads__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ads__chips button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font: 500 .88rem var(--font); color: var(--ink-2); cursor: pointer; }
.ads__chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ads__sw { position: relative; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(14,22,32,.2); overflow: hidden; }
.ads__sw i { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; }
.ads__pick { width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border: 0; border-radius: 18px; padding: 24px; }
.ads__pick::backdrop { background: rgba(14,22,32,.55); }
.ads__pick-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ads__pick-head h2 { font-size: 1.2rem; font-weight: 600; }
.ads__pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ads__pick-grid button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; background: var(--bg); }
.ads__pick-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.ads__pick-grid button:hover img, .ads__pick-grid button:focus-visible img { transform: scale(1.04); }
@media (max-width: 960px) {
  .ads { grid-template-columns: 1fr; }
  .ads__preview { position: static; order: -1; }
}

/* Horná lišta na mobile a tablete: logo a odhlásenie hore, záložky pod nimi na celú šírku */
@media (max-width: 900px) {
  .bar__in { height: auto; flex-wrap: wrap; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px; }
  .bar__end { order: 2; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 1 0 auto; white-space: nowrap; }
}
@media (max-width: 420px) {
  .bar .logo__img { height: 20px; width: auto; }
  .tabs { gap: 2px; padding: 3px; }
  .tabs button { flex: 1 1 auto; padding: 8px 6px; font-size: .8rem; }
}

/* Sformátovať text novinky */
.fmtbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -4px 0 18px; }
.fmtbar__hint { font-size: .85rem; }
#n-text.is-flash { animation: fmtFlash 1.2s ease; }
@keyframes fmtFlash { 0% { box-shadow: 0 0 0 4px rgba(255,196,0,.55); } 100% { box-shadow: 0 0 0 4px rgba(255,196,0,0); } }
.iconbtn--b { width: 34px; height: 34px; border-radius: 999px; font-family: Georgia, serif; font-size: 1rem; }

/* Duplikáty */
.box__head { position: relative; }
.dupes__find { margin: 12px 0 22px; }
.dupes { margin: 0 0 22px; padding: 16px; border-radius: 14px; background: #fff8e6; border: 1px solid #f1d58a; }
.dupes__head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dupes__head p { margin: 4px 0 0; font-size: .88rem; }
.dupes__acts { display: flex; align-items: center; gap: 16px; }
.dupes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.dupes__list li { display: flex; gap: 8px; overflow-x: auto; padding: 8px; background: rgba(255,255,255,.7); border-radius: 10px; }
.dupe { margin: 0; flex: none; width: 112px; }
.dupe img { width: 112px; height: 80px; object-fit: cover; border-radius: 8px; display: block; outline: 3px solid #e5484d; outline-offset: -3px; opacity: .8; }
.dupe--keep img { outline-color: #2f9e57; opacity: 1; }
.dupe figcaption { font-size: .75rem; margin-top: 4px; color: #b42318; font-weight: 600; }
.dupe--keep figcaption { color: #1f7a43; }
