/* ── Prohlížeč návrhu: tmavé prostředí návrhového nástroje ── */
:root {
  --bg: #2c2c2c;
  --bg-2: #383838;
  --bg-3: #464646;
  --line: #3d3d3d;
  --canvas: #1e1e1e;
  --tx: #ffffff;
  --tx-2: #b3b3b3;
  --tx-3: #7f7f7f;
  --ac: #0d99ff;
  --ac-2: #0a84de;
  --warn: #ffc94a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--canvas); color: var(--tx); font: 12px/1.45 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.noscroll::-webkit-scrollbar { display: none; }

/* animace z návrhu aplikace */
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes shoot { 0% { transform: translate(0, 0) rotate(-28deg); opacity: 0; } 4% { opacity: 1; } 14% { transform: translate(-260px, 140px) rotate(-28deg); opacity: 0; } 100% { opacity: 0; } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-14px, 10px) scale(1.05); } }
@keyframes fogA { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-24px, 14px) scale(1.18); } }
@keyframes fogB { 0%, 100% { transform: translate(0, 0) scale(1.15); } 50% { transform: translate(20px, -12px) scale(1.08); } }
@keyframes halo { 0%, 100% { opacity: .5; transform: scale(.92); } 50% { opacity: .95; transform: scale(1.1); } }

/* ── rozvržení ── */
.app { display: grid; grid-template-rows: 48px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.body { display: grid; grid-template-columns: 240px minmax(0, 1fr) 272px; min-height: 0; }
.body.no-panels { grid-template-columns: 0 minmax(0, 1fr) 0; }
.body.no-panels .panel { visibility: hidden; }
.center { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas); }

/* ── horní lišta ── */
.topbar { position: relative; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 48px; padding: 0 8px 0 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-right { justify-content: flex-end; gap: 6px; }
.tb-logo { width: 48px; height: 48px; display: grid; place-items: center; border-right: 1px solid var(--line); flex-shrink: 0; }
.tb-logo img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 4px rgba(243, 220, 154, .35)); }
.tb-file { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; font-size: 13px; }
.tb-file b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tb-crumb { color: var(--tx-3); }
.tb-slash { color: var(--bg-3); }
.tb-ver { padding: 1px 6px; border-radius: 4px; background: var(--bg-2); color: var(--tx-2); font-size: 11px; font-weight: 500; }
.seg { display: flex; padding: 2px; border-radius: 7px; background: #1f1f1f; }
.seg button { height: 28px; padding: 0 14px; border-radius: 5px; color: var(--tx-2); font-weight: 500; }
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--bg-3); color: var(--tx); }
.tb-status { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; color: var(--tx-2); white-space: nowrap; }
.tb-status i { width: 7px; height: 7px; border-radius: 99px; background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 201, 74, .15); }
.tb-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--tx-2); white-space: nowrap; }
.tb-btn:hover, .tb-btn.on { background: var(--bg-2); color: var(--tx); }
.tb-play { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 12px; border-radius: 6px; background: var(--ac); color: #fff; font-weight: 600; white-space: nowrap; }
.tb-play:hover { background: var(--ac-2); }
.tb-play.ghost { background: var(--bg-2); }
.tb-play.ghost:hover { background: var(--bg-3); }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px; padding: 6px; border-radius: 10px; background: #1f1f1f; box-shadow: 0 0 0 1px #000, 0 12px 32px rgba(0, 0, 0, .5); }
.menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 30px; padding: 0 10px; border-radius: 5px; color: var(--tx); text-align: left; }
.menu button:hover { background: var(--ac); }
.menu kbd { font: inherit; color: var(--tx-3); }
.menu button:hover kbd { color: rgba(255, 255, 255, .8); }
.menu hr { border: 0; height: 1px; margin: 6px 0; background: #333; }

/* ── panely ── */
.panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--bg); }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); overflow-y: auto; }
.pn-sec { padding: 12px 12px 14px; border-bottom: 1px solid var(--line); }
.pn-sec.grow { flex: 1; min-height: 0; overflow-y: auto; }
.pn-sec.last { border-bottom: 0; }
.pn-head { display: flex; align-items: center; justify-content: space-between; height: 24px; margin-bottom: 4px; padding: 0 4px; font-size: 11px; font-weight: 600; color: var(--tx); }
.pn-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border-radius: 5px; color: var(--tx-2); text-align: left; }
.pn-row:hover { background: var(--bg-2); color: var(--tx); }
.pn-row.on { background: rgba(13, 153, 255, .18); color: var(--tx); }
.pn-row .ic { width: 16px; display: grid; place-items: center; flex-shrink: 0; color: var(--tx-3); }
.pn-row.on .ic { color: var(--ac); }
.pn-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-row .ct { color: var(--tx-3); font-size: 11px; }
.pn-row.sub { padding-left: 26px; }
.pn-row .go { opacity: 0; color: var(--tx-3); }
.pn-row:hover .go { opacity: 1; }
.pn-row .go:hover { color: var(--ac); }
.pn-help { padding: 12px 16px 16px; border-top: 1px solid var(--line); color: var(--tx-3); font-size: 11px; line-height: 1.6; }
.pn-help b { color: var(--tx-2); font-weight: 500; }
.pn-title { padding: 0 4px; font-size: 13px; font-weight: 600; }
.pn-sub { padding: 2px 4px 0; color: var(--tx-3); }
.pn-text { margin: 0; padding: 0 4px; color: var(--tx-2); line-height: 1.6; }
.pn-list { margin: 0; padding: 0 4px 0 20px; color: var(--tx-2); line-height: 1.6; }
.pn-list li { margin: 2px 0; }
.pn-list li::marker { color: var(--tx-3); }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding: 0 4px; }
.prop { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 5px; background: var(--bg-2); color: var(--tx); }
.prop span { color: var(--tx-3); }
.links { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.link { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 8px; border-radius: 5px; background: #262626; color: var(--tx-2); }
.link .from { flex: 1; min-width: 0; }
.link .arrow { color: var(--ac); }
.link .to { color: var(--tx); font-weight: 500; }
.link.todo .to { color: var(--tx-3); font-weight: 400; font-style: italic; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 34px; border-radius: 6px; background: var(--ac); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--ac-2); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 0; padding: 0 4px; }
.meta dt { color: var(--tx-3); }
.meta dd { margin: 0; color: var(--tx); }
.meta .pill { display: inline-flex; align-items: center; gap: 6px; }
.meta .pill i { width: 7px; height: 7px; border-radius: 99px; background: var(--warn); }
.swatches { display: flex; flex-direction: column; gap: 2px; }
.swatch { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 4px; border-radius: 5px; }
.swatch:hover { background: var(--bg-2); }
.swatch i { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); flex-shrink: 0; }
.swatch .nm { flex: 1; color: var(--tx); }
.swatch .hx { color: var(--tx-3); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.type { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 0; }
.type div { display: flex; flex-direction: column; gap: 1px; }
.type .smp { font-family: Jost, sans-serif; color: #fff; line-height: 1.15; }
.type .lbl { color: var(--tx-3); font-size: 11px; }

/* ── plátno ── */
.canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--canvas); }
.canvas.is-panning { cursor: grabbing; }
.cv-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --iz: 1; }
.cv-world.is-moving { will-change: transform; }
.cv-frame { position: absolute; width: 380px; height: 852px; }
.cv-screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: #04061A; box-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.cv-screen * { pointer-events: none !important; }
.cv-screen * { animation-play-state: paused !important; }
.cv-frame:hover .cv-screen * { animation-play-state: running !important; }
.cv-label { position: absolute; left: 0; bottom: 100%; max-width: calc(380px / var(--iz)); padding-bottom: 6px; overflow: hidden; text-overflow: ellipsis; transform-origin: 0 100%; transform: scale(var(--iz)); white-space: nowrap; font-size: 12px; color: var(--tx-3); }
.cv-frame:hover .cv-label { color: var(--tx-2); }
.cv-frame.is-sel .cv-label { color: var(--ac); }
.cv-outline { position: absolute; inset: 0; pointer-events: none; border: calc(1.5px * var(--iz)) solid transparent; }
.cv-frame:hover .cv-outline { border-color: var(--ac); }
.cv-frame.is-sel .cv-outline { border: calc(2px * var(--iz)) solid var(--ac); }
.cv-size { position: absolute; left: 50%; top: 100%; transform-origin: 50% 0; transform: translateX(-50%) scale(var(--iz)); margin-top: calc(8px * var(--iz)); padding: 1px 6px; border-radius: 3px; background: var(--ac); color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; }
.cv-section { position: absolute; border-radius: 24px; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); pointer-events: none; }
.cv-section-title { position: absolute; left: 0; bottom: 100%; margin-bottom: calc(10px * var(--iz)); transform-origin: 0 100%; transform: scale(var(--iz)); display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px; background: #3a3a3a; color: var(--tx); font-size: 12px; font-weight: 500; white-space: nowrap; }
.cv-title { position: absolute; pointer-events: none; white-space: nowrap; }
.cv-title .k { font-size: 26px; font-weight: 500; letter-spacing: .08em; color: #F3DC9A; }
.cv-title .m { margin-top: 6px; font-size: 76px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.cv-title .s { margin-top: 14px; font-size: 26px; color: var(--tx-3); }
.cv-zoomhint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 14px; border-radius: 8px; background: rgba(44, 44, 44, .92); box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, .4); color: var(--tx-2); font-size: 11px; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.cv-zoomhint b { color: var(--tx); font-weight: 500; }

/* ── prototyp ── */
.stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(60% 60% at 50% 45%, #232323 0%, #161616 100%); }
.device-wrap { position: relative; flex-shrink: 0; }
.device { position: absolute; left: 0; top: 0; width: 402px; height: 874px; border-radius: 58px; padding: 11px; background: #15172a; box-shadow: 0 0 0 1px #34385a, 0 40px 120px rgba(0, 0, 0, .7), inset 0 0 0 2px #262a44; transform-origin: 0 0; }
.device-screen { position: relative; width: 100%; height: 100%; border-radius: 48px; overflow: hidden; background: #04061A; }
.screen-anim { position: absolute; inset: 0; animation: screenIn .2s ease-out; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
.show-hot [style*="cursor: pointer"] { outline: 2px solid rgba(13, 153, 255, .9) !important; outline-offset: -2px; }
.flash-hot [style*="cursor: pointer"] { animation: hotFlash .9s ease-out; }
@keyframes hotFlash { 0%, 45% { outline: 2px solid rgba(13, 153, 255, .95); outline-offset: -2px; } 100% { outline: 2px solid rgba(13, 153, 255, 0); outline-offset: -2px; } }
.stage-bar { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px; border-radius: 10px; background: rgba(44, 44, 44, .95); box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(0, 0, 0, .4); flex-shrink: 0; }
.sb-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--tx-2); white-space: nowrap; }
.sb-btn:hover { background: var(--bg-2); color: var(--tx); }
.sb-btn.on { background: rgba(13, 153, 255, .2); color: #fff; }
.sb-btn.icon { width: 32px; padding: 0; justify-content: center; }
.sb-label { display: flex; align-items: baseline; gap: 8px; min-width: 150px; justify-content: center; padding: 0 8px; white-space: nowrap; }
.sb-label b { font-weight: 600; }
.sb-label span { color: var(--tx-3); font-variant-numeric: tabular-nums; }
.sb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.toast { position: absolute; left: 50%; top: 18px; z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 10px; background: #2c2c2c; box-shadow: 0 0 0 1px #000, 0 12px 30px rgba(0, 0, 0, .5); color: var(--tx); animation: toastIn .25s ease-out; }
.toast svg { flex-shrink: 0; }
.toast span { color: var(--tx-2); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── telefon: jen prototyp přes celou obrazovku ── */
.mobile { position: fixed; inset: 0; overflow: hidden; background: #04061A; }
.mobile .m-screen { position: absolute; left: 0; top: 0; overflow: hidden; background: #04061A; transform-origin: 0 0; }
.mobile .toast { top: calc(12px + env(safe-area-inset-top)); }
