:root {
  --bg: #0a0a0c;
  --panel: #111114;
  --surface: #16161a;
  --surface-2: #1c1c21;
  --line: #26262d;
  --line-2: #33333b;
  --text: #f2f2f0;
  --text-2: #b4b4b8;
  --muted: #7c7c85;
  --accent: #d9ff5a;
  --accent-ink: #141a00;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.spacer { flex: 1; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: #18181c; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; gap: 3px; }
.logo span { width: 3px; border-radius: 2px; background: var(--accent); }
.logo span:nth-child(1) { height: 9px; } .logo span:nth-child(2) { height: 16px; }
.logo span:nth-child(3) { height: 22px; } .logo span:nth-child(4) { height: 12px; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }

nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; text-align: left;
  padding: 9px 10px; border-radius: 9px; color: var(--text-2);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .hide { display: none; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.engine-status { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.engine-line { display: grid; grid-template-columns: 7px 1fr; column-gap: 9px; align-items: center; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.engine-line .st { grid-column: 2; font-size: 11px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.ok { background: var(--accent); box-shadow: 0 0 10px rgba(217, 255, 90, .5); }
.dot.wait { background: #f5c451; animation: pulse 1.2s infinite; }
.dot.err { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.local-badge { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.local-badge svg { width: 15px; height: 15px; }

.main { overflow-y: auto; padding: 34px 40px 140px; }
.view { display: none; max-width: 1240px; margin: 0 auto; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 620; margin: 0; letter-spacing: -.01em; }
.view-head p { margin: 0; }

/* ---------- buttons ---------- */
.primary {
  background: var(--text); color: #0b0b0d; border: 0;
  border-radius: 999px; padding: 10px 18px; font-weight: 600;
  transition: transform .1s, opacity .15s, background .15s;
}
.primary:hover { background: #fff; }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .45; cursor: default; }
.primary.big { width: 100%; padding: 14px 18px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.primary.big .btn-kbd { font-size: 11px; opacity: .45; font-weight: 500; }
.btn, .icon-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 7px 13px; text-decoration: none; color: var(--text);
  font-size: 13px; font-weight: 550; transition: background .15s, border-color .15s;
}
.btn:hover, .icon-btn:hover { background: #24242a; border-color: #44444d; }
.btn.ghost { background: transparent; }
.btn svg { width: 15px; height: 15px; }
.icon-btn { padding: 7px; border-radius: 10px; }
.icon-btn svg { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; }
.link-btn:hover { color: var(--text); }
.danger-link { background: none; border: 0; color: var(--danger); padding: 0; font-size: 13px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; color: var(--text-2); white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: #4a4a54; }
.chip.ghost { background: transparent; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.editor-card, .settings-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.editor-card { display: flex; flex-direction: column; min-height: 560px; overflow: hidden; }
.tagbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tagbar-label { font-size: 12px; color: var(--muted); flex: none; }
.tagbar-tags { display: flex; gap: 6px; }
.tagbar-sep { width: 1px; height: 18px; background: var(--line-2); flex: none; }
textarea#text {
  flex: 1; min-height: 440px; resize: none; border: 0; outline: 0;
  background: transparent; padding: 22px 24px; font-size: 17px; line-height: 1.7;
  color: var(--text);
}
textarea#text::placeholder { color: #55555d; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.editor-actions { display: flex; gap: 18px; }
.preview { border-top: 1px solid var(--line); padding: 16px 20px; max-height: 300px; overflow-y: auto; background: #0e0e11; }
.preview-seg { padding: 6px 0; display: flex; gap: 10px; font-size: 13px; color: var(--text-2); }
.preview-seg .tag { font-size: 11px; color: var(--accent); flex: none; width: 76px; }
.preview-seg.pause { color: var(--muted); font-style: italic; }

.settings-card { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; position: relative; }
.field > label, .slider-head label { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.hint { display: inline-flex; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line-2); align-items: center; justify-content: center; font-size: 10px; color: var(--muted); cursor: help; margin-left: 4px; text-transform: none; }
input[type=text], input[type=number], .search {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; width: 100%; transition: border-color .15s;
}
input[type=text]:focus, input[type=number]:focus, .search:focus { border-color: #5a5a64; }
.search { width: 280px; border-radius: 999px; }

.voice-picker {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; text-align: left; transition: border-color .15s;
}
.voice-picker:hover { border-color: #4a4a54; }
.vp-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.vp-text span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); }
.orb { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.orb.sm { width: 26px; height: 26px; }
.orb.lg { width: 48px; height: 48px; }

.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: #18181d; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 360px; overflow-y: auto; padding: 6px;
}
.dd-group { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.dd-item:hover, .dd-item.sel { background: var(--surface-2); }
.dd-item .t { display: flex; flex-direction: column; min-width: 0; }
.dd-item .t b { font-weight: 560; }
.dd-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.mood-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.mood {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 11px; font-size: 13px; color: var(--text-2); position: relative;
}
.mood:hover { color: var(--text); border-color: #4a4a54; }
.mood.active { background: var(--text); color: #0b0b0d; border-color: var(--text); font-weight: 600; }
.mood.missing { opacity: .4; }
.mood.missing::after { content: ""; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; }
.segmented button { background: none; border: 0; border-radius: 8px; padding: 7px 6px; font-size: 13px; color: var(--text-2); }
.segmented button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 0 0 1px var(--line-2); font-weight: 600; }
.segmented button:disabled { opacity: .35; cursor: default; }
.engine-desc { line-height: 1.45; }

.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-head span { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.slider-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--line-2); border-radius: 4px; outline: none; margin: 8px 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 0 0 4px rgba(255,255,255,.08); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }

.advanced { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; display: flex; justify-content: space-between; }
.advanced summary::after { content: "+"; color: var(--muted); }
.advanced[open] summary::after { content: "–"; }
.advanced[open] { display: flex; flex-direction: column; gap: 16px; }
.seed-row { display: flex; gap: 8px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 34px; height: 20px; background: var(--line-2); border-radius: 999px; position: relative; transition: background .2s; flex: none; }
.toggle .thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track .thumb { transform: translateX(14px); background: var(--accent-ink); }

.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress-bar.indet div { width: 30% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress-row { display: flex; justify-content: space-between; }

/* ---------- hlasy ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.voice-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s;
}
.voice-card:hover { border-color: var(--line-2); }
.vc-head { display: flex; gap: 12px; align-items: center; }
.vc-head .t { flex: 1; min-width: 0; }
.vc-name { font-weight: 620; font-size: 15px; }
.vc-desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 7px; }
.vc-moods { display: flex; flex-wrap: wrap; gap: 6px; }
.mood-play { display: inline-flex; align-items: center; gap: 6px; }
.mood-play svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.mood-play.playing { color: var(--accent); border-color: var(--accent); }
.vc-foot { display: flex; gap: 8px; margin-top: auto; }
.vc-foot .btn { flex: 1; justify-content: center; }
.empty {
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px; grid-column: 1 / -1;
}

/* ---------- historie ---------- */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.h-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.h-item.current { border-color: #4a4a54; }
.h-play { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.h-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.h-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.h-actions { display: flex; gap: 6px; }
.h-warn { color: #f5c451; }

/* ---------- přehrávač ---------- */
.player {
  position: fixed; left: 268px; right: 20px; bottom: 18px;
  background: rgba(20, 20, 24, .92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto minmax(160px, 260px) 1fr auto; gap: 18px; align-items: center;
  padding: 12px 16px; z-index: 30; animation: rise .3s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: #0b0b0d; border: 0; display: flex; align-items: center; justify-content: center; }
.play-btn svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.play-btn .i-pause { display: none; }
.play-btn.playing .i-play { display: none; }
.play-btn.playing .i-pause { display: block; }
.player-info { min-width: 0; }
.player-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wave-wrap canvas { flex: 1; height: 44px; min-width: 0; cursor: pointer; }
.time { font-variant-numeric: tabular-nums; width: 34px; text-align: center; }
.player-actions { display: flex; gap: 8px; }

/* ---------- modaly ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; animation: fade .2s; }
.modal-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: 640px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-card.narrow { width: 500px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.mood-rows { display: flex; flex-direction: column; gap: 6px; }
.mood-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.mood-row .name { font-weight: 560; }
.mood-row .state { font-size: 12px; color: var(--muted); }
.mood-row .state.ok { color: var(--accent); }
.mood-row .acts { display: flex; gap: 6px; }
.mood-row .acts .btn { padding: 5px 10px; font-size: 12px; }
.mood-row.busy { opacity: .6; pointer-events: none; }

.read-text { margin: 0; padding: 16px 18px; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font-size: 16px; line-height: 1.6; }
.rec-visual { position: relative; height: 70px; }
.rec-visual canvas { width: 100%; height: 70px; }
.rec-time { position: absolute; right: 0; top: -2px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.rec-controls { display: flex; justify-content: center; }
.rec-btn { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; display: flex; align-items: center; justify-content: center; }
.rec-btn span { width: 26px; height: 26px; border-radius: 50%; background: var(--danger); transition: all .2s; }
.rec-btn.on { border-color: var(--danger); }
.rec-btn.on span { width: 20px; height: 20px; border-radius: 5px; }

/* ---------- toasty ---------- */
.toasts { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1d1d22; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; max-width: 380px; font-size: 13px; box-shadow: var(--shadow); animation: rise .25s; }
.toast.err { border-color: rgba(255,107,107,.5); }
.toast.warn { border-color: rgba(245,196,81,.5); }

@media (max-width: 1100px) {
  .studio { grid-template-columns: 1fr; }
  .settings-card { position: static; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 16px 160px; }
  .player { left: 12px; right: 12px; grid-template-columns: auto 1fr; }
  .wave-wrap, .player-actions { grid-column: 1 / -1; }
}

/* ---------- filtry ---------- */
.apply-filter { align-self: flex-start; margin-top: 4px; font-size: 12px; padding: 6px 12px; }
.filter-select { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 4px 0 11px; color: var(--text-2); }
.filter-select svg { width: 14px; height: 14px; }
.filter-select select, .derive-row select {
  background: transparent; border: 0; color: var(--text); font-size: 13px; font-weight: 550; padding: 7px 6px; outline: none; cursor: pointer;
}
.filter-select select option, .derive-row select option { background: #1c1c21; }
.derive-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.derive-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.derive-row select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 12px; }
.derive-pitch { flex: 1; min-width: 140px; }
.derive-pitch input { margin: 4px 0; }
.chip-filter { color: var(--accent); }

/* ---------- AI nálady ---------- */
.chip.ai { color: var(--accent); border-color: rgba(217,255,90,.35); background: rgba(217,255,90,.06); font-weight: 600; }
.chip.ai:hover { border-color: var(--accent); color: var(--accent); background: rgba(217,255,90,.12); }
.chip.ai:disabled { opacity: .6; cursor: progress; }
.toast { display: flex; align-items: center; gap: 12px; }
.toast .toast-act { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text); flex: none; }
.toast .toast-act:hover { border-color: #5a5a64; }
.field > label.toggle { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; color: var(--text-2); }

/* ---------- o aplikaci ---------- */
.nav-item .ver { margin-left: auto; font-size: 11px; color: var(--muted); }
.about-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.update-pick { align-self: flex-start; cursor: pointer; }
.mono-path { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.quit-screen { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 100; text-align: center; }
.field > label.btn { text-transform: none; letter-spacing: 0; font-weight: 550; font-size: 13px; color: var(--text); }

/* ---------- Gemini ---------- */
.head-actions { display: flex; gap: 10px; }
.gemini-engine { background: rgba(217,255,90,.07); border: 1px solid rgba(217,255,90,.3); color: var(--accent); border-radius: 11px; padding: 9px 12px; font-size: 13px; font-weight: 550; }
.key-link { color: var(--accent); text-decoration: none; align-self: flex-start; }
.key-link:hover { text-decoration: underline; }
.design-desc { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; resize: vertical; line-height: 1.5; width: 100%; }
.design-desc:focus { border-color: #5a5a64; }
.design-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.design-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.design-row select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; margin-left: 6px; color: var(--text); }
.cand-list { display: flex; flex-direction: column; gap: 8px; }
.cand { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cand.picked { border-color: var(--accent); }
.cand .h-play { width: 40px; height: 40px; }
.cand-save { display: flex; gap: 8px; grid-column: 1 / -1; }
.badge.gem { color: var(--accent); border-color: rgba(217,255,90,.4); }
.status-key { color: var(--accent); }
.status-err { color: var(--danger); }
.cand-save .primary { white-space: nowrap; padding: 10px 18px; }
.cand-save input { flex: 1; }

/* projekty */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.proj-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.proj-card.cur { border-color: var(--accent); }
.proj-top { display: flex; align-items: center; gap: 8px; }
.proj-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-top .pill { font-size: 11px; background: var(--accent); color: #111; border-radius: 6px; padding: 1px 7px; font-weight: 700; }
.proj-prev { margin: 0; color: var(--muted, #9aa); font-size: 13px; line-height: 1.5; max-height: 4.5em; overflow: hidden; }
.proj-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted, #9aa); }
.proj-btns { display: flex; gap: 6px; }
.link-btn.danger { color: #ff7a7a; }
body.web .desk-only{display:none!important}

/* ---------- mobil: spodní lišta místo bočního panelu ---------- */
@media (max-width: 760px) {
  .sidebar { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 40; flex-direction: row; align-items: stretch;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; overflow: visible; }
  .sidebar .brand, .sidebar .engine-status, .sidebar .local-badge, .sidebar [data-open-app="titulkarna"] { display: none !important; }
  .sidebar nav, .sidebar .dilna-nav, .sidebar .sidebar-foot { display: contents; }
  .sidebar .nav-item { flex: 1 1 0; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 7px 2px; font-size: 0; min-width: 0; margin: 0; }
  .sidebar .nav-item svg { width: 21px; height: 21px; margin: 0; }
  .sidebar .nav-item::after { content: attr(data-short); font-size: 10.5px; line-height: 1.1; }
  .sidebar .nav-item .ver { display: none; }
  .player { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: 240px; }
}
