/* ============================================================
   BYD | Denza Showroom — Moris Slovakia
   ============================================================ */

:root {
  --bg:        #0c0e11;
  --bg-2:      #12151a;
  --surface:   #181c22;
  --surface-2: #20252d;
  --line:      #2a3038;
  --line-soft: #232830;
  --text:      #f3f5f7;
  --text-dim:  #aab2bd;
  --text-mut:  #6f7884;
  --accent:    #c8a45a;   /* teplé zlaté svetlo z vizualizácií */
  --accent-2:  #e2c887;
  --accent-soft: rgba(200,164,90,.14);
  --blue:      #2f6fed;    /* BYD modrá (sekundárny akcent) */
  --danger:    #e0564f;
  --ok:        #4bb37a;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 18px 50px -12px rgba(0,0,0,.6);
  --shadow-sm: 0 6px 20px -6px rgba(0,0,0,.5);
  --maxw:      1280px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 14px;
}
h1, h2, h3 { line-height: 1.15; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--text-dim); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}
/* jemný gradient pre čitateľnosť log pri vrchu (nad svetlou fotkou) */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,10,13,.5), transparent);
  transition: opacity .3s ease;
}
.site-header.scrolled {
  background: rgba(12,14,17,.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.site-header.scrolled::before { opacity: 0; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo-slot { height: 34px; display: flex; align-items: center; gap: 13px; }
.brand .logo-byd { height: 17px; width: auto; }
.brand .logo-denza-emblem { height: 27px; width: auto; }
.brand .denza-word {
  font-weight: 600; letter-spacing: .26em; font-size: 1.04rem; color: var(--text);
  padding-right: .1em;
}
.brand .brand-div { width: 1px; height: 24px; background: var(--line); }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-right .moris-lbl {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mut);
}
.header-right img.moris-img { height: 30px; width: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero .hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero .hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero .hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,14,17,.45) 0%, rgba(12,14,17,.2) 35%, rgba(12,14,17,.92) 100%);
}
.hero .hero-inner { position: relative; z-index: 1; padding-bottom: 64px; width: 100%; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 700;
  letter-spacing: -.02em; margin: 6px 0 0;
}
.hero h1 .accent { color: var(--accent); }
.hero .sub {
  font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-dim);
  margin: 18px 0 0; max-width: 620px;
}
.hero .hero-meta {
  display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 34px;
}
.hero .hero-meta .item .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-mut); }
.hero .hero-meta .item .v { font-size: 1.35rem; font-weight: 600; margin-top: 3px; }
.scroll-cue {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: .85rem; letter-spacing: .04em;
}
.scroll-cue .dot {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }

/* ---------- Sections ---------- */
section.block { padding: 84px 0; }
section.block.tight { padding: 60px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.section-head p { color: var(--text-dim); margin: 16px 0 0; font-size: 1.05rem; }

/* ---------- Stats / legend ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
}
.stats-grid .stat { background: var(--surface); padding: 26px 22px; }
.stats-grid .stat .v { font-size: 1.9rem; font-weight: 700; color: var(--text); }
.stats-grid .stat .v small { color: var(--accent); font-size: 1rem; font-weight: 600; }
.stats-grid .stat .k { color: var(--text-dim); font-size: .9rem; margin-top: 4px; }

.legend-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.legend-table th, .legend-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.legend-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-mut); font-weight: 600; }
.legend-table td.code { color: var(--accent); font-weight: 600; width: 70px; font-variant-numeric: tabular-nums; }
.legend-table td.area { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-table tr.is-active td { background: var(--accent-soft); }
.legend-table tr.total td { font-weight: 700; color: var(--text); border-bottom: none; }
.legend-table tr[data-hs] { cursor: pointer; }

/* ============================================================
   Interaktívny pôdorys
   ============================================================ */
.plan-section { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.plan-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 26px;
}
.mode-switch {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; gap: 2px;
}
.mode-switch button {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 9px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  letter-spacing: .01em; transition: .18s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.mode-switch button .ic { width: 16px; height: 16px; opacity: .8; }
.mode-switch button:hover { color: var(--text); }
.mode-switch button.active { background: var(--accent); color: #20180a; }
.mode-switch button.active .ic { opacity: 1; }
.plan-hint { color: var(--text-mut); font-size: .88rem; display: flex; align-items: center; gap: 8px; }

.plan-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }

.plan-stage {
  position: relative; background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
  line-height: 0;
}
.plan-stage img.plan-img { width: 100%; height: auto; }

/* Hotspot pin */
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 34px; height: 34px; z-index: 5;
  display: grid; place-items: center; cursor: pointer;
  border: none; background: transparent; padding: 0;
}
.hotspot .pin {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #20180a;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  box-shadow: 0 0 0 4px rgba(200,164,90,.28), 0 4px 12px rgba(0,0,0,.45);
  transition: transform .16s ease, box-shadow .16s ease;
  font-variant-numeric: tabular-nums;
}
.hotspot::before {
  content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); opacity: .55; z-index: -1;
  animation: ping 2.4s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0%{ transform: scale(1); opacity:.5;} 70%,100%{ transform: scale(2.6); opacity:0;} }
.hotspot:hover .pin, .hotspot.active .pin { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(200,164,90,.32), 0 6px 16px rgba(0,0,0,.5); }
.hotspot.empty .pin { background: #8b94a0; color: #fff; box-shadow: 0 0 0 4px rgba(139,148,160,.22), 0 4px 12px rgba(0,0,0,.4); }
.hotspot.empty::before { background: #8b94a0; opacity: .3; animation: none; }

/* Náhľadové (thumbnail) piny */
.hotspot.thumb { width: 54px; height: 54px; }
.pin.thumb {
  width: 48px; height: 48px; padding: 0; overflow: visible; background: #20252d;
  box-shadow: 0 0 0 3px var(--accent), 0 5px 16px rgba(0,0,0,.55);
}
.pin.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.pin.thumb .pl {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.26); border-radius: 50%;
}
.pin.thumb .pl svg { width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.pin.thumb .num {
  position: absolute; bottom: -3px; right: -3px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--accent); color: #20180a;
  font-size: .62rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg-2); z-index: 2;
}
.pin.thumb .num.center {
  position: static; inset: auto; width: auto; height: auto;
  background: transparent; box-shadow: none; color: #c2cad4; font-size: .85rem;
}
.pin.thumb.empty { display: grid; place-items: center; background: #262b33; box-shadow: 0 0 0 3px #8b94a0, 0 5px 16px rgba(0,0,0,.5); }
.hotspot.thumb::before { width: 48px; height: 48px; }
.hotspot.thumb.empty::before { display: none; }
.hotspot.thumb:hover .pin.thumb, .hotspot.thumb.active .pin.thumb {
  transform: scale(1.1); box-shadow: 0 0 0 3px var(--accent-2), 0 8px 22px rgba(0,0,0,.6);
}

/* Plávajúci náhľad pri hoveri */
.hs-preview {
  position: absolute; z-index: 30; width: 280px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overflow: hidden; opacity: 0; transform: translateY(6px);
  transition: opacity .14s ease, transform .14s ease; line-height: 1.5;
}
.hs-preview.show { opacity: 1; transform: translateY(0); }
.hs-preview .media { aspect-ratio: 16/10; background: #000; position: relative; }
.hs-preview .media img { width: 100%; height: 100%; object-fit: cover; }
.hs-preview .media .play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.hs-preview .media .play span {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55);
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5);
}
.hs-preview .body { padding: 12px 14px; }
.hs-preview .body .t { font-weight: 600; font-size: .98rem; }
.hs-preview .body .r { color: var(--accent); font-size: .76rem; font-weight: 600; letter-spacing: .04em; }
.hs-preview .body .cnt { color: var(--text-mut); font-size: .8rem; margin-top: 6px; display: flex; gap: 12px; }
.hs-preview .body .cnt span { display: inline-flex; align-items: center; gap: 5px; }

/* Bočný panel pôdorysu */
.plan-side .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: sticky; top: 88px;
}
.plan-side h3 { font-size: 1rem; margin-bottom: 4px; }
.plan-side .panel > p { color: var(--text-dim); font-size: .86rem; margin: 0 0 16px; }
.hs-list { display: flex; flex-direction: column; gap: 2px; }
.hs-list .row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  cursor: pointer; transition: background .15s; border: 1px solid transparent;
}
.hs-list .row:hover, .hs-list .row.active { background: var(--surface-2); border-color: var(--line); }
.hs-list .row .num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-size: .72rem; font-weight: 700; display: grid; place-items: center;
}
.hs-list .row .txt { min-width: 0; }
.hs-list .row .txt .t { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-list .row .txt .m { font-size: .74rem; color: var(--text-mut); }

.legend-mini { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.legend-mini .li { display: flex; justify-content: space-between; font-size: .82rem; padding: 4px 0; color: var(--text-dim); }
.legend-mini .li b { color: var(--text); font-weight: 600; }

/* ---------- Galéria ---------- */
.gallery-tabs { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.gallery-tabs button {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-dim);
  padding: 9px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; transition: .15s;
}
.gallery-tabs button.active { background: var(--accent); color: #20180a; border-color: var(--accent); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.grid .cell {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface); cursor: pointer; border: 1px solid var(--line-soft);
}
.grid .cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.grid .cell:hover img { transform: scale(1.06); }
.grid .cell .ov {
  position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.5), transparent 55%);
  opacity: 0; transition: .2s; display: flex; align-items: flex-end; padding: 12px;
  font-size: .82rem; font-weight: 500;
}
.grid .cell:hover .ov { opacity: 1; }
.grid .cell .vbadge {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.45); display: grid; place-items: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(7,8,10,.985);
  display: none; flex-direction: column; opacity: 0; transition: opacity .2s;
}
.lightbox.open { display: flex; opacity: 1; }
.lb-top {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 22px;
  color: var(--text); flex: none;
}
.lb-top .ti { font-weight: 600; }
.lb-top .ti .r { color: var(--accent); font-size: .8rem; margin-left: 10px; }
.lb-top .count { color: var(--text-mut); font-size: .85rem; }
.lb-close { background: var(--surface); border: 1px solid var(--line); color: var(--text); width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; }
.lb-stage {
  flex: 1; position: relative; display: grid;
  grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  place-items: center; padding: 0 20px; min-height: 0;
}
.lb-media { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.lb-stage img, .lb-stage video {
  max-width: 100%; max-height: min(100%, calc(100vh - 172px));
  width: auto; height: auto; object-fit: contain;
  border-radius: 8px; background: #000;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; background: rgba(20,23,28,.8);
  border: 1px solid var(--line); color: #fff; font-size: 1.3rem; display: grid; place-items: center;
}
.lb-nav.prev { left: 18px; } .lb-nav.next { right: 18px; }
.lb-nav:hover { background: var(--accent); color: #20180a; }
.lb-thumbs { flex: none; display: flex; gap: 8px; padding: 14px 20px; overflow-x: auto; justify-content: center; }
.lb-thumbs .t {
  width: 84px; height: 56px; border-radius: 6px; overflow: hidden; flex: none; opacity: .5;
  cursor: pointer; border: 2px solid transparent; position: relative;
}
.lb-thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs .t.active { opacity: 1; border-color: var(--accent); }
.lb-empty { color: var(--text-dim); text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 48px 0; background: var(--bg-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.site-footer .f-brand { font-weight: 700; letter-spacing: .04em; }
.site-footer .f-brand .dz { color: var(--accent); }
.site-footer .muted-s { color: var(--text-mut); font-size: .85rem; }

/* ---------- Gate (prístup zamietnutý) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: grid; place-items: center; padding: 24px; text-align: center;
}
.gate .box { max-width: 420px; }
.gate .lock { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 22px; }
.gate h2 { font-size: 1.5rem; }
.gate p { color: var(--text-dim); margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 13px 22px; border-radius: 999px; box-shadow: var(--shadow); z-index: 400;
  opacity: 0; transition: .25s; font-size: .9rem; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .plan-layout { grid-template-columns: 1fr; }
  .plan-side .panel { position: static; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  section.block { padding: 56px 0; }
  .hero { min-height: 70vh; }
  .hotspot { width: 30px; height: 30px; }
  .hotspot .pin { width: 22px; height: 22px; font-size: .66rem; }
  .header-right .moris span.lbl { display: none; }
  .lb-nav { width: 44px; height: 44px; }
  .plan-toolbar { flex-direction: column; align-items: stretch; }
  .mode-switch { width: 100%; justify-content: stretch; }
  .mode-switch button { flex: 1; padding: 10px 6px; font-size: .8rem; justify-content: center; }
  .mode-switch button .ic { display: none; }
  .plan-hint { justify-content: center; }
}

/* ============================================================
   Rozcestník (landing)
   ============================================================ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  color: var(--text-dim); padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  transition: .15s; margin-right: 6px;
}
.back-link:hover { color: var(--text); border-color: var(--text-mut); }
a.brand { text-decoration: none; }

.landing { min-height: calc(100vh - 137px); display: flex; align-items: center; padding: 108px 0 60px; }
.landing-intro { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.landing-intro h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; margin-top: 6px; }
.landing-intro .lead { color: var(--text-dim); font-size: 1.12rem; margin: 20px auto 0; max-width: 600px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tile {
  position: relative; min-height: 380px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); display: flex; align-items: flex-end;
  box-shadow: var(--shadow); transition: transform .25s ease, border-color .25s ease;
  isolation: isolate;
}
.tile:hover { transform: translateY(-6px); border-color: var(--accent); }
.tile-bg { position: absolute; inset: 0; z-index: -2; }
.tile-bg img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile:hover .tile-bg img { transform: scale(1.05); }
.tile::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8,10,13,.15) 0%, rgba(8,10,13,.55) 45%, rgba(8,10,13,.95) 100%);
}
.tile-content { padding: 34px; width: 100%; }
.tile-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent);
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.tile-content h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 12px 0 10px; }
.tile-content p { color: var(--text-dim); font-size: 1rem; max-width: 90%; }
.tile-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  font-weight: 600; color: var(--text); padding: 11px 20px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); transition: .18s;
}
.tile:hover .tile-cta { background: var(--accent); color: #20180a; border-color: var(--accent); }
.tile-badge {
  position: absolute; top: 20px; right: 20px; z-index: 1;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}
.tile-badge.soon { background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(200,164,90,.4); }

.soon-hero { min-height: calc(100vh - 68px); }
.soon-hero .hero-inner { padding-bottom: 0; align-self: center; width: 100%; }
.soon-hero { align-items: center; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 300px; }
}

/* ============================================================
   Editor
   ============================================================ */
.editor-body { background: var(--bg); }
.ed-header {
  position: sticky; top: 0; z-index: 60; height: 60px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.ed-header .left { display: flex; align-items: center; gap: 14px; }
.ed-header .tag { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: 3px 9px; border-radius: 999px; }
.ed-header .right { display: flex; align-items: center; gap: 12px; }
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 9px; font-size: .88rem; font-weight: 600; transition: .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--text-mut); }
.btn.primary { background: var(--accent); color: #20180a; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(224,86,79,.4); }
.btn.danger:hover { background: rgba(224,86,79,.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; }
.dirty .dirty-dot { display: inline-block; }

.ed-layout { display: grid; grid-template-columns: 1fr 380px; gap: 0; height: calc(100vh - 60px); }
.ed-stage-wrap { overflow: auto; padding: 26px; display: grid; place-items: start center; background:
  repeating-linear-gradient(45deg, #0e1115 0 12px, #0c0e11 12px 24px); }
.ed-stage {
  position: relative; background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); width: 100%; max-width: 1100px; line-height: 0; cursor: crosshair;
}
.ed-stage img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.ed-stage .hotspot { cursor: grab; }
.ed-stage .hotspot.dragging { cursor: grabbing; z-index: 20; }
.ed-stage .hotspot.sel .pin { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--accent), 0 4px 12px rgba(0,0,0,.5); }

.ed-panel { background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; padding: 20px; }
.ed-panel h3 { font-size: .95rem; margin-bottom: 12px; }
.ed-empty-note { color: var(--text-mut); font-size: .88rem; padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mut); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: .92rem; font-family: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 56px; }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ed-tabs { display: flex; gap: 4px; margin: 16px 0 12px; background: var(--surface); padding: 4px; border-radius: 10px; }
.ed-tabs button { flex: 1; border: 0; background: transparent; color: var(--text-dim); padding: 8px; border-radius: 7px; font-size: .82rem; font-weight: 600; }
.ed-tabs button.active { background: var(--accent); color: #20180a; }

.assigned { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.assigned .tile { position: relative; aspect-ratio: 4/3; min-width: 0; min-height: 0; border-radius: 7px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.assigned .tile img { width: 100%; height: 100%; object-fit: cover; }
.assigned .tile img, .lib-grid .it img { -webkit-user-drag: none; user-select: none; }
.assigned .tile .x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; border: 0; font-size: .8rem; display: grid; place-items: center; cursor: pointer;
}
.assigned .tile .x:hover { background: var(--danger); }
.assigned .tile .mv { position: absolute; bottom: 3px; right: 3px; display: flex; gap: 3px; }
.assigned .tile .mv button {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff;
  border: 0; font-size: 1rem; line-height: 1; display: grid; place-items: center; cursor: pointer;
}
.assigned .tile .mv button:hover { background: var(--accent); color: #20180a; }
.assigned .tile .vb { position: absolute; bottom: 3px; left: 3px; background: rgba(0,0,0,.7); border-radius: 4px; padding: 1px 4px; }
.assigned .empty-tiles { grid-column: 1/-1; color: var(--text-mut); font-size: .82rem; text-align: center; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; }

.ed-hslist { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.ed-hslist .r { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.ed-hslist .r:hover { background: var(--surface); }
.ed-hslist .r.sel { background: var(--surface); border-color: var(--accent); }
.ed-hslist .r .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 700; display: grid; place-items: center; flex: none; }
.ed-hslist .r .t { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Knižnica médií (modal) */
.lib-modal { position: fixed; inset: 0; z-index: 120; background: rgba(7,8,10,.7); display: none; align-items: center; justify-content: center; padding: 24px; }
.lib-modal.open { display: flex; }
.lib-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; width: min(900px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.lib-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.lib-cats { display: flex; gap: 6px; padding: 14px 20px 0; flex-wrap: wrap; }
.lib-cats button { background: var(--surface); border: 1px solid var(--line); color: var(--text-dim); padding: 7px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.lib-cats button.active { background: var(--accent); color: #20180a; }
.lib-grid { overflow-y: auto; padding: 16px 20px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; }
.lib-grid .it { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid var(--line); }
.lib-grid .it img { width: 100%; height: 100%; object-fit: cover; }
.lib-grid .it:hover { border-color: var(--accent); }
.lib-grid .it.added::after { content: "✓ pridané"; position: absolute; inset: 0; background: rgba(200,164,90,.85); color: #20180a; display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.lib-grid .it .vb { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,.7); border-radius: 4px; padding: 1px 5px; }

@media (max-width: 760px) {
  .ed-layout { grid-template-columns: 1fr; height: auto; }
  .ed-panel { border-left: 0; border-top: 1px solid var(--line); }
}

/* utility */
.hidden { display: none !important; }
.center { text-align: center; }
.spin { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
