/* Hand-written base stylesheet. The Tailwind build in ./front emits to
   ../static/dist/output.css; this keeps the app legible on its own. */
:root {
  --bg:#0f1115; --card:#1a1e27; --fg:#e6e8ec; --muted:#9aa3b2;
  --accent:#6366f1; --accent-hover:#4f46e5; --border:#2a3140; --danger:#f87171;
}
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--fg); }
a { color:var(--accent); }

.topbar { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--border); }
.topbar .brand { font-weight:700; color:var(--fg); text-decoration:none; letter-spacing:.3px; }

/* ── Logo: "ebooks" wordmark. The "e" is a gradient badge (a different colour
   from "books"); it pops in on page load and wiggles on hover. */
.brand-logo { height:46px; width:auto; display:block; transition:transform .25s ease; }
.brand:hover .brand-logo { transform:scale(1.03); }
/* Sidebar: logo spans (nearly) the full menu width. Mobile sidebar is the same
   232px, so this size works there too. */
.sidebar .brand { display:block; padding:6px 6px 14px; }
.sidebar .brand-logo { width:100%; height:auto; }
/* Public horizontal top bar: keep it compact. */
.topbar .brand-logo { height:42px; }
.topbar .brand { display:inline-flex; align-items:center; gap:6px; line-height:1; letter-spacing:0; }
.topbar .brand .logo-e {
    font-size:17px; font-weight:800; color:#fff;
    width:25px; height:25px; border-radius:7px;
    display:inline-flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow:0 2px 8px rgba(99,102,241,.45);
    animation:logo-pop .7s cubic-bezier(.34,1.56,.64,1) both;
    transition:transform .25s ease, box-shadow .25s ease;
}
.topbar .brand .logo-rest {
    font-size:20px; font-weight:800; color:var(--fg); letter-spacing:.2px;
    animation:logo-fade .7s ease .1s both;
}
.topbar .brand:hover .logo-e { transform:rotate(-8deg) scale(1.12); box-shadow:0 4px 14px rgba(139,92,246,.6); }
@keyframes logo-pop {
    0%   { opacity:0; transform:translateY(-8px) scale(.4) rotate(-20deg); }
    60%  { opacity:1; transform:translateY(0) scale(1.18) rotate(6deg); }
    100% { opacity:1; transform:translateY(0) scale(1) rotate(0); }
}
@keyframes logo-fade {
    0%   { opacity:0; transform:translateX(-6px); }
    100% { opacity:1; transform:translateX(0); }
}

.topbar { position:relative; }
.mainnav { margin-left:auto; display:flex; align-items:center; flex-wrap:wrap; gap:0 16px; }
.topbar nav a { color:var(--muted); text-decoration:none; }
.topbar nav a:hover { color:var(--fg); }

/* ── App layout: left sidebar + main area ──────────────────────────────────── */
.layout { display:flex; min-height:100vh; }
.sidebar {
    width:232px; flex:0 0 232px; background:var(--card); border-right:1px solid var(--border);
    padding:18px 14px; display:flex; flex-direction:column; gap:16px;
    position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar .brand { display:inline-flex; align-items:center; gap:6px; text-decoration:none; padding:2px 6px 10px; }
.sidenav { display:flex; flex-direction:column; gap:2px; }
.sidenav a { color:var(--muted); text-decoration:none; padding:9px 12px; border-radius:8px; font-size:14.5px; display:flex; align-items:center; gap:8px; }
.sidenav a:hover { color:var(--fg); background:#222838; }
.sidenav .nav-divider { color:var(--accent); font-size:11px; font-weight:800; letter-spacing:1px; text-transform:uppercase; opacity:.7; padding:14px 12px 4px; }
.sidenav-logout { margin-top:8px; }

.main-area { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
.topbar-mini { display:flex; align-items:center; gap:12px; padding:12px 22px; border-bottom:1px solid var(--border); }
.tm-spacer { flex:1; }
.tm-cart { color:var(--muted); text-decoration:none; font-size:18px; position:relative; }
.tm-cart:hover { color:var(--fg); }
.tm-badge { font-size:11px; background:var(--accent); color:#fff; border-radius:999px; padding:0 6px; vertical-align:top; }
.profile-icon {
    width:36px; height:36px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg, var(--accent), #8b5cf6); color:#fff; font-weight:800; font-size:15px;
    text-decoration:none; box-shadow:0 2px 8px rgba(99,102,241,.4); transition:transform .2s ease;
}
.profile-icon:hover { transform:scale(1.08); }
.main-area .container { margin:0 auto; }

.nav-burger { display:none; cursor:pointer; font-size:22px; color:var(--fg); user-select:none; padding:2px 8px; }
@media (max-width:860px) {
    /* On mobile the sidebar is an off-canvas overlay, so the layout is a normal
       full-width block (no flex) — this makes the top bar span the full width
       and stops the content from sticking out. */
    .layout { display:block; max-width:100vw; }
    .main-area { width:100%; min-width:0; max-width:100vw; }
    .main-area .container, .container { max-width:100%; }
    html, body { overflow-x:hidden; max-width:100vw; }
    .sidebar {
        position:fixed; z-index:100; left:0; top:0; transform:translateX(-100%); transition:transform .22s ease;
        box-shadow:0 0 40px rgba(0,0,0,.5);
    }
    .nav-toggle:checked ~ .layout .sidebar { transform:translateX(0); }
    .nav-burger { display:block; }
}

.container { max-width:880px; margin:0 auto; padding:32px 20px; }
/* Administrácia je pracovný nástroj — tabuľky, logy a kroky potrebujú miesto,
   tak dostane celú šírku okna. Cielime na konkrétne pracovné stránky, nie na
   celý prihlásený layout: obchod a knižnica čitateľa majú zostať úzke. */
body:has(.admin-tabs) .main-area .container,
body:has(.job-table) .main-area .container,
body:has(.matrix) .main-area .container,
body:has(.pass-list) .main-area .container,
body:has(.notes-book) .main-area .container,
body:has(.stats-table) .main-area .container { max-width:min(1800px, 100%); }
.card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:28px; }
.auth-card { max-width:400px; margin:48px auto; }
.hero { text-align:center; padding:64px 0; }
h1 { margin-top:0; }

.form { display:flex; flex-direction:column; gap:14px; }
.form label { display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--muted); }
.form input { padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font-size:15px; }
.form input:focus { outline:none; border-color:var(--accent); }

.btn { display:inline-block; text-align:center; padding:10px 16px; border-radius:8px; border:1px solid var(--border); background:#222838; color:var(--fg); text-decoration:none; cursor:pointer; font-size:15px; }
.btn:hover { border-color:var(--accent); }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.btn-block { width:100%; }
.btn-google { display:flex; align-items:center; justify-content:center; gap:10px; background:#fff; color:#1f1f1f; border-color:#dadce0; font-weight:600; }
.btn-google:hover { background:#f7f8f8; border-color:#dadce0; }
.btn-google .g-icon { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:conic-gradient(from -45deg,#ea4335 0 25%,#fbbc05 0 50%,#34a853 0 75%,#4285f4 0); color:#fff; font-weight:800; font-size:12px; }

.divider { display:flex; align-items:center; text-align:center; color:var(--muted); margin:18px 0; }
.divider::before, .divider::after { content:""; flex:1; border-bottom:1px solid var(--border); }
.divider span { padding:0 12px; font-size:13px; }

.error { color:var(--danger); background:rgba(248,113,113,.1); padding:8px 12px; border-radius:8px; font-size:14px; }
.muted { color:var(--muted); }
.auth-alt { text-align:center; margin-top:18px; font-size:14px; color:var(--muted); }
.badge { background:var(--accent); color:#fff; font-size:12px; padding:2px 8px; border-radius:999px; }

/* ── Book translation ─────────────────────────────────────────────────────── */
.container { max-width:960px; }

/* Library & admin list pages (Knižnica, Používatelia, Balíčky) stretch to the
   full screen width so wide tables have room. Form pages (upload EPUB, import —
   they contain a file input) keep the narrow, readable column. */
.container:has(.job-table):not(:has(input[type="file"])) {
    max-width:100%;
    padding-left:32px;
    padding-right:32px;
}
.form textarea, .prompt-area { padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font:13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize:vertical; }
.form input[type="file"] { padding:10px 12px; border-radius:8px; border:1px dashed var(--border); background:#0f131b; color:var(--fg); }
.form select { padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font-size:15px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:640px){ .grid2 { grid-template-columns:1fr; } }
fieldset.modes { border:1px solid var(--border); border-radius:8px; padding:12px 14px; }
fieldset.modes legend { padding:0 6px; font-size:13px; color:var(--muted); }
.radio { display:flex; align-items:center; gap:8px; font-size:14px; color:var(--fg); padding:3px 0; }
.radio.disabled { color:var(--muted); }
.btn-sm { padding:5px 11px; font-size:13px; }

/* Široké tabuľky sa na mobile posúvajú do strany vo vlastnom okne — inak sa
   z telefónu nedá pozrieť ani prvý stĺpec. */
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -4px; }
.job-table { width:100%; border-collapse:collapse; font-size:14px; min-width:820px; }
.job-table td:first-child { min-width:220px; }
.job-table .lib-actions { white-space:nowrap; }
@media (max-width:860px) {
    /* Prilepený prvý stĺpec sa neosvedčil: na úzkom displeji zabral skoro celú
       šírku a nebolo za čo tabuľku chytiť. Posúva sa teda celá aj s názvom. */
    .job-table { min-width:760px; font-size:13px; }
    .job-table th, .job-table td { padding:7px 8px; }
    .job-table td:first-child { min-width:170px; }
    .table-scroll { margin:0 -16px; padding:0 16px; }
}
.job-table th, .job-table td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--border); }
.job-table th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; }

.type-badge { font-size:12px; padding:2px 9px; border-radius:999px; background:#222838; color:var(--muted); }
.type-badge.retell { background:rgba(139,92,246,.18); color:#a78bfa; }
.status-badge { font-size:12px; padding:2px 10px; border-radius:999px; text-transform:uppercase; letter-spacing:.3px; }
.s-pending { background:rgba(148,163,184,.15); color:#94a3b8; }
.s-running { background:rgba(245,158,11,.15); color:#f59e0b; }
.s-done { background:rgba(34,197,94,.15); color:#22c55e; }
.s-error { background:rgba(248,113,113,.15); color:#f87171; }

.decisions { white-space:pre-wrap; background:#0f131b; border:1px solid var(--border); border-radius:8px; padding:12px; font:13px/1.5 ui-monospace, monospace; color:var(--muted); overflow-x:auto; }
.result-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.result-html { background:#0f131b; border:1px solid var(--border); border-radius:8px; padding:20px 24px; line-height:1.7; max-height:70vh; overflow-y:auto; }
.result-html h1, .result-html h2, .result-html h3 { margin:1.2em 0 .5em; }
.result-html p { margin:0 0 1em; }
.colophon { margin-top:2.5em; text-align:center; color:var(--muted); font-size:.9em; line-height:1.6; }
.colophon .ver { font-size:.85em; opacity:.8; }

/* ── Storefront / cart ────────────────────────────────────────────────────── */
.shop-head { text-align:center; padding:16px 0 26px; max-width:100%; }
/* Fluid heading: scales with the viewport so it can never overflow narrow
   screens; capped on desktop. Long words break instead of being clipped. */
.shop-head h1 { margin:0 0 6px; font-size:clamp(1.5rem, 6vw, 2.4rem); line-height:1.15;
    overflow-wrap:break-word; word-break:break-word; }
.shop-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(310px, 1fr)); gap:18px; }
/* Karta knihy je na šírku: vľavo celý obal (nič sa neoreže), vpravo text.
   Preto je aj celá karta skôr štvorcová než vysoký obdĺžnik. */
.book-card { background:var(--card); border:1px solid var(--border); border-radius:12px; overflow:hidden; display:flex; flex-direction:row; align-items:stretch; min-height:238px; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.book-card:hover { transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,0,0,.35); border-color:var(--accent); }
.book-cover-link { flex:0 0 142px; display:flex; padding:12px; }
.book-cover { position:relative; flex:1; display:flex; align-items:center; justify-content:center; font-size:46px; border-radius:8px;
    background:linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.12)); }
.audio-flag { position:absolute; top:4px; right:4px; font-size:15px; line-height:1; padding:5px; border-radius:50%;
    background:rgba(15,17,21,.72); box-shadow:0 1px 4px rgba(0,0,0,.4); cursor:default; }
.book-body { padding:14px 15px 15px 4px; display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.book-title { margin:0; font-size:15px; line-height:1.35;
    /* Always reserve two lines so price + CTA line up across cards. */
    min-height:2.7em; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.book-author { font-size:13px; color:var(--muted); min-height:1.25em;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.book-lang { font-size:12px; }
.book-price { margin:8px 0 10px; display:flex; align-items:baseline; gap:8px; }
.book-price .price { font-size:18px; font-weight:800; color:var(--fg); }
.book-price .orig { font-size:13px; color:var(--muted); text-decoration:line-through; }
.book-price .free { font-size:15px; font-weight:800; color:#22c55e; }
/* The call-to-action always sits on the card's bottom edge — whether it is a
   form (Do košíka / Prevziať) or a plain link (V knižnici / V košíku). */
.book-body > form, .book-body > a.btn { margin-top:auto; }
.book-body form { margin-bottom:0; }
.btn.in-cart { background:rgba(34,197,94,.15); color:#22c55e; border-color:rgba(34,197,94,.3); }
.job-table tfoot td { padding-top:12px; font-size:15px; }
button.btn[disabled] { opacity:.5; cursor:not-allowed; }
.shop-head .lead { font-size:16px; color:var(--fg); margin:4px 0; max-width:640px; margin-left:auto; margin-right:auto; overflow-wrap:break-word; }
.book-langs { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin-top:2px; }

/* Product-detail action buttons: full-width stacked on phones, side-by-side
   (wrapping) from tablet width up. */
.detail-actions { display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.detail-actions form { margin:0; }
.detail-actions > .btn, .detail-actions form .btn { width:100%; }
@media (min-width:620px) {
    .detail-actions { flex-direction:row; flex-wrap:wrap; align-items:center; }
    .detail-actions > .btn, .detail-actions form, .detail-actions form .btn { width:auto; }
}
.lang-chip { font-size:11px; padding:1px 7px; border-radius:999px; background:#222838; color:var(--muted); text-transform:capitalize; }
.pkg-badge { font-size:11px; padding:1px 7px; border-radius:999px; background:rgba(99,102,241,.18); color:var(--accent); font-weight:700; }
.free { color:#22c55e; font-weight:700; }

/* Sources / editions on the book detail */
.src-list { display:flex; flex-direction:column; gap:2px; margin:8px 0 16px; }
.src-row { display:grid; grid-template-columns:110px 130px 1fr 130px 40px; gap:10px; align-items:center; padding:7px 8px; border-bottom:1px solid var(--border); font-size:14px; }
.src-head { color:var(--muted); font-size:12px; text-transform:uppercase; border-bottom:1px solid var(--border); }
.src-ours { background:rgba(99,102,241,.08); border-radius:6px; }
.src-kind { font-size:12px; padding:2px 8px; border-radius:999px; background:#222838; color:var(--muted); text-align:center; }
.src-ours .src-kind { background:rgba(99,102,241,.2); color:var(--accent); }
@media (max-width:640px){ .src-row { grid-template-columns:1fr 1fr; } }
.src-add { margin-top:8px; }
.info-view { display:flex; flex-direction:column; gap:4px; margin-bottom:14px; font-size:14px; }
.info-summary { margin-top:6px; line-height:1.6; color:var(--fg); }
.form textarea { padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font-family:inherit; font-size:14px; resize:vertical; }

/* ── PRO / covers / product detail / shelf ─────────────────────────────────── */
/* Odkaz na PRO v menu — jediná zlatá položka, aby bola vidieť. */
.sidenav a.nav-pro { color:#f7b955; font-weight:700; background:rgba(245,158,11,.08); border:1px solid rgba(245,158,11,.28); margin-bottom:6px; }
.sidenav a.nav-pro:hover { color:#1a1206; background:linear-gradient(135deg,#f59e0b,#f97316); border-color:transparent; }
.mainnav a.nav-pro { color:#f7b955; font-weight:700; }

/* PRO karta na dashboarde */
.pro-card { border:1px solid rgba(245,158,11,.35); background:linear-gradient(135deg,rgba(245,158,11,.10),rgba(249,115,22,.04)); border-radius:12px; padding:18px 20px; margin-bottom:18px; }
.pro-card h2 { margin:0 0 6px; font-size:17px; display:flex; align-items:center; gap:8px; }
.pro-card p { margin:0 0 10px; }
.pro-card .pro-until { font-weight:700; color:#f7b955; }
.pro-card ul { margin:8px 0 12px; padding-left:20px; color:var(--muted); font-size:14px; }
.pro-card li { margin:3px 0; }
.plan-hint { border:1px solid rgba(245,158,11,.35); background:rgba(245,158,11,.08); border-radius:10px; padding:11px 14px; margin-bottom:16px; font-size:14px; }
.plan-hint strong { color:#f7b955; }

.pro-tag { font-size:11px; font-weight:800; padding:1px 6px; border-radius:5px; background:linear-gradient(135deg,#f59e0b,#f97316); color:#1a1206; letter-spacing:.3px; }
.pro-teaser { display:inline-block; margin-top:2px; font-size:12.5px; font-weight:700; color:#f59e0b; text-decoration:none; }
.pro-teaser:hover { text-decoration:underline; }
.pro-teaser-lg { font-size:14px; margin-bottom:10px; }

/* ── PRO landing page ──────────────────────────────────────────────────────── */
.pro-hero { text-align:center; max-width:620px; margin:24px auto; }
.pro-badge-lg { display:inline-block; font-size:14px; font-weight:800; letter-spacing:1px; padding:5px 14px; border-radius:999px; background:linear-gradient(135deg,#f59e0b,#f97316); color:#1a1206; }
.pro-hero h1 { margin:16px 0 8px; }
.pro-benefits { list-style:none; padding:0; margin:22px auto; text-align:left; max-width:420px; display:flex; flex-direction:column; gap:10px; font-size:15px; }
.pro-cta { margin-top:18px; }
.pro-have { margin-top:18px; font-size:16px; }
.book-cover img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain;
    border-radius:4px; box-shadow:0 4px 12px rgba(0,0,0,.45); }

.book-title a { color:var(--fg); text-decoration:none; }
.book-title a:hover { color:var(--accent); }

.product-hero { margin:0 0 20px; border-radius:14px; overflow:hidden; max-height:320px; }
.product-hero img { width:100%; height:auto; display:block; }
.product-detail { display:grid; grid-template-columns:220px 1fr; gap:26px; align-items:start; }
.product-cover img { width:100%; border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.4); }

/* Detail WITH a hero: banner on top, cover overlaps its lower edge. */
.product-detail.has-hero { display:block; }
.product-detail.has-hero .product-hero { width:100%; height:240px; margin:0; }
.product-detail.has-hero .product-hero img { width:100%; height:100%; object-fit:cover; }
.product-detail.has-hero .product-cover { float:left; width:190px; margin:-96px 26px 14px 8px; position:relative; z-index:2; }
.product-detail.has-hero .product-info-col { overflow:hidden; padding-top:14px; }
@media (max-width:640px){
    .product-detail.has-hero .product-cover { float:none; width:150px; margin:-70px auto 14px; display:block; }
    .product-detail.has-hero .product-info-col { text-align:center; }
}

/* ── HERO: time-limited free titles with a countdown ───────────────────────── */
.hero-wrap { margin:8px 0 30px; }
.hero-carousel { display:flex; gap:18px; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:8px; }
.hero-carousel .hero-card { flex:0 0 min(560px, 88%); scroll-snap-align:start; }
.hero-card {
    position:relative; display:flex; gap:20px; align-items:center;
    min-height:220px; border-radius:16px; overflow:hidden; padding:22px 24px;
    background:linear-gradient(90deg, rgba(99,102,241,.22), rgba(139,92,246,.12)), var(--card);
    background-size:cover; background-position:center right; border:1px solid var(--border);
}
.hero-cover { flex:0 0 auto; }
.hero-cover img { width:120px; border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.5); display:block; }
.hero-body { min-width:0; }
.hero-flag { display:inline-block; font-size:12px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; color:#f59e0b; background:rgba(245,158,11,.12); padding:3px 9px; border-radius:999px; }
.hero-title { margin:8px 0 2px; font-size:26px; line-height:1.15; }
.hero-title a { color:var(--fg); text-decoration:none; }
.hero-author { color:var(--muted); font-size:15px; }
.hero-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:14px; }
.hero-struck { color:var(--muted); text-decoration:line-through; font-size:14px; }

.countdown { margin:12px 0; font-size:15px; color:var(--fg); }
.countdown .cd-label { color:var(--muted); font-size:13px; }
.countdown .cd-time { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-weight:800; font-size:20px; color:#f59e0b; letter-spacing:.5px; }
.countdown.cd-ended .cd-time { color:var(--danger); }
.cd-detail { background:#0f131b; border:1px solid var(--border); border-radius:10px; padding:12px 14px; }
.card-countdown { margin-top:4px; }
.card-countdown .cd-label { font-size:11px; color:#f59e0b; }
.card-countdown .cd-time { font-size:13px; }
@media (max-width:560px){ .hero-card { flex-direction:column; align-items:flex-start; text-align:left; } .hero-cover img { width:96px; } }
/* Anchor the hero card width to the VIEWPORT (not the container) so a mis-sized
   container can never push it past the screen edge on mobile. */
@media (max-width:860px){ .hero-carousel .hero-card { flex-basis:86vw; } .hero-single .hero-card { max-width:100%; } }
img, svg, video { max-width:100%; }
.product-desc { line-height:1.7; }
.prod-meta { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 4px; }
.meta-chip { font-size:13px; padding:3px 10px; border-radius:999px; background:#222838; color:var(--muted); }
.meta-chip.audio-chip { background:rgba(34,197,94,.15); color:#22c55e; }
.shelf-audio { display:flex; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap; }
.shelf-audio audio { height:34px; max-width:320px; }
.ra-now { margin:8px 0 4px; font-size:15px; color:var(--fg); min-height:1.4em; font-style:italic; }
.ra-details { margin-top:4px; }
.ra-transcript { max-height:240px; overflow-y:auto; margin-top:8px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:#0f131b; }
.ra-line { margin:0 0 6px; padding:3px 6px; border-radius:6px; cursor:pointer; color:var(--muted); font-size:14px; line-height:1.5; }
.ra-line:hover { color:var(--fg); background:#222838; }
.ra-line.active { color:var(--fg); background:rgba(99,102,241,.18); font-weight:600; }
.bundle-members { line-height:1.9; }
@media (max-width:640px){ .product-detail { grid-template-columns:1fr; } .product-cover { max-width:220px; } }

.shelf-list { display:flex; flex-direction:column; gap:14px; margin-top:14px; }
.shelf-item { display:grid; grid-template-columns:70px 1fr; gap:16px; padding:14px; border:1px solid var(--border); border-radius:12px; }
.shelf-cover { width:70px; height:96px; border-radius:8px; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:32px; background:linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.12)); }
.shelf-cover img { width:100%; height:100%; object-fit:cover; }
.shelf-actions { display:flex; gap:8px; margin:10px 0; flex-wrap:wrap; align-items:center; }
.shelf-sep { width:1px; align-self:stretch; background:var(--border); margin:2px 4px; }
.shelf-sources { display:flex; flex-direction:column; gap:3px; margin-top:6px; }
.shelf-src { display:flex; align-items:center; gap:8px; font-size:13px; }

/* ── Reusable rail (Netflix-style horizontal row) ──────────────────────────── */
.rail-section { margin:26px 0; }
.rail-head { display:flex; align-items:baseline; justify-content:space-between; margin:0 2px 12px; }
.rail-head h2 { margin:0; font-size:19px; }
.rail { position:relative; }
.rail-track {
    display:flex; gap:16px; overflow-x:auto; scroll-behavior:smooth;
    scroll-snap-type:x proximity; padding:4px 2px 14px; scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}
/* Natívny posuvník skryjeme a kreslíme si vlastný, ktorý sa — ako na iPhone —
   objaví iba počas posúvania a potom zmizne (viď .rail-bar nižšie). */
.rail-track::-webkit-scrollbar { height:0; width:0; }
.rail-item { flex:0 0 322px; scroll-snap-align:start; max-width:88vw; }
@media (max-width:420px){ .rail-item { flex-basis:284px; } .book-cover-link { flex-basis:122px; } }
.rail-item .book-card { height:100%; }
/* Výrazné okrúhle tlačidlo namiesto sotva viditeľného prechodu. */
.rail-arrow {
    position:absolute; top:calc(50% - 7px); transform:translateY(-50%);
    width:46px; height:46px; border-radius:50%; z-index:5;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    color:#fff; font-size:27px; line-height:1; padding-bottom:3px;
    background:rgba(18,21,28,.94); border:1px solid rgba(255,255,255,.18);
    box-shadow:0 6px 20px rgba(0,0,0,.55);
    opacity:0; pointer-events:none;
    transition:opacity .18s ease, transform .18s ease, background .18s ease, border-color .18s ease;
}
.rail-arrow.rail-prev { left:4px; }
.rail-arrow.rail-next { right:4px; }
.rail-arrow[hidden] { display:none !important; }
.rail:hover .rail-arrow, .rail:focus-within .rail-arrow { opacity:1; pointer-events:auto; }
.rail-arrow:hover { background:var(--accent); border-color:var(--accent); color:#fff;
    transform:translateY(-50%) scale(1.08); }
.rail-arrow:active { transform:translateY(-50%) scale(.96); }

/* Posuvník v štýle iPhonu: neviditeľný, kým sa neposúva. */
.rail-bar {
    position:absolute; left:2px; right:2px; bottom:2px; height:4px;
    opacity:0; transition:opacity .4s ease; pointer-events:none;
}
.rail.is-scrolling .rail-bar { opacity:1; transition:opacity .12s ease; }
.rail-bar span {
    position:absolute; top:0; height:100%; min-width:24px; border-radius:4px;
    background:rgba(235,238,245,.45);
}
@media (max-width:860px) { .rail-arrow { display:none !important; } }

/* ── Language tabs (product i18n editor) ───────────────────────────────────── */
.lang-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:4px 0 14px; border-bottom:1px solid var(--border); }
.lang-tab { padding:7px 14px; border-radius:8px 8px 0 0; text-decoration:none; color:var(--muted); font-size:14px; border:1px solid transparent; border-bottom:none; }
.lang-tab:hover { color:var(--fg); }
.lang-tab.active { color:var(--fg); background:#0f131b; border-color:var(--border); font-weight:600; }

/* ── "What you get" list ───────────────────────────────────────────────────── */
.includes-list { display:flex; flex-direction:column; gap:8px; }
.include-row { display:flex; align-items:flex-start; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; }
.include-row .inc-icon { font-size:20px; line-height:1.2; }
.include-row .inc-body { flex:1; min-width:0; }
.include-row .inc-body strong { font-size:14.5px; }

/* ── Free preview page ─────────────────────────────────────────────────────── */
.preview-banner { background:rgba(245,158,11,.12); color:#f59e0b; border:1px solid rgba(245,158,11,.3); border-radius:10px; padding:10px 14px; font-size:14px; margin-bottom:18px; }
.preview-reader { max-width:40rem; margin:0 auto; font-family:Georgia, "Times New Roman", serif; line-height:1.75; font-size:19px; color:var(--fg); }
.preview-reader h1 { text-align:center; font-size:1.8em; margin:0 0 .1em; }
.preview-reader h2 { text-align:center; font-weight:normal; color:var(--muted); font-size:1.1em; margin:0 0 1.4em; }
.preview-reader p { margin:0 0 1.1em; text-align:justify; hyphens:auto; }
.preview-reader em, .preview-reader i { font-style:italic; }
.preview-cta { position:relative; max-width:40rem; margin:0 auto; padding:34px 0 10px; text-align:center; }
.preview-fade { position:absolute; left:0; right:0; top:-120px; height:120px; background:linear-gradient(to bottom, rgba(15,17,21,0), var(--bg)); pointer-events:none; }

/* ── Versions picker ───────────────────────────────────────────────────────── */
.ver-list { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.ver-row { display:flex; align-items:center; gap:10px; padding:9px 12px; border:1px solid var(--border); border-radius:8px; cursor:pointer; }
.ver-row:hover { border-color:var(--accent); }
.ver-row.ver-main { background:rgba(99,102,241,.08); border-color:var(--accent); }
.ver-row .ver-pick { display:flex; align-items:center; gap:10px; cursor:pointer; }
.ver-row .ver-name { font-size:14px; color:var(--fg); }
.ver-row .ver-ver { font-size:13px; }
.ver-row a.btn { margin-left:auto; }

/* ── Admin detail tabs ─────────────────────────────────────────────────────── */
.admin-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:16px 0 4px; position:sticky; top:0; z-index:5;
    background:var(--bg); padding:8px 0; }
.admin-tabs .atab { font:inherit; cursor:pointer; border:1px solid var(--border); background:var(--card);
    color:var(--muted); border-radius:9px; padding:8px 14px; font-size:14px; }
.admin-tabs .atab:hover { color:var(--fg); border-color:var(--accent); }
.admin-tabs .atab.active { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }

/* Publishing pipeline (7 steps) shown at the top of the admin detail */
.steps-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:16px 0 4px;
    padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--card); }
.step-item { display:flex; align-items:center; gap:7px; padding:5px 10px; border-radius:20px;
    font-size:13px; color:var(--muted); border:1px solid transparent; }
.step-item .step-dot { display:inline-flex; align-items:center; justify-content:center;
    width:20px; height:20px; border-radius:50%; background:var(--border); color:var(--fg);
    font-size:12px; font-weight:700; flex:none; }
.step-item.done { color:var(--fg); }
.step-item.done .step-dot { background:#22a06b; color:#fff; }
.step-item.current { background:rgba(99,102,241,.14); border-color:var(--accent); color:var(--fg); font-weight:600; }
.step-item.current .step-dot { background:var(--accent); color:#fff; }
.step-item.optional { opacity:.85; }
.step-item .step-txt em { font-style:normal; font-size:11px; opacity:.6; }
.step-now { margin-left:auto; font-size:13px; color:var(--muted); padding-left:10px; }
.step-now strong { color:var(--accent); }
@media (max-width:860px){ .step-now { margin-left:0; width:100%; margin-top:4px; } }

/* Súhrn (overview) card on the admin detail */
.summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px 22px; }
.summary-grid h4 { margin:0 0 6px; font-size:13px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.summary-grid ul { list-style:none; margin:0; padding:0; font-size:14px; }
.summary-grid ul li { padding:2px 0; }
.summary-grid .media-flags li { color:var(--fg); }

/* TTS audiobook studio */
.tts-settings { margin-top:12px; }
.tts-settings label { display:flex; flex-direction:column; gap:5px; font-size:14px; color:var(--muted); margin-bottom:10px; }
.tts-settings input, .tts-settings select, .tts-settings textarea {
    padding:9px 12px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg);
    font:inherit; font-size:14px; }
.tts-settings textarea { resize:vertical; min-height:66px; line-height:1.5; }
.tts-settings input:focus, .tts-settings select:focus, .tts-settings textarea:focus { outline:none; border-color:var(--accent); }
.tts-list { display:flex; flex-direction:column; gap:8px; }
.tts-seg { display:flex; gap:10px; align-items:flex-start; padding:8px; border:1px solid var(--border);
    border-radius:8px; background:var(--bg); }
.tts-seg .tts-dot { flex:none; width:10px; height:10px; border-radius:50%; margin-top:8px;
    background:var(--border); }
.tts-seg.gen { border-color:rgba(34,160,107,.4); }
.tts-seg.gen .tts-dot { background:#22a06b; }
.tts-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.tts-text { width:100%; resize:vertical; font:inherit; font-size:14.5px; line-height:1.5;
    background:var(--card); color:var(--fg); border:1px solid var(--border); border-radius:6px; padding:8px; }
.tts-actions { display:flex; align-items:center; gap:8px; }
.tts-actions .tts-meta { font-size:12.5px; }
.is-hidden { display:none !important; }

/* Audiobook parts (chapters) — admin list */
.part-list { display:flex; flex-direction:column; gap:8px; }
.part-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    border:1px solid var(--border); border-radius:8px; padding:8px; }
.part-row .part-num { color:var(--muted); font-size:13px; min-width:22px; }
.part-title-form { display:flex; gap:6px; margin:0; flex:1; min-width:180px; }
.part-title-form input { flex:1; padding:7px 10px; border-radius:6px; border:1px solid var(--border);
    background:#0f131b; color:var(--fg); font-size:14px; }
.part-actions { display:flex; gap:4px; margin-left:auto; }
.tts-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px;
    position:sticky; top:0; z-index:5; background:var(--card); padding:8px 0; }
.tts-check { display:flex; align-items:center; gap:6px; font-size:14px; color:var(--muted); cursor:pointer; }
.tts-seg.generating .tts-dot { background:#e0a800; animation:ttspulse 1s ease-in-out infinite; }
@keyframes ttspulse { 0%,100%{ opacity:1 } 50%{ opacity:.25 } }
.tts-seg.playing { border-color:var(--accent); background:rgba(99,102,241,.10); }
.tts-seg.playing .tts-dot { box-shadow:0 0 0 3px rgba(99,102,241,.3); }
.tts-progress { height:10px; background:var(--border); border-radius:6px; overflow:hidden; }
.tts-progress-bar { height:100%; width:0; background:var(--accent); transition:width .4s ease; }
.img-list { display:flex; flex-direction:column; gap:8px; }
.img-row { display:flex; align-items:center; gap:12px; padding:8px; border:1px solid var(--border); border-radius:8px; }
.img-row .img-info { flex:1; min-width:0; font-size:14px; }
.img-row img { object-fit:cover; }

/* Tags */
.tag-checks { display:flex; flex-wrap:wrap; gap:8px 14px; }
.tag-check { display:flex; align-items:center; gap:6px; font-size:14px; cursor:pointer;
    border:1px solid var(--border); border-radius:8px; padding:6px 10px; }
.tag-admin-list { display:flex; flex-direction:column; gap:8px; }
.tag-admin-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0;
    border:1px solid var(--border); border-radius:8px; padding:8px; }
.tag-admin-row input[type=text], .tag-admin-row input:not([type]) { background:var(--card); color:var(--fg);
    border:1px solid var(--border); border-radius:6px; padding:6px 8px; }
.tag-chip { text-decoration:none; }
.tag-chip:hover { border-color:var(--accent); color:var(--fg); }

/* Step badge in the library list */
.step-badge { display:inline-block; font-size:12px; padding:2px 9px; border-radius:20px;
    background:rgba(99,102,241,.14); color:var(--accent); border:1px solid var(--accent); white-space:nowrap; }
.step-badge.ok { background:rgba(34,160,107,.15); color:#22a06b; border-color:#22a06b; }

/* ── Version editor ────────────────────────────────────────────────────────── */
.fr-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:10px 0 12px; }
.fr-tools input[type="text"] { padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font-size:14px; }
.version-editor { width:100%; min-height:60vh; padding:14px; border-radius:8px; border:1px solid var(--border); background:#0f131b; color:var(--fg); font:13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize:vertical; }

/* ── Editorial pass (redakčný prechod) — corrections diff ──────────────────── */
.edit-list { display:flex; flex-direction:column; gap:2px; margin:14px 0 4px; }
.edit-row { padding:8px 10px; border-bottom:1px solid var(--border); font-size:14px; }
.edit-row.skipped { opacity:.5; }
.edit-diff { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; line-height:1.5; }
.edit-diff .old { color:#f87171; text-decoration:line-through; text-decoration-color:rgba(248,113,113,.6); }
.edit-diff .new { color:#22c55e; }
.edit-diff .arrow { color:var(--muted); }
.edit-why { color:var(--muted); font-size:12.5px; margin-top:3px; }
.edit-skip { color:#f59e0b; }

/* ── Admin statistics ─────────────────────────────────────────────────────── */
.stats-periods { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:14px 0 4px; }
.stats-periods .chip { font-size:13px; padding:6px 12px; border-radius:20px; text-decoration:none;
    border:1px solid var(--border); color:var(--muted); }
.stats-periods .chip:hover { color:var(--fg); border-color:var(--accent); }
.stats-periods .chip.on { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.stats-periods select { padding:6px 10px; border-radius:8px; border:1px solid var(--border);
    background:#0f131b; color:var(--fg); font-size:13px; }
.stats-summary { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.stat-box { flex:1 1 120px; background:var(--bg); border:1px solid var(--border); border-radius:10px;
    padding:12px 14px; display:flex; flex-direction:column; gap:2px; }
.stat-box .sv { font-size:20px; font-weight:800; }
.stat-box .sl { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.stat-box.period .sv { font-size:14px; font-weight:600; color:var(--accent); }
.stats-table th.grp { text-align:center; border-bottom:1px solid var(--border); font-size:12px; color:var(--muted); }
.stats-table td, .stats-table th { white-space:nowrap; }
.pct-bar { display:inline-block; width:52px; height:6px; border-radius:4px; background:var(--border);
    overflow:hidden; vertical-align:middle; margin-right:4px; }
.pct-bar > span { display:block; height:100%; background:var(--accent); }
.pct-bar.audio > span { background:#22a06b; }

/* ── Library: how a book was obtained ────────────────────────────────────── */
.own-badge { font:inherit; font-size:12px; cursor:pointer; margin:6px 0 2px;
    padding:3px 10px; border-radius:20px; border:1px solid var(--border);
    background:transparent; color:var(--muted); }
.own-badge:hover { border-color:var(--accent); color:var(--fg); }
.own-badge.own-purchase { color:#22c55e; border-color:rgba(34,197,94,.35); }
.own-badge.own-pro { color:#f59e0b; border-color:rgba(245,158,11,.35); }
.own-modal { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:200;
    display:flex; align-items:center; justify-content:center; padding:20px; }
.own-modal[hidden] { display:none; }
.own-box { background:var(--card); border:1px solid var(--border); border-radius:12px;
    padding:22px; max-width:440px; width:100%; box-shadow:0 20px 60px rgba(0,0,0,.5); }

/* ── PRO paywall ──────────────────────────────────────────────────────────── */
.pro-head { text-align:center; padding:20px 0 8px; }
.pro-head h1 { margin:10px 0 8px; font-size:clamp(1.6rem,5vw,2.2rem); }
.pro-head .lead { color:var(--muted); max-width:620px; margin:0 auto; line-height:1.6; }
.pro-badge-lg { display:inline-block; background:linear-gradient(135deg,#f59e0b,#f97316); color:#fff;
    font-weight:800; font-size:13px; letter-spacing:.06em; padding:5px 14px; border-radius:20px; }

.plans { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin:22px 0 0; }
.plan { position:relative; display:flex; flex-direction:column; gap:2px; cursor:pointer;
    background:var(--card); border:2px solid var(--border); border-radius:14px; padding:22px 18px 18px; }
.plan:hover { border-color:var(--accent); }
.plan input { position:absolute; opacity:0; pointer-events:none; }
.plan.picked { border-color:var(--accent); box-shadow:0 0 0 4px rgba(99,102,241,.15); }
.plan.featured { border-color:var(--accent); }
.plan-badge { position:absolute; top:-11px; left:50%; transform:translateX(-50%); white-space:nowrap;
    background:var(--accent); color:#fff; font-size:11.5px; font-weight:700; padding:3px 12px; border-radius:20px; }
.plan-name { font-size:14px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.plan-price { font-size:30px; font-weight:800; line-height:1.2; }
.plan-price small { font-size:14px; font-weight:500; color:var(--muted); margin-left:4px; }
.plan-permonth { font-size:15px; color:var(--accent); font-weight:700; }
.plan-note { font-size:12.5px; color:var(--muted); text-decoration:line-through; text-decoration-color:rgba(154,163,178,.5); }
.plan-save { align-self:flex-start; margin-top:8px; background:rgba(34,197,94,.15); color:#22c55e;
    font-size:12px; font-weight:700; padding:3px 10px; border-radius:20px; }
.plan-sub { font-size:12.5px; margin-top:10px; line-height:1.45; }

.plan-cta { text-align:center; margin:22px 0 6px; }
.plan-submit { font-size:17px; padding:14px 30px; }
.plan-legal { font-size:12.5px; max-width:560px; margin:10px auto 0; line-height:1.5; }

.pro-benefits-box { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:22px; margin-top:22px; }
.pro-benefits-box h2 { margin:0 0 12px; font-size:18px; }
.pro-benefits { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.pro-benefits li { font-size:15px; line-height:1.5; }

.pay-transfer { display:flex; gap:18px; align-items:center; flex-wrap:wrap;
    background:linear-gradient(135deg, rgba(99,102,241,.10), rgba(139,92,246,.06));
    border:1px solid var(--accent); border-radius:12px; padding:18px 20px; margin-top:16px; }
.pay-transfer-body { flex:1; min-width:220px; }
.pay-transfer h3 { margin:0 0 6px; font-size:16px; }
.pay-transfer code { background:#0f131b; padding:2px 8px; border-radius:6px; }
.pay-qr { flex:none; }

/* ── Platba prevodom ───────────────────────────────────────────────────────── */
.transfer-page { max-width:680px; margin:0 auto; }
.transfer-box { display:flex; gap:26px; align-items:flex-start; flex-wrap:wrap; border:1px solid var(--border); border-radius:12px; padding:20px; margin:18px 0; }
.transfer-qr { text-align:center; }
.transfer-qr img { background:#fff; padding:8px; border-radius:8px; display:block; }
.transfer-qr p { margin:8px 0 0; font-size:12.5px; }
.transfer-table { flex:1 1 260px; border-collapse:collapse; }
.transfer-table th { text-align:left; color:var(--muted); font-weight:600; font-size:13.5px; padding:7px 14px 7px 0; vertical-align:top; white-space:nowrap; }
.transfer-table td { padding:7px 0; font-size:14.5px; }
.transfer-table td.big { font-size:19px; font-weight:800; }
.transfer-table code { font-size:14.5px; }
.transfer-warn { border:1px solid rgba(245,158,11,.35); background:rgba(245,158,11,.08); border-radius:10px; padding:11px 14px; font-size:14px; }
.transfer-pick { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }

/* ── Označené chyby v texte ────────────────────────────────────────────────── */
.notes-book { margin-bottom:18px; }
.notes-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.notes-head h2 { margin:0; font-size:18px; }
.notes-head h2 a { color:var(--fg); text-decoration:none; }
.notes-head h2 a:hover { color:var(--accent); }
.notes-actions { display:flex; align-items:center; gap:10px; }
.notes-actions form { margin:0; }
.notes-open { color:#f59e0b; font-weight:700; font-size:14px; }
.notes-done { color:#22c55e; font-weight:700; font-size:14px; }
.note-row { display:flex; gap:14px; padding:12px 0; border-top:1px solid var(--border); }
.note-main { flex:1; min-width:0; }
.note-quote { margin:0 0 6px; padding:0 0 0 12px; border-left:3px solid #f59e0b; font-style:italic; font-size:14.5px; }
.note-q { margin:0 0 6px; font-size:14px; }
.note-a { margin:0 0 6px; font-size:14px; color:var(--muted); }
.note-diff { margin:0 0 6px; font-size:13.5px; }
.note-diff .was { text-decoration:line-through; color:#f87171; }
.note-diff .now { color:#22c55e; }
.note-meta { font-size:12px; margin:0; }
.note-side { display:flex; flex-direction:column; gap:6px; align-items:flex-end; flex:0 0 auto; }
.note-side form { margin:0; }
.note-badge { font-size:11px; font-weight:800; padding:2px 8px; border-radius:999px; }
.note-badge.open { background:rgba(245,158,11,.18); color:#f7b955; }
.note-badge.fixed { background:rgba(34,197,94,.18); color:#22c55e; }
.note-badge.expl { background:rgba(99,102,241,.18); color:#a5b4fc; }
.btn.btn-sm { padding:4px 10px; font-size:12.5px; }
.note-stale { color:#f59e0b; font-weight:700; }
.notes-warn { border:1px solid rgba(245,158,11,.4); background:rgba(245,158,11,.09); border-radius:10px;
    padding:10px 13px; font-size:13.5px; margin:0 0 12px; }
.note-quote.gloss { border-left-color:#818cf8; }
.note-badge.gloss { background:rgba(99,102,241,.2); color:#a5b4fc; }
.src-file { border:1px solid var(--border); border-radius:10px; padding:14px 16px; margin:14px 0; }
.src-file h3 { margin:0 0 6px; font-size:15px; }
.src-ok { color:#22c55e; font-size:13px; font-weight:700; }
.src-missing { color:#f59e0b; font-size:13px; font-weight:700; }
.book-cost { margin-top:8px; font-size:13.5px; color:var(--muted); }
.book-cost strong { color:var(--fg); }

/* ── Prechody ──────────────────────────────────────────────────────────────── */
.pass-list { display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.pass-card { display:flex; align-items:flex-start; gap:12px; padding:13px 15px; border:1px solid var(--border);
    border-radius:11px; background:var(--card); text-decoration:none; color:var(--fg); }
.pass-card:hover { border-color:var(--accent); }
.pass-card.off { opacity:.55; }
.pass-ord { flex:0 0 26px; height:26px; border-radius:50%; background:#2a3040; color:var(--muted);
    display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; }
.pass-icon { font-size:19px; }
.pass-body { display:flex; flex-direction:column; gap:3px; min-width:0; }
.pass-sum { font-size:13.5px; color:var(--muted); }
.pass-meta { font-size:12px; }
.need-src { color:#f59e0b; }
.off-tag { color:#f87171; }
.form textarea.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:13px; line-height:1.5; }

.matrix-wrap { overflow-x:auto; }
.matrix { border-collapse:collapse; font-size:14px; min-width:640px; }
.matrix th, .matrix td { border-bottom:1px solid var(--border); padding:8px 10px; text-align:center; }
.matrix th { font-size:12px; color:var(--muted); font-weight:600; vertical-align:bottom; }
.matrix th .mx-name { display:block; font-size:10.5px; max-width:64px; margin:2px auto 0; line-height:1.2; }
.matrix .mx-book { text-align:left; white-space:nowrap; }
.matrix .mx-book a { color:var(--fg); text-decoration:none; }
.matrix .mx-book a:hover { color:var(--accent); }
.mx-nosrc { display:block; font-size:11px; color:#f59e0b; }
.mx-cell { font-size:15px; }
.mx-cost { text-align:right; color:var(--muted); font-size:13px; white-space:nowrap; }
.pass-card.main { border-color:rgba(99,102,241,.5); background:linear-gradient(135deg,rgba(99,102,241,.10),transparent); }
.pass-main-tag { font-size:11px; font-weight:800; padding:1px 7px; border-radius:999px;
    background:rgba(99,102,241,.2); color:#a5b4fc; vertical-align:middle; }

/* ── Okno s výstupom prechodu ──────────────────────────────────────────────── */
/* Výstup môže mať stovky riadkov — roluje sa vo vlastnom okne, aby stránka
   nenarástla a ostatné ovládanie zostalo po ruke. */
.logbox { border:1px solid var(--border); border-radius:10px; overflow:hidden; margin:14px 0 4px; background:#0f131b; }
.logbox-head { display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:8px 12px; background:#161b25; border-bottom:1px solid var(--border);
    font-size:12.5px; color:var(--muted); position:sticky; top:0; z-index:1; }
.logbox-toggle { background:none; border:1px solid var(--border); color:var(--muted);
    border-radius:6px; padding:2px 9px; font-size:12px; cursor:pointer; }
.logbox-toggle:hover { color:var(--fg); border-color:var(--accent); }
.logbox-body { max-height:320px; overflow-y:auto; overscroll-behavior:contain; margin:0; }
.logbox.open .logbox-body { max-height:75vh; }
.logbox .edit-list { border:0; border-radius:0; padding:0 10px; }
pre.decisions.logbox-body { max-height:320px; }

/* ── Kroky (prechody) v detaile knihy ──────────────────────────────────────── */
.steps-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:14px 0 12px; }
.stab { display:inline-flex; align-items:center; gap:6px; background:#161b25; color:var(--muted);
    border:1px solid var(--border); border-radius:999px; padding:6px 12px; font-size:13px; cursor:pointer; }
.stab:hover { color:var(--fg); }
.stab.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.stab-n { display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px;
    border-radius:50%; background:rgba(255,255,255,.12); font-size:10.5px; font-weight:800; }
.stab-dot { font-size:11px; }
.step-panel { border-top:1px solid var(--border); padding-top:14px; }
.step-meta { display:flex; flex-wrap:wrap; gap:6px; font-size:12px; margin:10px 0 4px; }
.step-meta span { background:#161b25; border:1px solid var(--border); border-radius:999px;
    padding:3px 10px; color:var(--muted); }
.step-meta .ok { color:#22c55e; border-color:rgba(34,197,94,.35); }
.step-meta .warn { color:#f59e0b; border-color:rgba(245,158,11,.4); }
.step-meta .ok { color:#22c55e; }
.step-meta .warn { color:#f59e0b; }
.step-run { font-size:14px; margin:0 0 10px; }
.mx-cell a { text-decoration:none; display:block; }
.ver-num { color:var(--accent); font-size:13.5px; }
.ver-log { margin:0 0 12px 26px; }
.btn.ver-changes.active { border-color:var(--accent); color:var(--accent); }
/* Spúšťací panel kroku — vyzerá ako ovládací pult, nie ako holý formulár. */
.step-launch { border:1px solid var(--border); border-radius:12px; background:#12161f; margin:14px 0 4px; overflow:hidden; }
.step-launch-head { padding:9px 14px; background:#171d28; border-bottom:1px solid var(--border);
    font-size:13px; font-weight:700; color:var(--fg); letter-spacing:.2px; }
.step-run-form { display:grid; grid-template-columns:1fr 1fr auto; gap:12px; align-items:end; padding:14px; }
.step-run-form label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted);
    text-transform:uppercase; letter-spacing:.4px; font-weight:600; }
.step-run-form select { min-width:0; width:100%; height:38px; text-transform:none; letter-spacing:0; }
.step-run-form > button { height:38px; padding:0 20px; white-space:nowrap; }
.step-run-form .step-extra { grid-column:1 / -1; }
.step-launch-note { margin:0; padding:0 14px 13px; font-size:12px; color:var(--muted); }
.run-hist { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:12px 0 0; font-size:12px; }
.run-chip { border:1px solid var(--border); border-radius:999px; padding:2px 9px; color:var(--muted); }
.run-chip.r-done { border-color:rgba(34,197,94,.4); color:#22c55e; }
.run-chip.r-error { border-color:rgba(248,113,113,.4); color:#f87171; }
.step-extra span { text-transform:none; letter-spacing:0; font-weight:400; }
.step-extra textarea { font:inherit; font-size:13px; width:100%; box-sizing:border-box; min-height:56px;
    text-transform:none; letter-spacing:0; }
.step-check { flex-direction:row; align-items:flex-start; gap:8px; text-transform:none; letter-spacing:0;
    font-size:13px; font-weight:600; color:var(--text); cursor:pointer; }
.step-check input[type=checkbox] { margin:2px 0 0; width:16px; height:16px; flex:none; }
.step-check .muted { font-weight:400; }
.step-check:has(input:disabled) { cursor:not-allowed; opacity:.7; }
@media (max-width:620px){ .step-run-form { grid-template-columns:1fr; } }
.step-live { border:1px solid rgba(99,102,241,.45); border-radius:12px; background:rgba(99,102,241,.07);
    margin:14px 0 4px; overflow:hidden; }
.step-live-head { padding:9px 14px; background:rgba(99,102,241,.15); border-bottom:1px solid rgba(99,102,241,.3);
    font-size:13px; font-weight:700; }
.step-live-body { margin:0; padding:12px 14px; font-size:13.5px; line-height:1.6; }
.step-live form { padding:0 14px 13px; margin:0; }
.badge-head { background:rgba(99,102,241,.22); color:#a5b4fc; }
.badge-del { background:rgba(248,113,113,.18); color:#f87171; }
.ver-row.ver-deleted { opacity:.5; }
.ver-row.ver-deleted .ver-name { text-decoration:line-through; }

/* ── Plán krokov ───────────────────────────────────────────────────────────── */
.plan-box { border:1px solid var(--border); border-radius:12px; background:#12161f; margin:14px 0; overflow:hidden; }
.plan-head { padding:9px 14px; background:#171d28; border-bottom:1px solid var(--border); font-size:13px; font-weight:700; }
.plan-body { padding:12px 14px; }
.plan-list { margin:0 0 10px; padding-left:20px; display:flex; flex-direction:column; gap:5px; }
.plan-list li { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:14px; }
.plan-list form { margin:0; }
.plan-gap-form { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.plan-gap-form label { display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--muted); }
.plan-gap-form input { width:110px; }
.step-run-form { grid-template-columns:1fr 1fr auto auto; }
.plan-state { margin:0 0 10px; font-size:13.5px; }
.plan-warn { font-size:11px; color:#f59e0b; border:1px solid rgba(245,158,11,.35); border-radius:999px; padding:1px 7px; margin-left:6px; }
.plan-only-form { margin:8px 0 0; }
.note-badge.sending { background:rgba(99,102,241,.2); color:#a5b4fc; }
.notes-sending { color:#a5b4fc; font-weight:700; font-size:13px; }
.s-queued { background:rgba(148,163,184,.18); color:#94a3b8; }
.lib-cost { white-space:nowrap; text-align:right; }

/* ── Stĺpec prechodov v knižnici ───────────────────────────────────────────── */
.lib-pass { white-space:nowrap; text-align:center; }
.lib-pass > span { display:inline-flex; align-items:center; gap:3px; font-size:12.5px; }
.pass-run { color:var(--accent); font-weight:800; }
.pass-last { display:inline-flex; align-items:center; justify-content:center;
    width:20px; height:20px; border-radius:50%; background:#222838; color:var(--muted);
    font-size:11.5px; font-weight:800; }
.pass-plan { color:#f7b955; margin-left:4px; font-weight:700; }
.spinner { width:11px; height:11px; border-radius:50%; border:2px solid rgba(99,102,241,.25);
    border-top-color:var(--accent); animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.pass-stale { color:#f87171; font-weight:800; margin-left:4px; text-decoration:none; font-size:14px; }
.pass-stale:hover { color:#fca5a5; }
.plan-actions { display:flex; gap:6px; align-items:center; }
.plan-model-form { display:flex; gap:5px; align-items:center; margin:0; }
.plan-model-form select { font-size:12px; padding:3px 6px; height:28px; }
