/* Vizualizace (schemata) – spolecne pro web T1 a server (pracovni prostor, Podnety 34). */

.vz-head { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.vz-head h1 { margin: 0 12px 0 0; }
.vz-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.vz-tab {
  padding: 7px 14px; border-radius: 8px; color: var(--quiet); text-decoration: none; font-weight: 500;
  background: var(--card); border: 1px solid var(--line);
}
.vz-tab:hover { color: var(--ink); }
.vz-tab.active { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-soft); }
.vz-tab .vz-star { color: #E8890C; }
.vz-box { min-height: 200px; }
.vz-stage { background: #E4E7EB; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.vz-stage:fullscreen { display: flex; align-items: center; justify-content: center; background: #1E2125; border-radius: 0; }
.vz-stage:fullscreen svg { max-height: 100vh; }
.vz-svg { display: block; width: 100%; height: auto; user-select: none; }
.vz-stage .vz-el { cursor: pointer; }
.vz-empty { max-width: 640px; }
.vz-empty .row { gap: 10px; margin-top: 16px; }

.vz-spin { animation: vzspin 1.4s linear infinite; }
@keyframes vzspin { to { transform: rotate(360deg); } }
.vz-flow { animation: vzflow 1.6s linear infinite; }
@keyframes vzflow { to { stroke-dashoffset: -60; } }

.vz-name { min-width: 260px; font-size: 16px; font-weight: 600; }
.vz-editor { display: grid; grid-template-columns: 170px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.vz-palette, .vz-props { padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow: auto; }
.vz-palette h3, .vz-props h3 { margin: 4px 0 10px; font-size: 14px; color: var(--quiet); text-transform: uppercase; letter-spacing: .04em; }
.vz-palette h3:not(:first-child) { margin-top: 18px; }
.vz-pal {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 4px; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: var(--ink); cursor: grab; text-align: left;
}
.vz-pal:hover { background: var(--surface); border-color: var(--line); }
.vz-pal-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 600; }
.vz-canvas { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 120px); padding: 8px; }
.vz-canvas svg { cursor: default; touch-action: none; }
.vz-canvas svg.vz-drawing { cursor: crosshair; }
.vz-canvas .vz-el { cursor: move; }
.vz-canvas .vz-handle { cursor: nwse-resize; }
.vz-canvas .vz-vertex { cursor: grab; }
.vz-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.vz-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--quiet); }
.vz-form label.wide, .vz-form > .wide { grid-column: 1 / -1; }
.vz-form > p.wide { margin: 0; }
.vz-form .text-input { width: 100%; box-sizing: border-box; }
.vz-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (max-width: 1100px) {
  .vz-editor { grid-template-columns: 1fr; }
  .vz-palette, .vz-props { position: static; max-height: none; }
}
.view.vz-wide { max-width: 1880px; }
.vz-form .text-input, .vz-props .text-input { min-width: 0; }
.vz-head select.text-input { flex: 0 0 auto; min-width: 0; width: auto; }
.vz-head .vz-name { flex: 0 1 340px; }

/* Rucni ovladani ze schematu */
.vz-box { position: relative; }
.vz-pop { position: absolute; z-index: 20; width: 280px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.vz-pop-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.vz-pop-actions { gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.vz-pop-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--quiet); }
.vz-pop .small { font-size: 12px; }

/* 0.12: pravidla barev (Podnety 44) – pulzace prolina zakladni a zvolenou barvu, blikani je stridani. Faze podle hodin
   (animation-delay), aby prekresleni kazdou sekundu animaci nerestartovalo. */
.vz-pulse-f { animation: vzpf 2s ease-in-out infinite; }
.vz-pulse-s { animation: vzps 2s ease-in-out infinite; }
.vz-blink-f { animation: vzbf 1s steps(1, end) infinite; }
.vz-blink-s { animation: vzbs 1s steps(1, end) infinite; }
@keyframes vzpf { 0%, 100% { fill: var(--a); } 50% { fill: var(--b); } }
@keyframes vzps { 0%, 100% { stroke: var(--a); } 50% { stroke: var(--b); } }
@keyframes vzbf { 0% { fill: var(--b); } 50% { fill: var(--a); } }
@keyframes vzbs { 0% { stroke: var(--b); } 50% { stroke: var(--a); } }
/* animovane znacky */
.vz-blink-glow { animation: vzglow 1.2s ease-in-out infinite; }
@keyframes vzglow { 50% { opacity: .55; } }
.vz-bob { animation: vzbob 1.4s ease-in-out infinite; transform-box: fill-box; }
@keyframes vzbob { 50% { transform: translateY(-5px); } }
.vz-drop { animation: vzdrop .9s linear infinite; transform-box: fill-box; }
@keyframes vzdrop { from { transform: translateY(-8px); opacity: 1; } to { transform: translateY(10px); opacity: 0; } }
.vz-flame { animation: vzflame .8s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes vzflame { 50% { transform: scaleY(1.12); } }
.vz-shake { animation: vzshake .25s linear infinite; }
@keyframes vzshake { 50% { transform: translateX(2px); } }

/* editor: kresleni potrubi, palety, barvy, pravidla */
.vz-drawbar { display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.vz-pal-name { flex: 1; }
.vz-anim { color: var(--quiet); font-size: 12px; }
.vz-pal.vz-more { color: var(--blue); }
.vz-cats { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 12px; }
.vz-cats .vz-tab { cursor: pointer; font: inherit; }
.vz-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vz-more-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border: 1px solid var(--line);
  border-radius: 10px; background: #E4E7EB; cursor: pointer; text-align: center; }
.vz-more-item:hover { border-color: var(--blue); }
.vz-more-name { font-size: 13px; color: var(--ink); }
.vz-thumb svg { display: block; }
.vz-star { position: absolute; top: 4px; right: 4px; border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: #B8BEC5; }
.vz-star.on { color: #E8A300; }
.vz-sub { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--quiet); text-transform: uppercase; letter-spacing: .04em; }
.vz-color { display: grid; grid-template-columns: 70px 36px 1fr; gap: 4px 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.vz-color-label { color: var(--quiet); }
.vz-color input[type=color] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.vz-color .vz-hex { min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.vz-color .vz-hex.bad { border-color: var(--bad, #C62828); }
.vz-color .vz-swatches { grid-column: 2 / -1; }
.vz-swatches { display: inline-flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.vz-swatches button { width: 18px; height: 18px; padding: 0; border: 1px solid rgba(0, 0, 0, .25); border-radius: 4px; cursor: pointer; }
.vz-swatches .vz-none { background: linear-gradient(135deg, #fff 45%, #D32F2F 45%, #D32F2F 55%, #fff 55%); }
.vz-swatches .vz-reset { background: var(--card); font-size: 11px; line-height: 1; width: auto; padding: 0 4px; }
.vz-rule { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; display: grid; gap: 5px; }
.vz-rule-line { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--quiet); }
.vz-rule-line .text-input { width: auto; min-width: 0; padding: 4px 6px; font-size: 13px; }
.vz-rule-line select.text-input { min-width: 92px; }
.vz-rule-line input[type=number] { width: 72px; }
.vz-rule-line input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.vz-input-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; font-size: 13px; }
.vz-input-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-input-row select { width: 100%; }
.vz-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.vz-form > span { display: block; }
.note.small { font-size: 12px; padding: 6px 8px; }

/* Zvetseni a posun schematu (Podnety 56) */
.vz-stage { position: relative; }
.vz-zoombar { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; opacity: .85; }
.vz-zoombar .btn { min-width: 34px; padding: 4px 8px; background: var(--card); }
.vz-stage svg.vz-zoomed { cursor: grab; }
.vz-stage svg.vz-zoomed:active { cursor: grabbing; }
