.i18n-wait body { visibility: hidden; }   /* kým i18n.js nedoplní texty stránky */
:root {
  --paper: #eef1f5;      /* pozadie pracovnej plochy */
  --sheet: #ffffff;      /* panel */
  --ink: #17233a;        /* text */
  --muted: #5b6678;
  --line: #d5dbe4;
  --cobalt: #1f4fd1;     /* hlavná akcia */
  --cobalt-d: #173ca3;
  --grid: #dfe4ec;
  --ok: #187a4a;
  --err: #b42318;
  --radius: 10px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
code { font-size: .92em; background: #eef1f6; padding: 0 .3em; border-radius: 4px; }

.top { display: flex; align-items: baseline; gap: 24px; padding: 14px 24px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 22px/1 "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif; letter-spacing: .01em; }
.brand svg { width: 28px; height: 28px; fill: none; stroke: #8fb0ff; stroke-width: 2; align-self: center; }
.tagline { margin: 0; color: #b9c4d8; font-size: 15px; }
.top-links { margin-left: auto; align-self: center; display: flex; gap: 14px; }
.about-link { align-self: center; background: none; border: 0; padding: 2px 4px; font: inherit; font-size: 13px; color: #8d9ab3; cursor: pointer; }
.about-link:hover, .about-link:focus-visible { color: #fff; text-decoration: underline; }
.lang-sel { align-self: center; font: inherit; font-size: 13px; color: #c9d3e4; background: transparent; border: 1px solid #4a5874; border-radius: 6px; padding: 2px 4px; cursor: pointer; }
.lang-sel:hover, .lang-sel:focus-visible { color: #fff; border-color: #8d9ab3; }
.lang-sel option { color: var(--ink); background: #fff; }
.about { max-width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px 18px; color: var(--ink); box-shadow: 0 12px 40px rgba(20,30,60,.25); }
.about::backdrop { background: rgba(23,35,58,.45); }
.about h2 { margin: 0 0 10px; font-size: 18px; }
.about p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.5; }
.about ul { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; line-height: 1.6; }
.about-author { color: var(--muted); font-size: 13.5px !important; }
.about a { color: var(--cobalt); }
.about form { margin: 14px 0 0; text-align: right; }
.examples { max-width: min(1000px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 48px); padding-top: 0; }
.ex-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 10px; background: #fff; border-bottom: 1px solid var(--line); }
.ex-head h2 { margin: 0; }
.ex-head form { margin: 0; }
.examples section { padding: 6px 0 14px; border-bottom: 1px solid var(--line); }
.examples h3 { margin: 14px 0 6px; font-size: 16px; }
.examples h4 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.examples img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.examples pre { margin: 0; padding: 10px 12px; background: #f4f6fa; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; line-height: 1.45; overflow-x: auto; }
.ex-none { color: var(--muted); font-style: italic; }

.work { flex: 1; display: grid; grid-template-columns: 360px 1fr; gap: 20px; padding: 20px 24px 24px; min-height: 0; }
.panel { min-width: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 22px; align-self: start; }
.step h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: grid; place-items: center; }
.small { font-size: 14px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
select { flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }

.drop { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border: 2px dashed #b6c1d3; border-radius: var(--radius); cursor: pointer; text-align: center; background: #f7f9fc; }
.drop strong { font-size: 15px; }
.drop span { font-size: 13px; color: var(--muted); }
.drop.over, .drop:hover { border-color: var(--cobalt); background: #eef3ff; }
.drop.loaded { border-style: solid; border-color: var(--ok); background: #f1faf5; }

details { margin-top: 12px; }
summary { cursor: pointer; font-size: 14px; color: var(--cobalt); }
.seg { display: flex; gap: 16px; margin: 10px 0 6px; font-size: 14px; }
textarea { width: 100%; font: 12.5px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 8px; resize: vertical; color: var(--ink); }

.templates { display: grid; gap: 8px; }
.tpl { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; text-align: left; font: inherit; color: inherit; }
.tpl:hover { border-color: #9fb3d6; }
.tpl[aria-checked="true"] { border-color: var(--cobalt); box-shadow: 0 0 0 2px var(--cobalt) inset; }
.tpl .sw { height: 38px; border-radius: 6px; padding: 5px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; border: 1px solid rgba(0,0,0,.08); }
.tpl .sw i { border-radius: 2px; }
.tpl b { display: block; font-size: 14px; }
.tpl small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.own { display: block; margin-top: 10px; font-size: 14px; color: var(--cobalt); cursor: pointer; }
.own.active { color: var(--ok); font-weight: 600; }
.ai .check { margin-top: 6px; }
#ai-cancel { margin-top: 8px; }
.proc textarea { display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; color: var(--ink); }
.proc textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(31,79,209,.15); }
.proc .btn { margin-top: 8px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; }
.proc .btn:disabled { cursor: progress; }
.drop.busy { cursor: progress; opacity: .6; }
.ai-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ai-report { max-height: 260px; overflow: auto; white-space: pre-wrap; font-size: 12.5px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 8px 0 0; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; color: var(--muted); }

.actions button { width: 100%; }
button.primary { font: 600 15px/1 inherit; font-family: inherit; padding: 13px; border: 0; border-radius: 8px; background: var(--cobalt); color: #fff; cursor: pointer; }
button.primary:hover:not(:disabled) { background: var(--cobalt-d); }
button.primary:disabled { background: #a9b4c6; cursor: not-allowed; }
button.primary.busy { background: var(--cobalt-d); cursor: progress; }
.status { margin: -8px 0 0; font-size: 14px; min-height: 1.4em; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }

.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.meta { font-size: 14px; color: var(--muted); }
.dl { display: flex; gap: 8px; align-items: center; }
.dl select { flex: none; width: auto; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.dl .btn { font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.btn { font-size: 14px; font-weight: 500; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; }
.btn.strong { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:hover { border-color: var(--cobalt); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn.danger-out { color: var(--err); border-color: #f2b8b5; }
.btn.danger-out:hover { border-color: var(--err); background: #fdeceb; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.confirm-btns { display: flex; justify-content: flex-end; gap: 8px; }
.addb { display: flex; gap: 6px; }
.addb .btn { font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 8px 12px; }
.addb .btn[aria-pressed="true"] { border-color: var(--cobalt); background: #eef3ff; color: var(--cobalt); }
.insp .nl-add { display: flex; gap: 6px; }
.insp .nl-add input { flex: 1; min-width: 0; }
.insp .nlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.insp .nlist li { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9fc; font-size: 14px; }
.insp .nlist li span { flex: 1; min-width: 0; word-break: break-word; }
.insp .nlist li small { color: var(--muted); }
.insp .nlist li button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 5px; }
.insp .nlist li button:hover { color: var(--err); background: #fdeceb; }
.insp .form-btns { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.insp .fh.warn { color: #9a5b00; }
.insp .swap { align-self: flex-start; }
.insp .del { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

[hidden] { display: none !important; }
.tabs { display: flex; gap: 2px; background: #e2e7ef; padding: 3px; border-radius: 8px; }
.tab { font: inherit; font-size: 14px; font-weight: 500; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(23,35,58,.15); }
.stage-bar .meta { flex: 1; min-width: 160px; }
.zoom { display: flex; align-items: center; gap: 4px; }
.zb { font: inherit; font-size: 15px; line-height: 1; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); cursor: pointer; }
.zb.wide { font-size: 13px; font-weight: 500; }
.zb:hover { border-color: var(--cobalt); }
.zb.on { border-color: var(--cobalt); color: var(--cobalt); }
.zv { font-size: 13px; color: var(--muted); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }

.canvas { flex: none; height: max(420px, calc(100vh - 170px)); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; padding: 24px;
  background-color: #f9fbfd;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; display: flex; }
/* margin:auto centruje obrázok, a keď je väčší ako plocha, dá sa doňho posúvať zo všetkých strán */
.frame { margin: auto; flex: none; position: relative; line-height: 0; }
.canvas img { display: block; max-width: none; height: auto; box-shadow: 0 2px 16px rgba(23,35,58,.16); border-radius: 4px; background: #fff; transition: opacity .2s; user-select: none; }
.canvas.loading img { opacity: .35; }
.frame.pan { cursor: grab; }
.frame.over { cursor: pointer; }
.frame.dragging { cursor: grabbing; }
/* editor: priehľadná vrstva nad obrázkom so zvýraznením objektu / šípky */
.hit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hit rect, .hit path { vector-effect: non-scaling-stroke; pointer-events: none; }
.hit .hov { fill: rgba(31,79,209,.05); stroke: #1f4fd1; stroke-width: 1.5; stroke-dasharray: 5 3; }
.hit .sel { fill: rgba(31,79,209,.08); stroke: #1f4fd1; stroke-width: 2.5; }
.hit path.line { fill: none; stroke: rgba(31,79,209,.45); stroke-width: 7; stroke-dasharray: none; stroke-linecap: round; stroke-linejoin: round; }
.hit path.hov.line { stroke: rgba(31,79,209,.25); }
/* flow: kroky oranžovo, číslo kroku; zvyšok diagramu sa nestmavuje */
.hit .flow { fill: rgba(232,89,12,.07); stroke: #e8590c; stroke-width: 3; }
.hit path.flow.line { fill: none; stroke: rgba(232,89,12,.75); stroke-width: 6; }
.hit .fbadge { pointer-events: none; }
.hit .fbadge circle { fill: #e8590c; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hit .fbadge text { fill: #fff; font-family: system-ui, sans-serif; font-weight: 700; }
.insp .flist li { align-items: flex-start; }
.insp .flist .fnum { flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: #e8590c; color: #fff; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.insp .flist .fst { flex: 1; min-width: 0; word-break: break-word; }
.insp .flist .fst .fh { margin: 2px 0 0; }
.insp .flist .fst textarea.fdesc { display: block; width: 100%; margin-top: 5px; min-height: 0; resize: vertical; font-size: 13px; }
.insp .nlist li button.flink { flex: 1; text-align: left; color: inherit; font-size: 14px; padding: 0; }
.insp .nlist li button.flink:hover { color: #e8590c; background: none; }
.insp .nlist.flows li { padding: 6px 8px; }
.insp .nlist li button.fplay { flex: none; width: 30px; height: 30px; padding: 0 0 0 2px; border-radius: 50%; background: #ff7a1a; color: #fff; font-size: 12px; box-shadow: 0 2px 8px rgba(255,106,0,.35); }
.insp .nlist li button.fplay:hover:not(:disabled) { background: #ff8f3d; color: #fff; }
.insp .nlist li button.fplay:disabled { background: #c9ced8; box-shadow: none; cursor: default; }
.insp .nlist li button.flink small { color: var(--muted); }
.insp .flist li.fx-cur { border-color: #ff7a1a; background: #fff4ec; box-shadow: 0 0 0 3px rgba(255,122,26,.18); }
.insp .flist li.fx-done .fnum { background: #ffb27a; }
.insp .fx-go { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #ff7a1a, #e8461a); border-color: transparent; }
.insp .fx-go:hover { filter: brightness(1.06); }
.insp .fx-go:disabled { filter: grayscale(.6); opacity: .6; }

/* vizualizácia flowu: animácia nad diagramom (diagram zostáva bez stmavenia) */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fx .fx-glow { fill: none; stroke: rgba(255,122,26,.55); stroke-linecap: round; stroke-linejoin: round; }
.fx .fx-line { fill: none; stroke: #ff7a1a; stroke-linecap: round; stroke-linejoin: round; }
.fx .fx-ants { fill: none; stroke: #fff; stroke-linecap: round; opacity: .95; }
.fx .fx-ol { fill: none; stroke: #ff8a3d; stroke-linecap: round; stroke-linejoin: round; }
.fx .fx-ol.cur { stroke: #ff6a00; }
.fx .fx-tint { fill: rgba(255,122,26,.10); }
.fx .fx-pulse { fill: none; stroke: #ff7a1a; }
.fx .fx-halo { fill: rgba(255,150,60,.85); }
.fx .fx-dot { fill: #fff; stroke: #ff6a00; }
.fx .fx-badge { fill: #ff7a1a; stroke: #fff; }
.fx .fx-badge.cur { fill: #ff5200; }
.fx text { fill: #fff; font-family: system-ui, sans-serif; font-weight: 700; }
.frame.fx-on { cursor: pointer; }
.canvas.loading .frame.fx-on img { opacity: 1; }   /* počas animácie sa diagram pri pregenerovaní nezosvetlí */

.cwrap .fxbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); z-index: 3;
  background: rgba(17,24,39,.93); color: #fff; border-radius: 14px; padding: 10px 12px 12px; box-shadow: 0 18px 48px rgba(8,12,24,.38), 0 0 0 1px rgba(255,255,255,.06) inset;
  backdrop-filter: blur(8px); animation: fxIn .35s cubic-bezier(.2,.8,.2,1); }
.cwrap.open .fxbar { left: calc((100% - min(340px, 100% - 20px) - 10px) / 2); width: min(640px, calc(100% - min(340px, 100% - 20px) - 52px)); }
.cwrap .fxbar[hidden] { display: none; }
@keyframes fxIn { from { opacity: 0; transform: translate(-50%, 14px); } }
.fx-prog { display: flex; gap: 3px; margin-bottom: 10px; }
.fx-prog button { position: relative; flex: 1; height: 5px; padding: 0; border: 0; border-radius: 3px; background: rgba(255,255,255,.16); cursor: pointer; overflow: hidden; }
.fx-prog button.rel { flex: .55; }
.fx-prog button:hover { background: rgba(255,255,255,.3); }
.fx-prog i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #ff9a4d, #ff6a00); }
.fx-row { display: flex; align-items: center; gap: 12px; }
.fx-count { flex: none; font-size: 13px; font-weight: 700; line-height: 1; padding: 7px 10px; border-radius: 999px; background: #ff7a1a; font-variant-numeric: tabular-nums; }
.fx-info { flex: 1; min-width: 0; }
.fx-info.swap { animation: fxSwap .32s ease-out; }
@keyframes fxSwap { from { opacity: 0; transform: translateY(5px); } }
.fx-info b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-info small { display: block; font-size: 12px; color: rgba(255,255,255,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-desc { margin: 5px 0 0; font-size: 13px; line-height: 1.4; color: rgba(255,255,255,.86); }
.fx-ctl { flex: none; display: flex; align-items: center; gap: 4px; }
.fx-ctl button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fx-ctl button:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.fx-ctl button:disabled { opacity: .35; cursor: default; }
.fx-ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fx-ctl svg .fill { fill: currentColor; stroke: none; }
.fx-ctl .fx-main { width: 42px; height: 42px; border-radius: 50%; background: #ff7a1a; box-shadow: 0 4px 14px rgba(255,106,0,.45); }
.fx-ctl .fx-main:hover:not(:disabled) { background: #ff8f3d; }
.fxbar .i-pause, .fxbar.playing .i-play { display: none; }
.fxbar.playing .i-pause { display: block; }
/* popis kroku v diagrame: bublina pri čísle kroku (vpravo hore; .below = pod, .left = vľavo) */
.fx-note { position: absolute; z-index: 3; pointer-events: none; transform: translate(14px, calc(-100% - 14px)); max-width: 280px; width: max-content;
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px 9px 9px; border-radius: 10px; background: rgba(24,28,38,.94); color: #fff;
  font-size: 13.5px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 0 2px #ff7a1a; }
.fx-note b { flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: #ff7a1a; font-size: 12px; display: grid; place-items: center; }
.fx-note.below { transform: translate(14px, 14px); }
.fx-note.left { transform: translate(calc(-100% - 14px), calc(-100% - 14px)); }
.fx-note.left.below { transform: translate(calc(-100% - 14px), 14px); }
.fx-note.pop { animation: fxNoteIn .35s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes fxNoteIn { from { opacity: 0; scale: .85; } }
@media (prefers-reduced-motion: reduce) { .cwrap .fxbar, .fx-info.swap, .fx-note.pop { animation: none; } }

.cwrap { position: relative; min-width: 0; }
.cwrap.open .canvas { padding-right: calc(min(340px, 100% - 20px) + 34px); }   /* obrázok sa zmestí vedľa panela */
.insp { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(340px, calc(100% - 20px)); z-index: 2; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 32px rgba(23,35,58,.22); }
.insp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.insp-head small { font-size: 12px; color: var(--muted); }
.insp-head h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.3; word-break: break-word; }
.insp-body { flex: 1; overflow: auto; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.insp .f { display: flex; flex-direction: column; gap: 6px; }
.insp .fl { font-size: 13px; font-weight: 600; }
.insp .fh { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.insp .fh.err { color: var(--err); }
.insp .fh.foot { border-top: 1px solid var(--line); padding-top: 10px; }
.insp input[type="text"], .insp input[type="search"], .insp input[type="number"], .insp textarea, .insp select { width: 100%; font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; }
.insp textarea { resize: vertical; min-height: 52px; }
.insp input:focus, .insp textarea:focus, .insp select:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(31,79,209,.15); }
.insp select:disabled { color: var(--muted); background: #f3f5f8; }
.segb { display: flex; flex-wrap: wrap; gap: 4px; }
.segb button { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); cursor: pointer; min-width: 36px; }
.segb button:hover { border-color: var(--cobalt); }
.segb button[aria-checked="true"], .chips button[aria-checked="true"] { border-color: var(--cobalt); background: #edf2ff; box-shadow: 0 0 0 1px var(--cobalt) inset; }
.chips { display: flex; flex-direction: column; gap: 4px; }
.chips button { display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); cursor: pointer; }
.chips button:hover { border-color: var(--cobalt); }
.chips b { font-weight: 600; min-width: 56px; }
.chips span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsw { flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); }
.lsw { flex: none; width: 34px; height: 10px; }
.icp { display: flex; flex-direction: column; gap: 8px; }
.icp-cur { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.icp-cur code { font-size: 13px; }
.icp-btns { display: flex; gap: 6px; }
.icp-btns .btn { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.icp-pick { display: flex; flex-direction: column; gap: 8px; }
.icp-bar { display: flex; gap: 6px; }
.icp-bar select { width: auto; flex: none; }
.icp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.icp-grid .icard { padding: 8px 4px 6px; gap: 4px; }
.icp-grid .icard img { width: 22px; height: 22px; }
.icp-grid .icard span { font-size: 11px; }
.empty { margin: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 26px; max-width: 520px; font-size: 15px; line-height: 1.55; }
.empty ol { margin: 6px 0 0; padding-left: 20px; }

.ibrowser { height: max(420px, calc(100vh - 170px)); display: flex; flex-direction: column; gap: 10px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.isearch { display: flex; align-items: center; gap: 12px; }
.isearch input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.isearch select { flex: none; width: auto; font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.isearch input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(31,79,209,.15); }
.ihint { margin: 0; font-size: 13px; color: var(--muted); }
.igrid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; padding: 2px; }
.icard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.icard:hover { border-color: var(--cobalt); background: #f4f7ff; }
.icard.copied { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset; }
.icard img { width: 28px; height: 28px; }
.icard span { font-size: 12px; line-height: 1.3; text-align: center; word-break: break-word; }

/* editor rozloženia – schéma hlavnej mriežky */
.led { height: max(420px, calc(100vh - 170px)); display: flex; flex-direction: column; gap: 10px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.led-scope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.led-scope label { font-weight: 600; }
.led-scope select { flex: 1; min-width: 200px; max-width: 520px; font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.led-scope .btn { cursor: pointer; }
.led-list { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.led-list.m-row { flex-direction: row; flex-wrap: wrap; max-width: none; }
.led-list.m-row .led-card { flex: 1 1 140px; min-height: 90px; }
.led-list.m-grid { display: grid; max-width: none; }
.led-card { position: relative; border: 2px solid; border-radius: 9px; padding: 10px 12px 10px 40px; display: flex; flex-direction: column; gap: 2px; justify-content: center; cursor: grab; user-select: none; touch-action: none; min-width: 0; }
.led-card b { font-size: 13.5px; word-break: break-word; }
.led-card small { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.led-no { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.led-card.drag { opacity: .5; cursor: grabbing; }
.led-card:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }
.led-list.m-column .led-card.ins-before { box-shadow: 0 -5px 0 -1px var(--cobalt); }
.led-list.m-column .led-card.ins-after { box-shadow: 0 5px 0 -1px var(--cobalt); }
.led-list:not(.m-column) .led-card.ins-before { box-shadow: -5px 0 0 -1px var(--cobalt); }
.led-list:not(.m-column) .led-card.ins-after { box-shadow: 5px 0 0 -1px var(--cobalt); }
.led-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.led-bar .ihint { flex: 1; min-width: 220px; }
.led-btns { display: flex; gap: 8px; }
.led-btns .btn { cursor: pointer; }
.led-btns .btn:disabled { opacity: .45; cursor: default; }
#led-msg { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; color: #6b5310; }
#led-msg.err { background: #fdeceb; border-color: #f2b8b5; color: var(--err); }
.led-wrap { flex: 1; overflow: auto; padding: 2px; position: relative; }
.led-cols, .led-grid { display: grid; column-gap: 6px; min-width: 560px; }
.led-cols { margin-bottom: 6px; }
.led-chc { position: relative; min-width: 0; }
.led-ch { width: 100%; font: inherit; font-size: 11.5px; color: var(--muted); background: #f3f5f9; border: 1px solid transparent; border-radius: 6px; padding: 4px 2px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer; }
.led-ch:hover, .led-ch:focus-visible { border-color: var(--cobalt); color: var(--ink); background: #edf2ff; }
.led-ch.lane { background: repeating-linear-gradient(135deg, #f4f6fa 0 6px, #eaeef4 6px 12px); }
.led-cr { position: absolute; top: 0; bottom: 0; right: -6px; width: 6px; cursor: col-resize; z-index: 1; touch-action: none; }
.led-cr::after { content: ""; position: absolute; left: 2px; top: 3px; bottom: 3px; width: 2px; border-radius: 1px; background: #c3cad6; }
.led-cr:hover::after { background: var(--cobalt); }
.led-chc:last-child .led-cr { right: 0; }   /* posledný úchyt by bol mimo plochy a orezaný */
body.col-resize, body.col-resize * { cursor: col-resize !important; user-select: none; }
.led-rh { font: inherit; font-size: 16px; line-height: 1; color: var(--muted); background: #f3f5f9; border: 1px solid transparent; border-radius: 6px; cursor: pointer; padding: 0; }
.led-rh:hover, .led-rh:focus-visible { border-color: var(--cobalt); color: var(--ink); background: #edf2ff; }
.led-menu { position: absolute; z-index: 5; width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 28px rgba(23,35,58,.2); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.led-mt { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 4px 4px; }
.led-menu > button { font: inherit; font-size: 13px; text-align: left; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; }
.led-menu > button:hover, .led-menu > button:focus-visible { background: #edf2ff; }
.led-menu .fh { margin: 0 4px 4px; font-size: 11.5px; color: var(--muted); }
.led-mw { display: flex; gap: 6px; padding: 0 4px; }
.led-mw input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.led-mw .btn { padding: 5px 10px; font-size: 13px; cursor: pointer; }
.led-grid { row-gap: 6px; grid-auto-rows: minmax(84px, auto); }
.led-cell { border: 1px dashed #cfd6e2; border-radius: 6px; background: #fbfcfe; }
.led-cell.lane { background: repeating-linear-gradient(135deg, #f4f6fa 0 6px, #eaeef4 6px 12px); border-color: #e2e7ef; }
.led-block { position: relative; z-index: 1; border: 2px solid; border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; cursor: grab; user-select: none; touch-action: none; min-width: 0; overflow: hidden; }
.led-block b { font-size: 13.5px; line-height: 1.25; word-break: break-word; }
.led-block small { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.led-block.none { border-style: dashed; }
.led-block.legend b { font-weight: 600; }
.led-block.drag { opacity: .55; cursor: grabbing; }
.led-block:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }
.led-h { position: absolute; z-index: 2; }
.led-h.h-r { right: -2px; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.led-h.h-l { left: -2px; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.led-h.h-b { bottom: -2px; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.led-h.h-t { top: -2px; left: 0; right: 0; height: 10px; cursor: ns-resize; }
.led-block:hover .led-h::after { content: ""; position: absolute; background: currentColor; opacity: .35; border-radius: 2px; }
.led-h.h-r::after, .led-h.h-l::after { left: 3px; top: 35%; width: 4px; height: 30%; }
.led-h.h-b::after, .led-h.h-t::after { top: 3px; left: 35%; height: 4px; width: 30%; }
.led-ghost { z-index: 3; border: 2px dashed var(--cobalt); border-radius: 9px; background: rgba(31,79,209,.12); pointer-events: none; }
.led-ghost.bad { border-color: var(--err); background: rgba(180,35,24,.10); }
.led-json summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.led-json pre { margin: 6px 0 0; font-size: 12.5px; background: #f4f6fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow: auto; max-height: 160px; }

.icons { font-size: 13px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; line-height: 1.5; }

:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }

@media (max-width: 900px) {
  .work { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .canvas { height: 70vh; min-height: 320px; padding: 12px; }
  /* na úzkej obrazovke by panel zakryl obrázok – zobrazí sa pod ním */
  .insp { position: static; width: auto; margin-top: 10px; }
  .cwrap.open .canvas { padding-right: 12px; }
  .cwrap .fxbar, .cwrap.open .fxbar { position: static; transform: none; width: auto; margin-top: 10px; animation: none; }
  .fx-ctl button { width: 30px; height: 30px; }
  .insp-body { overflow: visible; }
  .ibrowser { height: 75vh; padding: 12px; }
  .led { height: auto; min-height: 60vh; padding: 12px; }
  .led-cols, .led-grid { min-width: 0; }   /* celá schéma na šírku displeja – bloky sa dajú ťahať bez posúvania */
  .led-block b { font-size: 12px; }
  .igrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .top { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .top-links { order: 1; }
  .tagline { order: 2; flex-basis: 100%; }
  .isearch { flex-wrap: wrap; gap: 8px 12px; }
  .isearch input { flex-basis: 100%; order: 3; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
