/* ==========================================================================
   Web Xanora — Xanora Look.
   Tokeny sú 1:1 z ../Xanora/XanoraApp/Resources/Themes/Xanora.axaml (mená v kebab-case),
   pravidlá a výklad v .web-php/.specifikacia/dizajn.md. Kde sa web a aplikácia rozídu,
   platí aplikácia.

   Značkový gradient je na obrazovke najviac trikrát: rám okna (horná linka), hlavné
   tlačidlo, podčiarknutie aktívnej položky. Nič iné ho nedostane.
   ========================================================================== */

:root {
    /* Plochy */
    --surface-base: #010720;
    --surface-panel: #020B2C;
    --surface-sunken: #000516;
    --surface-raised: #07184A;
    --surface-hover: #0C2058;
    --surface-active: #0E2A6E;
    --surface-selected: #10325F;

    /* Čiary */
    --line-soft: #0F1C44;
    --line-strong: #1E3370;
    --line-hover: #2E4A9E;

    /* Text */
    --text-primary: #EAF0FF;
    --text-secondary: #A8B8E8;
    --text-muted: #8E9CCC;
    --text-faint: #6E7CAE;
    --text-disabled: #4E5A85;
    --text-on-bright: #08101F;

    /* Akcenty */
    --accent-cyan: #00D8F5;
    --accent-cyan-bright: #38E8FF;
    --accent-cyan-dim: #0A6A80;
    --accent-violet: #B764FF;
    --accent-magenta: #F02EC8;
    --accent-coral: #FA5A40;
    --accent-amber: #FFB324;
    --accent-blue: #3B7DF5;

    /* Stavy */
    --state-ok: #00D8F5;
    --state-warn: #FFB324;
    --state-danger: #FF5A6E;

    /* Prekrytia */
    --scrim-badge: #0A1E4ECC;
    --scrim-shade: #000A1ECC;

    /* Farby záložiek knižnice (Tab*) — kategória funkcie má svoju farbu navždy */
    --tab-media: #00D8F5;
    --tab-stock: #3B7DF5;
    --tab-audio: #F02EC8;
    --tab-titles: #B764FF;
    --tab-transitions: #FA5A40;
    --tab-effects: #FFB324;
    --tab-stickers: #FF5C9E;
    --tab-templates: #2FE0B0;

    /* Gradienty */
    --brand-gradient: linear-gradient(90deg, #00C8FD 0%, #3B7DF5 24%, #B764FF 48%, #F02EC8 70%, #FA5A40 88%, #FFB324 100%);
    --brand-fill: linear-gradient(90deg, #00C8FD 0%, #3B7DF5 34%, #B764FF 69%, #F02EC8 100%);
    --slider-fill: linear-gradient(90deg, #8E6BFF 0%, #2AA8F8 45%, #00D8F5 100%);
    --slider-track: #13224F;

    /* Svetlo (xanora-look 3.1) */
    --glow-hint: 0 0 6px 0 #00D8F533;
    --glow-highlight: 0 0 12px 0 #00D8F555;
    --glow-brand: 0 0 18px 0 #F02EC866;
    --frame-glow: #00D8F51F;

    /* Tvar (xanora-look 4.1) */
    --radius-panel: 12px;
    --radius-card: 8px;
    --radius-pill: 10px;
    --radius-small: 7px;
    --radius-badge: 5px;

    /* Pohyb (xanora-look 9) — nič nebliká a nič nepulzuje */
    --t-hover: 120ms ease-out;
    --t-select: 160ms ease-out;
    --t-expand: 180ms ease-in-out;

    --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
            "SF Pro Text", Inter, Cantarell, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;

    --container: 1200px;
    --gutter: 16px;

    color-scheme: dark;
}

/* Druhá téma ako v aplikácii (Default.axaml): neutrálna sivá, bez žiary. */
:root[data-theme="default"] {
    --surface-base: #111317;
    --surface-panel: #191C21;
    --surface-sunken: #0E1013;
    --surface-raised: #20242A;
    --surface-hover: #2A2E35;
    --surface-active: #2C3037;
    --surface-selected: #123943;
    --line-soft: #20242A;
    --line-strong: #30343B;
    --line-hover: #3A3F47;
    --text-primary: #E9EDF2;
    --text-secondary: #AEB4BC;
    --text-muted: #8A9099;
    --text-faint: #7D848D;
    --text-disabled: #5B616A;
    --text-on-bright: #111317;
    --accent-cyan: #23D9F7;
    --accent-cyan-bright: #5BE6FF;
    --accent-cyan-dim: #526B6C;
    --accent-violet: #8B3BE8;
    --accent-magenta: #FF2E95;
    --accent-coral: #FF5A3C;
    --scrim-badge: #20242ACC;
    --scrim-shade: #0E1013CC;
    --slider-track: #2B3039;
    --glow-hint: none;
    --glow-highlight: none;
    --glow-brand: none;
    --frame-glow: transparent;
}

@media (min-width: 640px) {
    :root { --gutter: 24px; }
}

/* ---------------------------------------------------------------- základ */
*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--surface-base);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-base);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Rám okna (xanora-look 3.3): 1 px značková linka vnútri horného okraja + žiara dovnútra. */
body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    pointer-events: none;
    z-index: 100;
}
body::before { height: 1px; background: var(--brand-gradient); }
body::after { height: 16px; top: 1px; background: linear-gradient(180deg, var(--frame-glow), transparent); }

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; }

a { color: var(--accent-cyan-bright); text-decoration: none; transition: color var(--t-hover); }
a:hover { color: var(--text-primary); }

h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--text-primary); text-wrap: balance; }
p { margin: 0; }

:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
    box-shadow: var(--glow-highlight);
    border-radius: var(--radius-small);
}

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon-inline { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 800px; }

/* Nadpis skupiny (PRIEČINKY v aplikácii): VERZÁLKY, prestrkané, tlmené. */
.eyebrow {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 8px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
}
.skip-link:focus { top: 12px; }

.env-banner {
    padding: 6px var(--gutter);
    background: var(--surface-panel);
    border-bottom: 1px solid var(--accent-amber);
    color: var(--accent-amber);
    font-size: 13px;
    text-align: center;
}

/* ---------------------------------------------------------------- tlačidlá */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover), box-shadow var(--t-select), filter var(--t-hover);
}
.btn .icon { width: 18px; height: 18px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Hlavné tlačidlo = EXPORTOVAŤ: celý značkový gradient, tmavý text (biela má 2,2:1). */
.btn-primary {
    background: var(--brand-gradient);
    color: var(--text-on-bright);
    box-shadow: var(--glow-brand);
}
.btn-primary:hover { color: var(--text-on-bright); filter: brightness(1.08) saturate(1.05); }
:root[data-theme="default"] .btn-primary { background: var(--accent-cyan); }

/* Vedľajšie tlačidlo v dialógu: zdvihnutá plocha s okrajom. */
.btn-secondary {
    background: var(--surface-raised);
    border-color: var(--line-strong);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--line-hover); color: var(--text-primary); }
.btn-secondary.is-current { border-color: var(--accent-cyan); box-shadow: var(--glow-hint); }

.btn-file {
    max-width: 14em;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    opacity: 0.75;
}

/* Odznak (4K, 100 %, verzia) */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-badge);
    background: var(--scrim-badge);
    color: var(--accent-cyan-bright);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.badge-lg { height: 28px; padding: 0 12px; font-size: 14px; }

/* Pilulka stavu: okraj nesie stav, výplň ostáva tmavá. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
.pill-ok { border-color: var(--accent-cyan-dim); color: var(--accent-cyan-bright); }

/* ---------------------------------------------------------------- hlavička = titulkový pruh */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface-base) 88%, transparent);
    border-bottom: 1px solid var(--line-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--container);
    min-height: 64px;
    margin: 0 auto;
    padding: 8px var(--gutter);
}

.brand { flex: none; padding: 6px 0; }
.brand img { width: 128px; height: auto; }

.site-nav { display: none; align-items: center; gap: 4px; margin-left: 20px; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}
.nav-link .icon { width: 18px; height: 18px; }
.nav-link:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Aktívna položka = záložka timeline: azúrový text + 2 px podčiarknutie výrezom gradientu. */
.nav-link.is-active { color: var(--accent-cyan-bright); }
.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--brand-fill);
    box-shadow: var(--glow-hint);
}
:root[data-theme="default"] .nav-link.is-active::after { background: var(--accent-cyan); }

/* Chip = prepínač v stavovom riadku editora (Vzhľad: Xanora) */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color var(--t-hover), color var(--t-hover);
}
.chip .icon { width: 16px; height: 16px; }
.chip:hover { border-color: var(--line-hover); color: var(--text-primary); }
.chip-label { display: none; color: var(--text-muted); }
.chip-value { color: var(--accent-cyan-bright); font-weight: 600; }

.inline-form { margin: 0; }

@media (min-width: 900px) {
    .site-nav { display: flex; }
    .chip-label { display: inline; }
    .brand img { width: 150px; }
}
@media (max-width: 520px) {
    .brand img { width: 108px; }
    .header-inner { gap: 6px; }
    .header-actions { gap: 4px; }
    .header-actions .nav-link { padding: 0 8px; }
    .header-actions .nav-link .icon { display: none; }
    /* úzky displej: vzhľad len ikonou, registrácia je v hero aj na prihlásení */
    .theme-toggle .chip-value { display: none; }
    .nav-admin { display: none; } /* správa je aj v pätičke */
    .header-actions > .btn-secondary:not(.is-current) { display: none; }
}
@media (max-width: 430px) {
    .theme-toggle { display: none; }
    .header-actions .btn-sm { padding: 0 10px; }
}

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 72px; }

.hero-grid { display: grid; gap: 48px; align-items: center; }

.hero-title {
    margin-bottom: 20px;
    font-size: clamp(36px, 4.4vw, 56px);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.hero-lead { max-width: 560px; color: var(--text-secondary); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; color: var(--text-muted); font-size: 14px; }

@media (min-width: 1024px) {
    .hero { padding: 80px 0 104px; }
    .hero-grid { grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); gap: 56px; }
}

/* ---------------------------------------------------------------- ilustrácia editora
   Kreslená z komponentov aplikácie (xanora-look 7–8): titulkový pruh, knižnica, náhľad,
   inšpektor, časová os. Žiadny obrázok — mení sa s témou. */
.editor {
    --head: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-panel);
    background: var(--surface-base);
    font-size: 11px;
    line-height: 1.3;
    user-select: none;
    box-shadow: 0 40px 80px -40px #000, 0 0 0 1px #00000040;
}
.editor::before { /* rám okna aplikácie: linka vnútri okraja */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 16px var(--frame-glow);
    pointer-events: none;
}

.editor-titlebar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 34px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line-strong);
}
.editor-titlebar img { width: 76px; height: auto; }
.editor-menu { display: none; gap: 12px; color: var(--text-secondary); }
.editor-project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--accent-cyan);
    color: var(--accent-cyan-bright);
}
.editor-project .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); }
/* EXPORTOVAŤ — v ilustrácii jediné ďalšie miesto so značkovým gradientom */
.editor-export {
    margin-left: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-small);
    background: var(--brand-gradient);
    color: var(--text-on-bright);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: var(--glow-brand);
}
:root[data-theme="default"] .editor-export { background: var(--accent-cyan); }

.editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
}

.editor-library,
.editor-preview,
.editor-inspector {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-panel);
    padding: 8px;
}
.editor-library, .editor-inspector { display: none; }

.lib-tab {
    display: block;
    width: 52%;
    height: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-badge);
    background: var(--surface-raised);
    box-shadow: var(--glow-hint);
}
.lib-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile {
    position: relative;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
}
.tile b {
    position: absolute;
    left: 3px;
    top: 3px;
    padding: 0 3px;
    border-radius: 3px;
    background: var(--scrim-badge);
    color: var(--accent-cyan-bright);
    font-size: 7px;
    font-weight: 700;
}
.tile-1 { background: linear-gradient(180deg, #123A8A, #3E5FB8 55%, #1C2B57 56%, #0B1636); border: 2px solid var(--accent-cyan-bright); box-shadow: var(--glow-highlight); }
.tile-2 { background: linear-gradient(180deg, #2B5C4A, #4F8A62 60%, #1D3B2E); }
.tile-3 { background: linear-gradient(180deg, #4B2C6E, #C85A7A 60%, #2A1840); }
.tile-audio {
    background:
        repeating-linear-gradient(90deg, #38E8FF66 0 2px, transparent 2px 4px) center / 100% 45% no-repeat,
        var(--surface-sunken);
}

.preview-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    outline: 1px solid var(--accent-cyan);
    outline-offset: 2px;
    background: linear-gradient(180deg, #0B1F5C 0%, #2C2E7E 38%, #8E3F86 62%, #E9708A 80%, #FFC07A 100%);
}
.scene-sun {
    position: absolute;
    left: 58%;
    top: 46%;
    width: 18%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #FFE3B0 0%, #FFB36B 55%, #FFB36B00 72%);
}
.scene-ridge { position: absolute; left: 0; right: 0; bottom: 0; }
.scene-ridge-back {
    height: 52%;
    background: #3A2A6B;
    clip-path: polygon(0 62%, 12% 40%, 22% 52%, 34% 22%, 46% 46%, 55% 30%, 68% 54%, 80% 26%, 92% 48%, 100% 36%, 100% 100%, 0 100%);
}
.scene-ridge-front {
    height: 40%;
    background: #140F33;
    clip-path: polygon(0 48%, 10% 60%, 24% 28%, 38% 58%, 50% 40%, 63% 66%, 76% 34%, 88% 56%, 100% 44%, 100% 100%, 0 100%);
}
.scene-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    color: #FFFFFF;
    font-size: clamp(11px, 2vw, 18px);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    text-shadow: 0 2px 10px #00000099;
}

.preview-transport { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }
.tc {
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-badge);
    background: var(--surface-raised);
    color: var(--text-primary);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.tc-muted { border-color: transparent; background: none; color: var(--text-muted); }
.transport-play {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--accent-cyan-bright);
    box-shadow: var(--glow-brand);
}
.transport-play .icon { width: 13px; height: 13px; }

.insp-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.insp-tabs i { flex: 1; height: 8px; border-radius: 2px; background: var(--line-soft); }
.insp-tabs i.is-active { background: var(--accent-cyan-bright); box-shadow: var(--glow-hint); }
.insp-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.insp-row i { width: 32%; height: 6px; border-radius: 2px; background: var(--line-strong); }
.slider { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--slider-track); }
.slider::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--slider-fill); }
.slider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #FFFFFF;
    transform: translate(-50%, -50%);
    box-shadow: var(--glow-hint);
}
.s-70::before { width: 70%; } .s-70::after { left: 70%; }
.s-45::before { width: 45%; } .s-45::after { left: 45%; }
.s-85::before { width: 85%; } .s-85::after { left: 85%; }
.insp-field { flex: 1; height: 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-raised); }

/* Časová os (xanora-look 8) */
.editor-timeline {
    --lane: 30px;
    position: relative;
    padding: 4px 8px 10px;
    border-top: 1px solid var(--line-strong);
    background: var(--surface-panel);
}
.tl-ruler {
    display: flex;
    justify-content: space-between;
    height: 18px;
    margin-left: var(--lane);
    padding-top: 2px;
    color: var(--text-muted);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    background: repeating-linear-gradient(90deg, #3A4E86 0 1px, transparent 1px 10%) left bottom / 100% 4px no-repeat;
}
.tl-ruler span:nth-child(even) { visibility: hidden; }
.tl-track {
    position: relative;
    height: 26px;
    margin-top: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, transparent var(--lane), var(--surface-sunken) var(--lane));
}
.tl-head {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    width: calc(var(--lane) - 4px);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
}
.clip {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: calc(var(--lane) + (100% - var(--lane)) * var(--x) / 100);
    width: calc((100% - var(--lane)) * var(--w) / 100);
    overflow: hidden;
    padding: 1px 5px;
    border: 1px solid;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.clip-video {
    border-color: var(--accent-cyan);
    background:
        repeating-linear-gradient(90deg, #38E8FF2E 0 16px, transparent 16px 18px) left bottom / 100% 55% no-repeat,
        #071A3E;
}
.clip-video.is-selected { border: 2px solid var(--accent-cyan-bright); box-shadow: var(--glow-highlight); }
.clip-audio {
    border-color: var(--accent-blue);
    background:
        repeating-linear-gradient(90deg, #38E8FF55 0 1px, transparent 1px 3px) center 70% / 100% 40% no-repeat,
        #06153A;
}
.clip-title { border-color: var(--accent-violet); background: #1A0F45; color: #D9C2FF; }
.c-title { --x: 24; --w: 22; }
.c-v1 { --x: 1; --w: 31; }
.c-v2 { --x: 32.5; --w: 26; }
.c-v3 { --x: 59; --w: 36; }
.c-a1 { --x: 1; --w: 86; }

/* Playhead: purpurový, 2 px so žiarou a jazýčkom (PlayheadColor). */
.playhead {
    position: absolute;
    top: 4px;
    bottom: 6px;
    left: calc(8px + var(--lane) + (100% - 16px - var(--lane)) * 0.3);
    width: 2px;
    background: var(--accent-magenta);
    box-shadow: var(--glow-brand);
}
.playhead::before {
    content: "";
    position: absolute;
    top: 0;
    left: -6px;
    width: 14px;
    height: 10px;
    border-radius: 3px 3px 7px 7px;
    background: var(--accent-magenta);
}

@media (prefers-reduced-motion: no-preference) {
    .playhead { animation: playhead 16s linear infinite; }
}
@keyframes playhead {
    from { left: calc(8px + var(--lane) + (100% - 16px - var(--lane)) * 0.02); }
    to { left: calc(8px + var(--lane) + (100% - 16px - var(--lane)) * 0.95); }
}

@media (min-width: 640px) {
    .editor-menu { display: flex; }
    .editor-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.2fr) minmax(0, 0.9fr); }
    .editor-library, .editor-inspector { display: block; }
}

/* ---------------------------------------------------------------- sekcie */
.section { padding: 72px 0; }
.section.section-tight { padding: 32px 0 72px; }
.section-panel {
    background: var(--surface-panel);
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}
.section-title { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.01em; }
.section-lead { max-width: 640px; margin-top: 12px; color: var(--text-secondary); font-size: 17px; }
.section-title + .grid, .section-lead + .grid { margin-top: 40px; }

@media (min-width: 1024px) {
    .section { padding: 96px 0; }
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Karta = dlaždica knižnice: zdvihnutá plocha, okraj nesie stav. */
.card,
.tile-card {
    position: relative;
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    transition: border-color var(--t-hover), box-shadow var(--t-select);
}
.card:hover, .tile-card:hover { border-color: var(--line-hover); }
.card h3, .tile-card h3 { margin: 16px 0 8px; font-size: 18px; font-weight: 600; }
.card p, .tile-card p { color: var(--text-secondary); font-size: 15px; }
.section-panel .card, .section-panel .tile-card { background: var(--surface-base); }

.card-icon,
.tile-icon,
.platform-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small);
    background: var(--surface-active);
    color: var(--accent-cyan-bright);
}
.card-icon .icon, .tile-icon .icon, .platform-icon .icon { width: 22px; height: 22px; }

/* Farebné ikony len tu — obdoba pruhu knižnice (xanora-look 6.2, rozhodnutie 13.1). */
.tile-icon {
    color: var(--tab);
    border-color: color-mix(in srgb, var(--tab) 40%, transparent);
    background: color-mix(in srgb, var(--tab) 12%, transparent);
}
.tab-media { --tab: var(--tab-media); }
.tab-stock { --tab: var(--tab-stock); }
.tab-audio { --tab: var(--tab-audio); }
.tab-titles { --tab: var(--tab-titles); }
.tab-transitions { --tab: var(--tab-transitions); }
.tab-effects { --tab: var(--tab-effects); }
.tab-stickers { --tab: var(--tab-stickers); }
.tab-templates { --tab: var(--tab-templates); }
:root[data-theme="default"] .tile-icon { --tab: var(--text-secondary); }

.platform-card .pill { margin-top: 16px; }
.platform-card.is-soon .platform-icon { color: var(--text-muted); background: var(--surface-raised); }
.platform-card.is-soon h3 { color: var(--text-secondary); }
.platforms-note { margin-top: 24px; color: var(--text-secondary); }
.platforms-note a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }

/* FAQ — rozbalenie ako sekcia inšpektora */
.faq { margin-top: 32px; border-top: 1px solid var(--line-soft); }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 4px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent-cyan-bright); }
.faq-chevron { color: var(--accent-cyan); transition: transform var(--t-expand); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-item p { padding: 0 4px 20px; color: var(--text-secondary); max-width: 680px; }

.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-panel);
    background: var(--surface-panel);
    box-shadow: inset 0 0 32px var(--frame-glow);
}
.cta-band h2 { font-size: clamp(22px, 3vw, 28px); }
.cta-band p { margin-top: 6px; color: var(--text-secondary); }

/* ---------------------------------------------------------------- stránka účtu */
.page-head { padding: 48px 0 8px; }
.page-title { font-size: clamp(30px, 4vw, 42px); font-weight: 700; }
.page-lead { margin-top: 8px; color: var(--text-muted); }

.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.release-date { color: var(--text-muted); font-size: 14px; }
.release-note { flex-basis: 100%; color: var(--text-secondary); font-size: 15px; }

.grid-downloads { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.download-card { display: flex; flex-direction: column; gap: 16px; }
/* Odporúčaná = vybratá dlaždica: azúrový okraj so žiarou. */
.download-card.is-recommended { border: 2px solid var(--accent-cyan); padding: 21px; box-shadow: var(--glow-highlight); }
.grid-downloads { padding-top: 12px; }
.download-card.is-soon { background: var(--surface-panel); }
.download-head { display: flex; align-items: flex-start; gap: 14px; }
.download-head h2 { font-size: 20px; font-weight: 600; }
.download-head p { color: var(--text-muted); font-size: 14px; }
.download-head .platform-icon { flex: none; }
/* Štítok odporúčanej platformy sedí na hornom okraji karty ako záložka. */
.download-flag {
    position: absolute;
    top: -12px;
    left: 20px;
    padding: 2px 10px;
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-pill);
    background: var(--surface-base);
    color: var(--accent-cyan-bright);
    font-size: 12px;
    font-weight: 600;
}
.download-meta { display: flex; gap: 32px; margin: 0; }
.download-meta dt { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.download-meta dd { margin: 2px 0 0; font-size: 16px; }
.download-install, .download-soon { color: var(--text-secondary); font-size: 14px; }
.download-install strong { color: var(--text-primary); font-weight: 600; }

.sha summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}
.sha summary::-webkit-details-marker { display: none; }
.sha summary .icon { width: 16px; height: 16px; }
.sha summary:hover { color: var(--accent-cyan-bright); }
.sha-value {
    display: block;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
    user-select: all;
}
.sha-hint { margin-top: 6px; color: var(--text-muted); font-size: 12px; }

.recent { margin-top: 48px; max-width: 560px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); }
.table tr:hover td { background: var(--surface-hover); }

/* ---------------------------------------------------------------- formuláre a správy */
.auth { display: flex; justify-content: center; padding: 64px var(--gutter) 96px; }
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-panel);
    background: var(--surface-panel);
}
.auth-card h1 { font-size: 28px; font-weight: 700; }
.auth-lead { margin: 8px 0 24px; color: var(--text-secondary); }
.auth-alt { margin-top: 20px; color: var(--text-muted); font-size: 14px; text-align: center; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.field small { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    transition: border-color var(--t-hover), box-shadow var(--t-select);
}
.field input:hover { border-color: var(--line-hover); }
.field input:focus { outline: none; border-color: var(--accent-cyan); box-shadow: var(--glow-hint); }
.field input:disabled { opacity: 0.5; }
.checkbox { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent-cyan); }

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    color: var(--text-primary);
    font-size: 14px;
}
.alert-error { border-color: var(--state-danger); }
.alert-warn { border-color: var(--state-warn); }

/* ---------------------------------------------------------------- pätička = stavový riadok */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line-strong);
    background: var(--surface-base);
    color: var(--text-muted);
    font-size: 14px;
}
.footer-inner {
    display: grid;
    gap: 32px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 48px var(--gutter) 32px;
}
.footer-brand img { width: 120px; height: auto; margin-bottom: 14px; }
.footer-brand p { max-width: 360px; color: var(--text-secondary); }
.footer-brand .footer-muted { margin-top: 6px; color: var(--text-muted); }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li + li { margin-top: 6px; }
.footer-col a { color: var(--text-secondary); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px var(--gutter) 24px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
}
.footer-privacy { display: flex; gap: 8px; max-width: 760px; }
.footer-privacy .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-cyan); }
.footer-copy { color: var(--text-faint); }

@media (min-width: 760px) {
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------------------------------------------------------------- spoločné doplnky */
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.small { font-size: 13px; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.pill-warn { border-color: var(--accent-amber); color: var(--accent-amber); }
.pill-danger { border-color: var(--state-danger); color: var(--state-danger); }
.pill-role { border-color: var(--accent-violet); color: var(--accent-violet); }
.role-admin { color: var(--accent-violet); font-weight: 500; }
.alert-ok { border-color: var(--accent-cyan); }

/* Deštruktívna akcia: tmavá výplň, koralový okraj a text (xanora-look 6.2) — nie plná farba. */
.btn-danger { background: var(--surface-raised); border-color: var(--state-danger); color: var(--state-danger); }
.btn-danger:hover { background: var(--surface-hover); color: var(--text-primary); }

.footer-xone { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-muted); }
.footer-xone img { width: 58px; height: auto; }

.field select {
    height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background-color: var(--surface-raised);
    background-image: url("../img/chevron-select.svg");
    background-position: right 10px center;
    background-size: 18px;
    background-repeat: no-repeat;
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
    appearance: none;
}
.field select:focus { outline: none; border-color: var(--accent-cyan); box-shadow: var(--glow-hint); }
.field select option { background: var(--surface-raised); color: var(--text-primary); }

/* ---------------------------------------------------------------- správa
   Rozloženie aplikácie: bočný panel = knižnica (xanora-look 7.3), obsah = panely s okrajom. */
.adm-app { display: grid; flex: 1 0 auto; grid-template-columns: minmax(0, 1fr); }

.adm-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px var(--gutter);
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-panel);
}
.adm-brand { display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.adm-brand img { width: 112px; height: auto; }
.adm-brand:hover { color: var(--text-secondary); }

.adm-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}
.adm-nav a .icon { width: 18px; height: 18px; }
.adm-nav a:hover { background: var(--surface-hover); color: var(--text-primary); }
/* Aktívna položka: zdvihnutá plocha, gradientový okraj azúrová → purpurová, azúrový text, žiara. */
.adm-nav a.is-on {
    border-color: transparent;
    background:
        linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
        linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta)) border-box;
    color: var(--accent-cyan-bright);
    box-shadow: var(--glow-hint);
}
:root[data-theme="default"] .adm-nav a.is-on { background: var(--surface-active); border-color: var(--line-hover); }

.adm-me { display: none; }
.adm-me-mail { overflow: hidden; color: var(--text-primary); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.adm-me-role { color: var(--accent-violet); font-size: 13px; }
.adm-me-links { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: 14px; }
.adm-me-links a { color: var(--text-secondary); }
.adm-me-links a:hover { color: var(--text-primary); }
.adm-me-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.adm-main { min-width: 0; padding: 24px var(--gutter) 64px; }
.adm-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.adm-head h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; }
.adm-title-email { overflow-wrap: anywhere; }
.adm-head-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-crumb { margin-bottom: 8px; font-size: 14px; }

.adm-panel {
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-panel);
    background: var(--surface-panel);
}
.adm-panel h2 { margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.adm-panel-flush { padding: 0; overflow: hidden; }
.adm-empty { padding: 20px; }
.adm-more { margin-top: 12px; font-size: 14px; }
.adm-cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
.adm-cols .adm-panel { margin-bottom: 0; }

/* Štatistiky ako dlaždice knižnice; počet tabulárnymi číslicami. */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    color: var(--text-primary);
    transition: border-color var(--t-hover);
}
a.stat:hover { border-color: var(--line-hover); color: var(--text-primary); }
.stat-label { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-warn { border-color: var(--accent-amber); }
.stat-warn .stat-value { color: var(--accent-amber); }

/* Stĺpce stiahnutí: dráha ako posuvník v inšpektore, výplň SliderFill. */
.bars { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.bars-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text-secondary); font-size: 14px; }
.bars-label .icon { width: 18px; height: 18px; color: var(--accent-cyan-bright); }
.bars-value { min-width: 110px; text-align: right; }
.bars-value small, .bars-label small { color: var(--text-muted); font-size: 12px; }
.bars progress { width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--slider-track); appearance: none; }
.bars progress::-webkit-progress-bar { border-radius: 3px; background: var(--slider-track); }
.bars progress::-webkit-progress-value { border-radius: 3px; background: var(--slider-fill); }
.bars progress::-moz-progress-bar { border-radius: 3px; background: var(--slider-fill); }

/* Filtre zoznamu */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.field-inline { position: relative; flex: 1 1 260px; }
.field-inline input { width: 100%; padding-left: 38px; }
.field-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
/* Segmentový prepínač ako prepínače nad časovou osou: zapnutý = SurfaceActive + azúrový okraj. */
.segmented { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface-raised); }
.segmented a { padding: 6px 12px; border: 1px solid transparent; border-radius: var(--radius-small); color: var(--text-secondary); font-size: 14px; white-space: nowrap; }
.segmented a:hover { color: var(--text-primary); }
.segmented a.is-on { border-color: var(--accent-cyan); background: var(--surface-active); color: var(--accent-cyan-bright); box-shadow: var(--glow-hint); }

.table-wrap { overflow-x: auto; }
.table th {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line-strong);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.table th.num, .table td.num { font-variant-numeric: tabular-nums; }
.table-adm th:first-child, .table-adm td:first-child { padding-left: 20px; }
.table-adm th:last-child, .table-adm td:last-child { padding-right: 20px; }
.table td a { color: var(--text-primary); }
.table td a:hover { color: var(--accent-cyan-bright); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; font-size: 14px; }

.dl { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; }
.dl dt { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.dl dd { margin: 2px 0 0; }

/* Akcia s potvrdením bez JS: klik rozbalí otázku, až „Áno“ odošle formulár. */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] summary { border-color: var(--accent-cyan); }
.confirm-box {
    max-width: 360px;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid var(--line-hover);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 14px;
}
.confirm-box form { margin-top: 10px; }
.role-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.role-form .field { flex: 1 1 200px; }
.role-form p { flex-basis: 100%; }

@media (min-width: 900px) {
    .adm-app { grid-template-columns: 240px minmax(0, 1fr); }
    .adm-side {
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 24px 16px;
        border-right: 1px solid var(--line-strong);
        border-bottom: 0;
    }
    .adm-nav { flex-direction: column; flex-wrap: nowrap; }
    .adm-me { display: block; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
    .adm-main { padding: 32px 40px 80px; }
    .adm-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
    /* bez bočného panelu: odhlásenie a jazyk ostanú dostupné pod menu */
    .adm-side .adm-me { display: block; }
    .adm-me-mail, .adm-me-role, .adm-me-links { display: none; }
}
@media (max-width: 560px) {
    .bars li { grid-template-columns: minmax(0, 1fr) auto; }
    .bars progress { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------------------------------------------------------------- pohyb */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
