/* Editor jmenovek – rozvržení a komponenty. Barvy a písma jen přes proměnné z genlive.css. */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--gl-black); color: var(--gl-white); position: sticky; top: 0; z-index: 40; }
.topbar .brand { font-family: var(--font-display); font-size: 1.55rem; line-height: 1; color: var(--gl-red); padding-bottom: 2px; }
.topbar .topname { font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: .08em; color: #b5b5b5; }
.spacer { flex: 1; }
.topbar button.themetoggle { border-color: #454545; }
main { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 18px 20px 40px; min-width: 0; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 20px; align-items: start; }
.left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1000px) { .work { grid-template-columns: 1fr; } main { padding: 12px 12px 30px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* přepínač vzhledu (jako v Echu) */
.themetoggle { position: relative; flex: none; width: 52px; height: 28px; min-height: 0; padding: 0; border-radius: 14px; border: 1px solid #454545; background: #1a1a1a; transition: background .3s, border-color .3s; }
.themetoggle:hover { border-color: var(--gl-white); }
.themetoggle::before { content: ""; position: absolute; top: 4px; left: 5px; width: 18px; height: 18px; border-radius: 50%; background: #1a1a1a; box-shadow: inset 7px -1px 0 0 var(--gl-whale); transition: transform .3s, background .3s, box-shadow .3s; }
:root[data-theme="light"] .themetoggle { background: var(--gl-whale); border-color: var(--gl-whale); }
:root[data-theme="light"] .themetoggle::before { transform: translateX(22px); background: var(--gl-red); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .themetoggle, .themetoggle::before { transition: none; } }

/* náhled */
.preview { padding: 0 0 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); padding: 0 12px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; margin-bottom: -1px; font-size: 1.15rem; padding: 10px 16px; color: var(--muted); }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); background: transparent; }
.stage-wrap { padding: 12px 12px 0; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line-strong); background-size: cover; background-position: center; touch-action: pan-y; user-select: none; }
.stage.checker { background-color: #bdbdbd; background-image: conic-gradient(#8a8a8a 25%, #bdbdbd 0 50%, #8a8a8a 0 75%, #bdbdbd 0); background-size: 32px 32px; }
.stage.grey { background: #808080; }
.stage.black { background: #000; }
.stage.image { background-color: #222; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.draggable { cursor: default; }
.stage.over { cursor: ew-resize; }
.hit { position: absolute; pointer-events: none; border: 2px solid var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.hit span { position: absolute; left: -2px; bottom: 100%; margin-bottom: 2px; font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; line-height: 1; padding: 3px 6px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.hit.low span { bottom: auto; top: 100%; margin: 2px 0 0; }
.transport { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0; flex-wrap: wrap; }
.transport .playbtn { min-width: 92px; }
.transport .seek { flex: 1 1 160px; min-width: 120px; width: auto; height: 18px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; margin: 0; }
.seek::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) var(--pos, 0%), var(--line-strong) var(--pos, 0%)); }
.seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: -4px; }
.seek::-moz-range-track { height: 4px; background: var(--line-strong); }
.seek::-moz-range-progress { height: 4px; background: var(--accent); }
.seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); }
.time { font-size: .82rem; color: var(--muted); white-space: nowrap; min-width: 9.5em; text-align: right; }
.loop { white-space: nowrap; }
.bgrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; flex-wrap: wrap; }
.seg { display: flex; }
.seg button { border-radius: 0; margin-left: -1px; padding: 5px 10px; min-height: 28px; font-size: .88rem; }
.seg button:first-child { margin-left: 0; }

/* export a historie */
.exportpanel, .historypanel { padding: 14px 16px; }
.exstate { margin: 8px 0; min-height: 1.4em; }
.exstate.err { color: var(--bad); }
.exstate.run { color: var(--fg); font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; }
.bar { height: 3px; background: var(--line); margin-top: 6px; max-width: 100%; }
.bar.big { height: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; width: 0; }
.exfiles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
table.hist { width: 100%; border-collapse: collapse; }
table.hist th { text-align: left; font-family: var(--font-condensed); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-size: .88rem; padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
table.hist td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.hist .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.hist .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 8px 0; }

/* formulář */
.side { position: sticky; top: 64px; max-height: calc(100vh - 78px); overflow: auto; }
@media (max-width: 1000px) { .side { position: static; max-height: none; } }
.formpanel { padding: 4px 16px 16px; }
.section { padding-top: 14px; }
.section > h2 { color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 10px; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.field .inline { display: flex; gap: 8px; }
.off .ctl { display: grid; grid-template-columns: auto minmax(90px, 1fr) 84px auto; gap: 6px; align-items: center; }
.off .ctl input[type=range] { width: 100%; }
.off .ctl .step { min-width: 32px; padding: 5px 0; }
.off .ctl2 { display: flex; justify-content: space-between; margin-top: 6px; }
.field.off { padding: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.field.off.hot { border-color: var(--accent); }
.warn { background: var(--warn-soft); color: var(--warn); border-left: 3px solid var(--warn); padding: 8px 10px; margin: 12px 0 0; font-size: .92rem; }

/* přihlášení a uživatel v hlavičce */
.topbar .who { font-family: var(--font-condensed); text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; color: #d0d0d0; white-space: nowrap; }
.topbar .who:empty { display: none; }
.topbar button.logout { border-color: #454545; color: var(--gl-white); }
.loginwrap { display: flex; justify-content: center; padding-top: min(14vh, 120px); }
.loginbox { width: 100%; max-width: 380px; padding: 24px 24px 22px; }
.loginbox h1 { margin-bottom: 4px; }
.loginbox p { margin: 0 0 18px; }
.loginbox .wide { width: 100%; margin-top: 4px; }
.loginerr { background: var(--bad-soft); color: var(--bad); border-left: 3px solid var(--bad); padding: 8px 10px; margin: 0 0 12px; font-size: .92rem; }
.loginbox .or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.loginbox .or::before, .loginbox .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.loginbox #gnote { margin-top: 6px; text-align: center; }
