/* =====================================================================
   Editor výstřižků v2 (public/editor.js)
   Základ = telefon na výšku. Pak: dva sloupce (tablet, telefon na šířku), tři sloupce (počítač).
   ===================================================================== */
.ce {
  --panel: rgba(20, 20, 23, .86); --panel2: rgba(34, 34, 38, .9); --hair: rgba(255, 255, 255, .09);
  --vh: clamp(190px, 33dvh, 330px);
  position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100dvh); z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "top" "view" "tabs" "panel" "tl" "bar" "acts";
  padding: var(--safe-t) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  background: linear-gradient(rgba(10, 10, 11, .9), rgba(10, 10, 11, .95));
  color: var(--text); font-family: Poppins, Inter, -apple-system, system-ui, sans-serif; font-weight: 500;
  overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.ce button { font-family: inherit; }
.ce .ci { width: 20px; height: 20px; flex: none; display: block; }
.ce [data-sp] { --sp: var(--ales); }
.ce [data-sp="Vojta"] { --sp: var(--vojta); }

/* ---------- hlavička ---------- */
.ce-head { display: contents; }
.ce-top { grid-area: top; display: flex; align-items: center; gap: 2px; padding: 4px 6px; min-width: 0; }
.ce-ib { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--text); transition: background .12s, opacity .12s; }
.ce-ib:disabled { opacity: .28; }
.ce-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 4px; line-height: 1.2; }
.ce-ttl b { font-weight: 800; font-size: 14px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-meta { font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-state { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; margin-right: 2px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: var(--mute); background: var(--panel2); white-space: nowrap; flex: none; }
.ce-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.ce-state[data-s="dirty"] { color: var(--yellow); background: rgba(255, 212, 0, .12); }
.ce-state[data-s="dirty"] i { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.ce-state[data-s="saved"] i { background: var(--green); }
.ce-state[data-s="saving"] i { background: var(--mute); animation: pulse 1s infinite; }
.ce-top .help { display: none; }
@media (max-width: 480px) { .ce-state[data-s="saved"] { padding: 0 9px; } .ce-state[data-s="saved"] span { display: none; } }
.ce-acts { grid-area: acts; display: flex; gap: 8px; padding: 8px 12px calc(8px + var(--safe-b)); border-top: 1px solid var(--hair); background: rgba(12, 12, 13, .9); }
.ce-acts .btn { flex: 1; height: 48px; font-size: 14.5px; padding: 0 12px; min-width: 0; }
.ce-acts .cancel { display: none; }
.ce-acts .send .lg { display: none; }
.ce-acts .save.hot { border-color: rgba(255, 212, 0, .6); color: var(--yellow); }

/* ---------- náhled a transport ---------- */
.ce-view { grid-area: view; height: var(--vh); min-height: 0; display: grid; gap: 4px 10px; padding: 2px 12px 8px;
  grid-template-columns: minmax(0, 1fr) calc((var(--vh) - 10px) * .5625) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "speed stage now" "speed stage tr" "speed stage dur"; }
.ce-stage { grid-area: stage; container-type: size; display: grid; place-items: center; min-width: 0; min-height: 0; }
.ce-stage .stage { width: min(100cqw, calc(100cqh * 9 / 16)); height: auto; aspect-ratio: 9 / 16; border-radius: 14px; cursor: pointer; }
.ce-stage .ov-play i { width: 48px; height: 48px; font-size: 20px; }
.ce-now, .ce-dur { font-variant-numeric: tabular-nums; font-weight: 700; justify-self: center; }
.ce-now { grid-area: now; align-self: end; font-size: 17px; color: var(--text); }
.ce-dur { grid-area: dur; align-self: start; font-size: 12.5px; color: var(--mute); }
.ce-dur::before { content: "z "; font-weight: 500; }
.ce-tr { grid-area: tr; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-self: center; }
.ce-play { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ygrad); color: #111; box-shadow: var(--glow); transition: transform .1s; }
.ce-play:active { transform: scale(.94); }
.ce-play .ci { width: 26px; height: 26px; }
.ce-play.rev::after { content: attr(data-rev); position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--yellow); white-space: nowrap; }
.ce-speed { grid-area: speed; display: grid; place-items: center; }
.ce-speed .speed { flex-direction: column; gap: 4px; padding: 4px; border-radius: 16px; }
.ce-speed .speed button { min-width: 56px; height: 44px; font-size: 14px; border-radius: 12px; }

/* ---------- záložky ---------- */
.ce-tabs { grid-area: tabs; display: flex; gap: 4px; padding: 0 12px 6px; }
.ce-tabs button { flex: 1; height: 40px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--mute); background: var(--panel); border: 1px solid var(--hair); display: flex; align-items: center; justify-content: center; gap: 6px; }
.ce-tabs button.on { color: #111; background: var(--ygrad); border-color: transparent; }
.ce-tabs .cnt { font-style: normal; font-size: 11.5px; opacity: .7; }

/* ---------- přepis ---------- */
.ce-text, .ce-bin { grid-area: panel; min-height: 0; min-width: 0; }
.ce[data-tab="text"] .ce-bin, .ce[data-tab="bin"] .ce-text { display: none; }
.ce-text { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 12px 14px; scrollbar-width: thin; scrollbar-color: #3a3a40 transparent; }
.ce-segs { position: relative; max-width: 860px; margin: 0 auto; }
.ce-seg { position: relative; background: var(--panel); border: 1px solid var(--hair); border-radius: 14px; padding: 4px 8px 8px 12px; transition: border-color .12s, background .12s, opacity .12s; }
.ce-seg::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sp); opacity: .85; }
.ce-seg.act { border-color: rgba(255, 212, 0, .55); background: rgba(38, 34, 14, .92); box-shadow: 0 0 0 1px rgba(255, 212, 0, .12), 0 8px 26px rgba(0, 0, 0, .35); }
.ce-seg.lift { opacity: .35; }
.ce-seg header { display: flex; align-items: center; gap: 8px; height: 36px; font-size: 12px; color: var(--mute); cursor: pointer; }
.ce-seg header .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; display: grid; place-items: center; background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 800; }
.ce-seg.act header .n { background: var(--yellow); color: #111; }
.ce-seg .who { color: var(--sp); font-weight: 700; }
.ce-seg .tm { font-variant-numeric: tabular-nums; flex: 1; }
.ce-grip { width: 30px; height: 36px; margin-left: -8px; display: grid; place-items: center; color: var(--dim); cursor: grab; touch-action: none; border-radius: 8px; }
.ce-grip .ci { width: 18px; height: 18px; }
.ce-mini { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--mute); flex: none; }
.ce-mini .ci { width: 16px; height: 16px; }
.ce-mini.on { color: #111; background: var(--yellow); }
.ce-words { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.ce-w { min-height: 40px; min-width: 26px; padding: 0 4px; border-radius: 8px; font-size: 16px; font-weight: 600; line-height: 1.2; color: var(--text); transition: background .08s; }
.ce-w.first { box-shadow: inset 3px 0 0 var(--yellow); padding-left: 7px; }
.ce-w.last { box-shadow: inset -3px 0 0 var(--yellow); padding-right: 7px; }
.ce-w.first.last { box-shadow: inset 3px 0 0 var(--yellow), inset -3px 0 0 var(--yellow); }
.ce-w.out { color: var(--dim); font-weight: 500; text-decoration: underline dotted rgba(255, 255, 255, .22); text-underline-offset: 4px; }
.ce-w.cur { background: var(--ygrad); color: #111; }
.ce-w.cur.pick { background: rgba(255, 212, 0, .12); color: var(--text); outline: 2px solid var(--yellow); outline-offset: -2px; text-decoration: none; }
.ce-more, .ce-addu { height: 30px; margin: 0 4px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: var(--mute); background: var(--panel2); border: 1px dashed rgba(255, 255, 255, .16); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; position: relative; }
.ce-more::after, .ce-addu::after { content: ""; position: absolute; inset: -7px -2px; }
.ce-addu .ci { width: 13px; height: 13px; }
.ce-seg:not(.act) .ce-addu { display: none; }
.ce-join { display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.ce-join i { flex: 1; height: 1px; background: var(--hair); }
.ce-join.cont { color: #6f8f78; }
.ce-merge { height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 700; color: var(--text); background: var(--panel2); border: 1px solid var(--hair); position: relative; }
.ce-merge::after { content: ""; position: absolute; inset: -10px -6px; }
.ce-dropline { position: absolute; left: 4px; right: 4px; top: 0; height: 3px; border-radius: 2px; background: var(--yellow); box-shadow: 0 0 12px var(--yellow); pointer-events: none; z-index: 3; }
.ce-pop { position: absolute; left: 0; top: 0; z-index: 4; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: #26262b; border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 12px 32px rgba(0, 0, 0, .6); white-space: nowrap; }
.ce-pop[hidden] { display: none; }
.ce-pop button { height: 34px; padding: 0 10px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.ce-pop button .ci { width: 17px; height: 17px; }
.ce-pop button:hover:not(:disabled) { background: var(--yellow); color: #111; }
.ce-pop button:hover:not(:disabled) em { color: #111; }
.ce-pop button:disabled { opacity: .3; }
.ce-pop em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--mute); }
.ce-pop em.grow { color: var(--green); }
.ce-pop em:empty { display: none; }
.ce-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; text-align: center; color: var(--mute); font-size: 13.5px; }
.ce-empty b { color: var(--text); font-size: 16px; }

/* ---------- náhradní bloky ---------- */
.ce-bin { display: flex; flex-direction: column; }
.ce-bin-h { display: flex; align-items: baseline; gap: 10px; padding: 2px 14px 8px; font-size: 11.5px; color: var(--dim); }
.ce-bin-h b { display: none; }
.ce-bin-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: #3a3a40 transparent; touch-action: pan-y; }
.ce-sp { position: relative; background: var(--panel); border: 1px solid var(--hair); border-radius: 14px; padding: 10px 10px 6px 14px; cursor: grab; transition: transform .2s, box-shadow .2s, opacity .12s; }
.ce-sp::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sp); opacity: .85; }
.ce-sp.press { transform: scale(.97); box-shadow: 0 0 0 2px var(--yellow); }
.ce-sp.lift { opacity: .35; }
.ce-sp .tx { font-size: 13.5px; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ce-sp .mt { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; margin-top: 2px; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; min-height: 44px; }
.ce-sp .mt > span { white-space: nowrap; }
.ce-sp.used .ce-add { display: none; }
.ce-sp .who { color: var(--sp); font-weight: 700; }
.ce-sp .tag { padding: 2px 7px; border-radius: 99px; background: var(--panel2); font-size: 10.5px; font-weight: 700; }
.ce-sp .bt { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.ce-sp .ce-mini { width: 44px; height: 44px; }
.ce-add { height: 36px; padding: 0 12px 0 8px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--yellow); background: rgba(255, 212, 0, .1); border: 1px solid rgba(255, 212, 0, .28); position: relative; }
.ce-add::after { content: ""; position: absolute; inset: -4px 0; }
.ce-add .ci { width: 15px; height: 15px; }
.ce-add:disabled { opacity: .35; }
.ce-sp.used { cursor: default; }
.ce-sp.used .tx { opacity: .45; }
.ce-pv { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }

/* ---------- lišta nástrojů ---------- */
.ce-bar { grid-area: bar; min-width: 0; padding: 4px 6px; border-top: 1px solid var(--hair); background: rgba(14, 14, 15, .92); container: cebar / inline-size; }
.ce-bar-in { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ce-tools { flex: 1; min-width: 0; }
.ce-ctx { display: none; }
.ce-tools { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.ce-tools .sep, .ce-tool.reset, .ce-tool kbd { display: none; }
.ce-tool { position: relative; min-height: 50px; padding: 4px 2px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text); font-size: 10.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; transition: background .12s, opacity .12s; }
.ce-tool .ci { width: 22px; height: 22px; }
.ce-tool:disabled { opacity: .3; }
.ce-tool:active:not(:disabled) { background: var(--panel2); }
.ce-tool em { position: absolute; top: 3px; left: calc(50% + 9px); font-style: normal; font-size: 10px; font-weight: 800; color: var(--mute); font-variant-numeric: tabular-nums; }
.ce-tool.grow em { color: var(--green); }
.ce-tool em:empty { display: none; }
.ce-tool u { text-decoration: none; display: none; }
.ce-tool.danger:not(:disabled) { color: #ff8b96; }
/* širší lišta: všechny nástroje v řadě, od 665 px s popisky vedle ikon, od 830 px i se zkratkami */
@container cebar (min-width: 400px) {
  .ce-tools { display: flex; align-items: center; gap: 2px; }
  .ce-tool { flex: 1; min-width: 0; min-height: 50px; padding: 4px 2px; }
  .ce-tool.reset { display: flex; }
}
@container cebar (min-width: 540px) {
  .ce-tools { gap: 4px; }
  .ce-tool { padding: 4px 6px; border: 1px solid var(--hair); background: var(--panel); }
  .ce-tools .sep { display: block; width: 1px; height: 24px; background: var(--hair); margin: 0 2px; flex: none; }
}
@container cebar (min-width: 665px) {
  .ce-tools { justify-content: center; gap: 3px; }
  .ce-tool { flex: none; flex-direction: row; gap: 6px; min-height: 44px; padding: 0 10px; font-size: 12.5px; }
  .ce-tool[data-a="ml"] span, .ce-tool[data-a="mr"] span { display: none; }
  .ce-tool[data-a="ml"], .ce-tool[data-a="mr"] { width: 44px; padding: 0; justify-content: center; }
  .ce-tool .ci { width: 18px; height: 18px; }
  .ce-tool em { position: static; font-size: 11px; }
}
/* „tady“ u Začátek / Konec jen tam, kde se lišta vejde celá (jinak se ořízne Původní) */
@container cebar (min-width: 780px) { .ce-tool u { display: inline; } }
@container cebar (min-width: 830px) {
  .ce-tool kbd { display: inline-block; opacity: .75; }
}
@container cebar (min-width: 1160px) {
  .ce-ctx { display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; color: var(--mute); white-space: nowrap; }
  .ce-ctx b { color: var(--text); font-weight: 800; }
  .ce-ctx .wd { overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
}
@media (hover: none), (pointer: coarse) {
  .ce-tool kbd { display: none !important; }
  .ce-seg header { height: 44px; }
  .ce-grip { width: 40px; height: 44px; margin-left: -12px; }
  .ce-seg .ce-mini { width: 44px; height: 44px; margin-right: -6px; }
}

/* ---------- časová osa ---------- */
.ce-tl { grid-area: tl; display: flex; align-items: stretch; min-width: 0; border-top: 1px solid var(--hair); background: rgba(14, 14, 15, .92); }
.ce-zoom { display: none; }
.ce-tl-sc { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: none; cursor: pointer; }
.ce-tl-sc::-webkit-scrollbar { display: none; }
.ce-tl-in { position: relative; min-width: 100%; height: 68px; }
.ce-ruler { position: absolute; left: 0; right: 0; top: 0; height: 18px; }
.ce-ruler i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .14); }
.ce-ruler b { position: absolute; left: 4px; top: 2px; font-size: 9.5px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.ce-track { position: absolute; left: 0; right: 0; top: 20px; bottom: 6px; }
.ce-tseg { position: absolute; top: 0; bottom: 0; border-radius: 8px; background: rgba(52, 52, 58, .95); border: 1.5px solid transparent; overflow: hidden; display: flex; align-items: center; gap: 5px; padding: 0 6px 0 8px; font-size: 11px; color: #cfcfd6; box-shadow: inset 3px 0 0 var(--sp); transition: background .12s, opacity .12s; }
.ce-tseg.cont { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.ce-tseg b { font-weight: 800; color: var(--text); flex: none; }
.ce-tseg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ce-tseg.tiny { padding: 0; justify-content: center; } .ce-tseg.tiny span { display: none; } .ce-tseg.tiny b { font-size: 9.5px; }
.ce-tseg.act { background: rgba(92, 80, 12, .96); border-color: var(--yellow); overflow: visible; z-index: 2; }
.ce-tseg.lift { opacity: .35; }
.ce-tseg .hd { display: none; position: absolute; top: -1.5px; bottom: -1.5px; width: 12px; background: var(--yellow); cursor: ew-resize; touch-action: none; z-index: 3; }
.ce-tseg .hd::before { content: ""; position: absolute; left: 4.5px; top: 30%; bottom: 30%; width: 3px; border-radius: 2px; background: #111; }
.ce-tseg .hd::after { content: ""; position: absolute; inset: -6px -10px; }
.ce-tseg .hd.l { left: -1.5px; border-radius: 8px 0 0 8px; }
.ce-tseg .hd.r { right: -1.5px; border-radius: 0 8px 8px 0; }
.ce-tseg.act:not(.tiny) .hd { display: block; }
.ce-tseg.act:not(.tiny) { padding-left: 16px; padding-right: 14px; }
.ce-tseg.trim { z-index: 4; box-shadow: inset 3px 0 0 var(--sp), 0 6px 20px rgba(0, 0, 0, .5); }
.ce-ph { position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; z-index: 5; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); will-change: transform; }
.ce-ph i { position: absolute; left: -5px; top: 0; width: 12px; height: 12px; border-radius: 3px 3px 6px 6px; background: #fff; }
.ce-tl-drop { position: absolute; left: 0; top: 16px; bottom: 2px; width: 4px; border-radius: 2px; background: var(--yellow); box-shadow: 0 0 12px var(--yellow); pointer-events: none; z-index: 6; }
.ce.dragging { cursor: grabbing; }
.ce.dragging .ce-tl { background: rgba(40, 36, 10, .6); }

/* ---------- plovoucí prvky ---------- */
.ce-float { position: fixed; left: 0; top: 0; z-index: 80; max-width: 240px; padding: 8px 12px 8px 14px; border-radius: 12px; background: rgba(46, 46, 52, .97); border: 1.5px solid var(--hair); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); pointer-events: none; font-family: Poppins, sans-serif; display: flex; flex-direction: column; gap: 2px; --sp: var(--ales); transition: border-color .1s, background .1s; }
.ce-float[data-sp="Vojta"] { --sp: var(--vojta); }
.ce-float::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sp); }
.ce-float b { font-size: 11px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.ce-float span { font-size: 12.5px; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ce-float.ok { border-color: var(--yellow); background: rgba(70, 62, 12, .97); }
.ce-tip { position: fixed; left: 0; top: 0; z-index: 80; padding: 6px 10px; border-radius: 9px; background: #fff; color: #111; font: 600 12.5px Poppins, sans-serif; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.ce-tip em { font-style: normal; font-weight: 800; color: #7a5b00; }
.ce-help { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .15s; font-family: Poppins, sans-serif; }
.ce-help-box { width: min(760px, 100%); max-height: 100%; overflow: auto; background: #151517; border: 1px solid var(--hair); border-radius: 20px; padding: 8px 20px 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.ce-help-box header { display: flex; align-items: center; justify-content: space-between; }
.ce-help-box header b { font-size: 17px; font-weight: 800; }
.ce-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 28px; }
.ce-help-grid h4 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.ce-help-grid p { display: flex; align-items: baseline; gap: 12px; margin: 0; padding: 5px 0; font-size: 13px; border-top: 1px solid var(--hair); }
.ce-help-grid .k { flex: none; width: 128px; white-space: nowrap; }
.ce-help-grid .k i { font-style: normal; font-size: 12px; color: var(--mute); }
.ce-help kbd, .ce-tool kbd { font: 700 11px/1 Poppins, sans-serif; padding: 3px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid rgba(255, 255, 255, .14); color: var(--text); }
.ce-help-box footer { margin-top: 12px; font-size: 12px; color: var(--dim); }

/* ---------- myš: hover ---------- */
@media (hover: hover) and (pointer: fine) {
  .ce-ib:hover:not(:disabled), .ce-mini:hover, .ce-grip:hover { background: var(--panel2); color: var(--text); }
  .ce-w:hover { background: rgba(255, 255, 255, .09); }
  .ce-w.cur:hover { background: var(--ygrad); }
  .ce-w.out:hover { color: var(--text); }
  .ce-tool:hover:not(:disabled) { background: var(--panel2); }
  .ce-more:hover, .ce-addu:hover, .ce-merge:hover { color: var(--text); border-color: rgba(255, 255, 255, .34); }
  .ce-sp:not(.used):hover { border-color: rgba(255, 255, 255, .22); }
  .ce-add:hover:not(:disabled) { background: rgba(255, 212, 0, .2); }
  .ce-tseg:hover { background: rgba(66, 66, 73, .95); } .ce-tseg.act:hover { background: rgba(92, 80, 12, .96); }
  .ce-w { min-height: 34px; }
  .ce-top .help { display: grid; }
}

/* ---------- dva sloupce: tablet na šířku a telefon na šířku ---------- */
@media (min-width: 700px) and (min-aspect-ratio: 1001/1000), (orientation: landscape) and (max-height: 520px) {
  .ce { --vw: calc((var(--app-h, 100dvh) - var(--safe-t) - 44px - 56px - 12px) * .5625 + 154px);
    grid-template-columns: var(--vw) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "head head" "view tabs" "view panel" "view bar" "tl tl"; }
  .ce-head { grid-area: head; display: flex; align-items: center; min-width: 0; border-bottom: 1px solid var(--hair); background: rgba(12, 12, 13, .9); }
  .ce-top { flex: 1; padding: 0 6px; }
  .ce-acts { border: 0; background: none; padding: 0 10px 0 4px; flex: none; }
  .ce-acts .btn { flex: none; height: 36px; font-size: 13px; padding: 0 14px; border-radius: 11px; }
  .ce-view { height: auto; padding: 6px 8px 6px 10px; gap: 4px 6px; grid-template-columns: 60px minmax(0, 1fr) 64px; border-right: 1px solid var(--hair); }
  .ce-tabs { padding: 6px 10px 4px; }
  .ce-tabs button { height: 34px; flex: none; padding: 0 16px; }
  .ce-text { padding: 4px 10px 12px; } .ce-bin-list { padding: 0 10px 12px; }
}
/* telefon na šířku: všechno nízké */
@media (orientation: landscape) and (max-height: 520px) {
  .ce-ib { height: 40px; }
  .ce-ttl b { font-size: 13px; } .ce-meta { font-size: 10.5px; }
  .ce-play { width: 50px; height: 50px; }
  .ce-speed .speed button { min-width: 50px; font-size: 13px; }
  .ce-tool { min-height: 44px; padding: 2px; }
  .ce-tl-in { height: 56px; } .ce-track { top: 18px; bottom: 4px; }
}
@media (min-width: 900px) and (min-aspect-ratio: 1001/1000) {
  .ce-acts .cancel { display: inline-flex; }
  .ce-acts .send .lg { display: inline; } .ce-acts .send .sm { display: none; }
}

/* ---------- od 700 px a dost vysoké: větší osa, nástroje s popisky v řádku ---------- */
@media (min-width: 700px) and (min-height: 521px) {
  .ce-zoom { display: flex; flex-direction: column; justify-content: center; padding: 0 2px; border-right: 1px solid var(--hair); }
  .ce-zoom .ce-ib { width: 34px; height: 28px; border-radius: 8px; } .ce-zoom .ci { width: 16px; height: 16px; }
  .ce-tl-in { height: 96px; }
  .ce-ruler { height: 22px; } .ce-ruler b { font-size: 10.5px; top: 4px; }
  .ce-track { top: 26px; bottom: 10px; }
  .ce-tseg { font-size: 12px; border-radius: 10px; }
  .ce-tl-drop { top: 20px; bottom: 6px; }
  .ce-bar { padding: 6px 10px; }
  .ce-seg { padding: 6px 12px 12px 16px; }
  .ce-w { font-size: 16.5px; }
  .ce-stage .stage { border-radius: 18px; }
  .ce-stage .ov-play i { width: 60px; height: 60px; font-size: 24px; }
}
/* tablet na výšku: video nahoře, pod ním přepis a náhradní bloky vedle sebe */
@media (min-width: 700px) and (max-aspect-ratio: 1/1) {
  .ce { --vh: clamp(300px, 36dvh, 470px); grid-template-columns: minmax(0, 1fr) clamp(260px, 36vw, 340px); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "top top" "view view" "text bin" "tl tl" "bar bar" "acts acts"; }
  .ce-top { padding: 6px 10px; }
  .ce-tabs { display: none; }
  .ce-view { padding: 4px 16px 12px; gap: 6px 22px; }
  .ce-speed { justify-items: end; } .ce-now, .ce-dur, .ce-tr { justify-self: start; }
  .ce-now { font-size: 22px; }
  .ce-play { width: 68px; height: 68px; }
  .ce-text { grid-area: text; padding: 4px 12px 14px 16px; }
  .ce-bin { grid-area: bin; border-left: 1px solid var(--hair); }
  .ce[data-tab] .ce-text { display: block; } .ce[data-tab] .ce-bin { display: flex; }
  .ce-bin-h { flex-direction: column; gap: 2px; padding: 6px 14px 10px; }
  .ce-bin-h b { display: block; font-size: 12.5px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
  .ce-acts { justify-content: flex-end; padding: 10px 16px calc(10px + var(--safe-b)); }
  .ce-acts .btn { flex: none; min-width: 150px; }
  .ce-acts .cancel { display: inline-flex; }
  .ce-acts .send .lg { display: inline; } .ce-acts .send .sm { display: none; }
}
/* tablet na šířku a počítač: transport pod videem */
@media (min-width: 700px) and (min-aspect-ratio: 1001/1000) and (min-height: 521px) {
  .ce { --vw: clamp(250px, calc((var(--app-h, 100dvh) - var(--safe-t) - 52px - 96px - 124px) * .5625 + 28px), 42vw); }
  .ce-head { min-height: 52px; }
  .ce-view { padding: 12px 14px 10px; gap: 8px 10px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas: "stage stage stage" "now tr dur" "speed speed speed"; }
  .ce-tr { flex-direction: row; gap: 6px; }
  .ce-now { align-self: center; justify-self: end; font-size: 18px; }
  .ce-dur { align-self: center; justify-self: start; font-size: 13px; }
  .ce-speed .speed { flex-direction: row; }
  .ce-speed .speed button { height: 38px; min-width: 62px; }
}

/* ---------- tři sloupce: počítač ---------- */
@media (min-width: 1100px) and (min-aspect-ratio: 1001/1000) and (min-height: 521px) {
  .ce { --vw: clamp(280px, calc((var(--app-h, 100dvh) - 56px - 104px - 126px) * .5625 + 32px), 34vw);
    grid-template-columns: var(--vw) minmax(0, 1fr) clamp(290px, 24vw, 380px); grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "head head head" "view text bin" "view bar bin" "tl tl tl"; }
  .ce-head { min-height: 56px; }
  .ce-ttl { flex-direction: row; align-items: baseline; gap: 12px; }
  .ce-ttl b { font-size: 16px; } .ce-meta { font-size: 12.5px; }
  .ce-tabs { display: none; }
  .ce-text { grid-area: text; padding: 14px 18px 18px; }
  .ce-bin { grid-area: bin; border-left: 1px solid var(--hair); background: rgba(14, 14, 15, .5); }
  .ce[data-tab] .ce-text { display: block; } .ce[data-tab] .ce-bin { display: flex; }
  .ce-bin-h { flex-direction: column; gap: 2px; padding: 14px 16px 10px; }
  .ce-bin-h b { display: block; font-size: 13px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
  .ce-bin-list { padding: 0 12px 16px; }
  .ce-sp .ce-mini { width: 36px; height: 36px; } .ce-sp .mt { min-height: 40px; }
  .ce-bar { padding: 8px 18px; }
  .ce-tl-in { height: 104px; }
  .ce-acts { gap: 8px; padding-right: 14px; }
  .ce-acts .btn { height: 38px; }
}

/* nabídka ⋯ (Původní, zkratky) jen na úzkých oknech, kde se Původní nemusí vejít do lišty */
@media (min-width: 760px) { .ce-top .more { display: none; } }

/* ---------- dotyk: nic menšího než 44 px ---------- */
@media (hover: none), (pointer: coarse) {
  .ce-ib { height: 44px; }
  .ce-tabs button { height: 44px; }
  .ce-acts .btn { height: 44px; }
  .ce-zoom .ce-ib { width: 44px; height: 44px; } .ce-zoom .zfit { display: none; }
  .ce-speed .speed button { height: 44px; }
  .ce-head { min-height: 52px; }
}
@media (max-width: 480px) {
  .ce-top .ce-ib { width: 40px; }
  .ce-ttl b { font-size: 13px; }
}

/* vybrané slovo: ⌫ vystřihne jen ho */
.ce-w.wsel { outline: 2px solid #fff; outline-offset: -2px; }

/* ---------- hromadný výběr segmentů ---------- */
.ce-seg.sel { border-color: var(--yellow); background: rgba(46, 40, 12, .94); box-shadow: 0 0 0 2px rgba(255, 212, 0, .5); }
.ce-seg.sel header .n { background: var(--yellow); color: #111; }
.ce-seg.sel header .n { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ce-seg.sel header .n::before { content: "✓"; }
.ce-tseg.sel { background: rgba(120, 102, 10, .97); border-color: var(--yellow); color: #fff; z-index: 2; box-shadow: inset 3px 0 0 var(--sp), 0 0 0 2px rgba(255, 212, 0, .4); }
.ce-tseg.sel::after { content: "✓"; position: absolute; right: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: #111; font-size: 10px; font-weight: 800; line-height: 1; }
.ce-tseg.sel.tiny::after { display: none; }
.ce.selmode .ce-seg header, .ce.selmode .ce-w { cursor: copy; }
.ce-selbar { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; font-size: 12.5px; min-width: 0; }
.ce-selbar[hidden] { display: none; }
.ce-selbar b i { font-style: normal; }
.ce-selbar b { color: var(--yellow); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ce-selbar .tm { flex: 1; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-selbar button { flex: none; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ce-selbar button:disabled { opacity: .3; }
.ce-selbar button[data-a="none"] { border-color: rgba(255, 212, 0, .45); color: var(--yellow); }
.ce-float.multi { box-shadow: 5px 5px 0 -1px rgba(60, 60, 66, .97), 10px 10px 0 -2px rgba(52, 52, 58, .9), 0 16px 40px rgba(0, 0, 0, .6); }
@media (hover: hover) and (pointer: fine) {
  .ce-selbar button:hover:not(:disabled) { background: var(--panel2); }
  .ce-tseg.sel:hover { background: rgba(120, 102, 10, .97); }
}
@media (hover: none), (pointer: coarse) { .ce-selbar button { height: 44px; } }
@media (max-width: 420px) { .ce-selbar { gap: 4px; } .ce-selbar button { padding: 0 9px; } .ce-selbar .tm, .ce-selbar b i { display: none; } .ce-selbar b { flex: 1; } }
@media (min-width: 1100px) and (min-aspect-ratio: 1001/1000) and (min-height: 521px) { .ce-selbar { justify-content: center; } .ce-selbar .tm { flex: none; margin-right: 8px; } }

/* vystřižené slovo uvnitř segmentu: zůstává v textu šedé a přeškrtnuté */
.ce-w.out.hole { text-decoration: line-through rgba(255, 255, 255, .35); text-decoration-thickness: 1.5px; }

/* tlačítko Celé téma v hlavičce editoru */
.ce-raw { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); white-space: nowrap; }
.ce-raw .ci { width: 16px; height: 16px; }
@media (max-width: 700px) { .ce-raw span { display: none; } .ce-raw { padding: 0 9px; } }
