/*
 * EyeAI design system
 * Neutrálna, pokojná paleta (inšpirovaná ChatGPT) + jeden akcent (teal) pre stavy a fokus.
 * Téma: <html data-theme="system|light|dark">.
 */

/* ---------- Tokens ---------- */
:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-sidebar: #f9f9f9;
    --surface: #ffffff;
    --surface-2: #f4f4f4;
    --surface-hover: #ececec;
    --text: #0d0d0d;
    --text-2: #5d5d5d;
    --text-3: #8f8f8f;
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --btn-bg: #0d0d0d;
    --btn-text: #ffffff;
    --btn-hover: #2f2f2f;
    --accent: #0f8f7e;
    --accent-soft: #e5f4f1;
    --success: #12805c;
    --success-soft: #e6f5ee;
    --danger: #d92d20;
    --danger-strong: #d92d20;
    --danger-soft: #fdecea;
    --warning: #b54708;
    --warning-soft: #fef4e6;
    --focus-ring: 0 0 0 3px rgba(15, 143, 126, .25);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .08), 0 0 0 1px var(--border);
    --backdrop: rgba(0, 0, 0, .3);
}

/* Tmavá téma – explicitná voľba */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #212121;
    --bg-sidebar: #171717;
    --surface: #2a2a2a;
    --surface-2: #2f2f2f;
    --surface-hover: #383838;
    --text: #ececec;
    --text-2: #b4b4b4;
    --text-3: #8a8a8a;
    --border: #383838;
    --border-strong: #4a4a4a;
    --btn-bg: #ececec;
    --btn-text: #0d0d0d;
    --btn-hover: #d4d4d4;
    --accent: #3cc7ae;
    --accent-soft: rgba(60, 199, 174, .14);
    --success: #4cc38a;
    --success-soft: rgba(76, 195, 138, .14);
    --danger: #f97066;
    --danger-strong: #c8322a;
    --danger-soft: rgba(249, 112, 102, .14);
    --warning: #fdb022;
    --warning-soft: rgba(253, 176, 34, .14);
    --focus-ring: 0 0 0 3px rgba(60, 199, 174, .3);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px var(--border);
    --backdrop: rgba(0, 0, 0, .55);
}

/* Tmavá téma – podľa systému */
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        color-scheme: dark;
        --bg: #212121;
        --bg-sidebar: #171717;
        --surface: #2a2a2a;
        --surface-2: #2f2f2f;
        --surface-hover: #383838;
        --text: #ececec;
        --text-2: #b4b4b4;
        --text-3: #8a8a8a;
        --border: #383838;
        --border-strong: #4a4a4a;
        --btn-bg: #ececec;
        --btn-text: #0d0d0d;
        --btn-hover: #d4d4d4;
        --accent: #3cc7ae;
        --accent-soft: rgba(60, 199, 174, .14);
        --success: #4cc38a;
        --success-soft: rgba(76, 195, 138, .14);
        --danger: #f97066;
    --danger-strong: #c8322a;
        --danger-soft: rgba(249, 112, 102, .14);
        --warning: #fdb022;
        --warning-soft: rgba(253, 176, 34, .14);
        --focus-ring: 0 0 0 3px rgba(60, 199, 174, .3);
        --shadow-pop: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px var(--border);
        --backdrop: rgba(0, 0, 0, .55);
    }
}

:root {
    --font: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-w: 248px;
    /* QR kód musí byť tmavý na svetlom pozadí v každej téme (inak ho aplikácie nenačítajú). */
    --qr-bg: #ffffff;

    /* Typografická škála – kompaktné UI. Zmena veľkosti písma = zmena tu. */
    --fs-2xs: 10.5px;
    --fs-xs: 11px;
    --fs-sm: 11.5px;
    --fs-base: 12px;
    --fs-md: 13px;
    --fs-lg: 14px;
    --fs-xl: 15px;
    --fs-2xl: 17px;
    --fs-3xl: 20px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font: var(--fs-base)/1.5 var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 12px; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: var(--fs-sm); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.icon { flex-shrink: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 32px; padding: 0 14px;
    font: 500 var(--fs-base)/1 var(--font);
    color: var(--btn-text); background: var(--btn-bg);
    border: 1px solid transparent; border-radius: 999px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--btn-hover); }
.btn-block { width: 100%; height: 42px; font-size: var(--fs-md); }
.btn-sm { height: 28px; padding: 0 11px; font-size: var(--fs-base); gap: 6px; }
.btn-secondary { color: var(--text); background: transparent; border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface-hover); }
.btn-danger { color: #fff; background: var(--danger-strong); }
.btn-danger:hover { background: var(--danger-strong); filter: brightness(1.1); }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.link:hover { text-decoration-color: currentColor; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field > label, .label { display: block; margin-bottom: 6px; font-weight: 500; font-size: var(--fs-base); }
.field > label.switch { display: inline-flex; margin-bottom: 0; }
.input,
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url],
.field textarea, .field select {
    width: 100%; min-height: 34px; padding: 7px 12px;
    font: var(--fs-base)/1.4 var(--font); color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.6; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-help { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.field-errors { list-style: none; margin: 6px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--danger); }
.form-errors { margin-bottom: 16px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.field-check .field-help { margin-left: 26px; margin-top: 2px; }

/* Prepínač (switch) – použitý pre checkboxy formulára */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; display: inline-block; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus-ring); }
.field-switch .field-help { margin-left: 48px; margin-top: 2px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

/* ---------- Alerts & toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: var(--fs-base); margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

.toasts {
    position: fixed; z-index: 60; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px;
    width: min(480px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
    --tone: var(--success); --tone-soft: var(--success-soft);
    position: relative; overflow: hidden;
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 14px 14px 18px;
    background: linear-gradient(var(--tone-soft), var(--tone-soft)), var(--surface);
    color: var(--text); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border)); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
    font-size: var(--fs-md); font-weight: 500; line-height: 1.45;
    pointer-events: auto; animation: toast-in .25s cubic-bezier(.2, .8, .2, 1);
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.toast-error { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.toast > .icon { color: var(--tone); width: 20px; height: 20px; margin-top: -1px; }
.toast .toast-close { margin: -6px -6px -6px auto; flex-shrink: 0; }
.toast .toast-progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--tone); opacity: .5; animation: toast-progress linear forwards; }
.toast.is-hiding { opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toast-progress { from { width: 100%; } to { width: 0; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.dot-on, .dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-neutral { background: var(--text-3); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100dvh; }

.sidebar {
    position: sticky; top: 0; z-index: 40;
    display: flex; flex-direction: column;
    width: var(--sidebar-w); height: 100dvh; flex-shrink: 0;
    padding: 8px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: var(--fs-lg); text-decoration: none; color: var(--text); letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: var(--bg); }
.sb-close { display: none; }
.sb-scroll { flex: 1; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.sb-item {
    display: flex; align-items: center; gap: 10px;
    height: 30px; padding: 0 10px; border-radius: var(--radius-sm);
    color: var(--text); text-decoration: none; font-size: var(--fs-base);
}
.sb-item:hover, .sb-item.active { background: var(--surface-hover); }
.sb-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item .icon { color: var(--text-2); }
.sb-new { margin-bottom: 4px; }
.sb-label { padding: 16px 10px 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.sb-project { height: 28px; font-size: var(--fs-base); }
.sb-empty { padding: 4px 10px; font-size: var(--fs-base); color: var(--text-3); }

.sb-foot { position: relative; padding-top: 8px; border-top: 1px solid var(--border); }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.user-btn:hover, .user-menu[open] .user-btn { background: var(--surface-hover); }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase; flex-shrink: 0; }
.user-btn .who { flex: 1; min-width: 0; line-height: 1.3; }
.user-btn .who strong { display: block; font-weight: 500; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .who span { font-size: var(--fs-xs); color: var(--text-3); }
.popover {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
    padding: 6px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.popover .sb-item { height: 30px; }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-mobile { display: none; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 28px 64px; }
.content-wide { max-width: 1320px; }
.backdrop { display: none; }

/* ---------- Page elements ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-shrink: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: var(--fs-base); color: var(--text-2); text-decoration: none; }
.back:hover { color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head p { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-base); }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.card-narrow { max-width: 640px; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-top: 1px solid var(--border); }
.danger-row:first-of-type { border-top: 0; padding-top: 0; }
.danger-row:last-child { padding-bottom: 0; }
.danger-row h3 { font-size: var(--fs-base); margin-bottom: 2px; }
.danger-row p { margin: 0; font-size: var(--fs-base); color: var(--text-2); }
.danger-row form { display: flex; gap: 8px; flex-shrink: 0; }
.danger-row .input { width: 200px; min-height: 30px; padding: 5px 12px; font-size: var(--fs-base); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; text-decoration: none; color: inherit; transition: border-color .15s, background-color .15s; }
.project-card:hover { border-color: var(--border-strong); background: var(--bg-sidebar); }
.project-card .domains { font-size: var(--fs-base); color: var(--text-2); overflow-wrap: anywhere; }
.project-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.project-card .meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 24px; }
.empty .empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--text-2); margin-bottom: 16px; }
.empty h2 { font-size: var(--fs-xl); margin-bottom: 6px; }
.empty p { max-width: 380px; color: var(--text-2); margin-bottom: 20px; }

dl.props { display: grid; grid-template-columns: 150px 1fr; gap: 10px 24px; margin: 0; }
dl.props dt { color: var(--text-2); }
dl.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); font: var(--fs-sm) var(--mono); }

.codeblock { border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.codeblock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-2); }
.codeblock pre { margin: 0; padding: 14px; overflow-x: auto; font: var(--fs-sm)/1.6 var(--mono); white-space: pre; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: 7px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table th { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); background: var(--bg-sidebar); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-sidebar); }
.table .nowrap { white-space: nowrap; }
.table .ctx { max-width: 420px; color: var(--text-2); overflow-wrap: anywhere; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 26px; height: 26px; font-size: var(--fs-2xs); }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.select-sm { height: 30px; padding: 0 28px 0 12px; font: var(--fs-base) var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar select { width: auto; min-width: 200px; min-height: 32px; height: 32px; padding: 0 14px; font-size: var(--fs-base); border-radius: 999px; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }

/* ---------- Theme picker ---------- */
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-option { position: relative; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-option .preview {
    display: block; height: 84px; border-radius: var(--radius); border: 1px solid var(--border-strong); overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.theme-option input:checked ~ .preview { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.theme-option input:focus-visible ~ .preview { box-shadow: var(--focus-ring); }
.theme-option .name { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 500; font-size: var(--fs-base); }
.theme-option .name .icon { color: var(--text-2); }
/* Mini náhľady témy */
.pv { display: flex; height: 100%; }
.pv-side { width: 30%; padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; }
.pv-main { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.pv i { display: block; height: 6px; border-radius: 3px; }
.pv-light .pv-side { background: #f9f9f9; } .pv-light .pv-main { background: #fff; }
.pv-light i { background: #e5e5e5; } .pv-light i.strong { background: #0d0d0d; width: 40%; }
.pv-dark .pv-side { background: #171717; } .pv-dark .pv-main { background: #212121; }
.pv-dark i { background: #383838; } .pv-dark i.strong { background: #ececec; width: 40%; }
.pv-system { display: flex; height: 100%; }
.pv-system .pv { width: 50%; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; }
.auth-brand { align-self: flex-start; }
.auth-main { flex: 1; display: flex; align-items: center; width: 100%; max-width: 360px; padding: 32px 0; }
.auth-box { width: 100%; }
.auth-box h1 { font-size: var(--fs-3xl); text-align: center; margin-bottom: 6px; }
.auth-box .lead { text-align: center; color: var(--text-2); margin-bottom: 24px; }
.auth-box .field input { min-height: 46px; padding: 12px 18px; border-radius: 999px; font-size: var(--fs-md); }
.auth-box .field > label { padding-left: 4px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 20px; font-size: var(--fs-base); }
.auth-row .check { font-weight: 400; }
.auth-foot { margin-top: 24px; text-align: center; font-size: var(--fs-base); color: var(--text-2); }
.auth-legal { font-size: var(--fs-xs); color: var(--text-3); text-align: center; }
.auth-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    :root { --sidebar-w: 236px; }
    .content { padding: 28px 24px 64px; }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .2s ease-out;
        box-shadow: none;
    }
    .app.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
    .app.sidebar-open .backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: var(--backdrop); }
    .sb-close { display: inline-flex; }
    .topbar-mobile {
        position: sticky; top: 0; z-index: 20;
        display: flex; align-items: center; gap: 8px;
        height: 52px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--border);
    }
    .topbar-mobile .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .content { padding: 20px 16px 56px; }
    h1 { font-size: var(--fs-2xl); }
    .page-head { flex-direction: column; gap: 12px; margin-bottom: 20px; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
    .card { padding: 16px; border-radius: var(--radius); }
    .table-flat { margin: 0 -16px -16px; }
    .table-flat .table th:first-child, .table-flat .table td:first-child { padding-left: 16px; }
    .table-flat .table th:last-child, .table-flat .table td:last-child { padding-right: 16px; }
    .grid { gap: 10px; }
    .toolbar .input, .toolbar select { flex: 1 1 100%; min-width: 0; }
    .toolbar .btn { flex: 1; }
    .form-actions .btn { flex: 1; }
    .table-wrap { border-radius: var(--radius); }
    .hide-mobile { display: none; }
    dl.props { grid-template-columns: 1fr; gap: 2px; }
    dl.props dd { margin-bottom: 10px; }
    .danger-row { flex-direction: column; align-items: stretch; }
    .danger-row form { flex-wrap: wrap; }
    .danger-row .input { flex: 1; width: auto; }
    .theme-picker { gap: 8px; }
    .theme-option .preview { height: 56px; }
    .theme-option .name { font-size: var(--fs-sm); }
}

@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    /* Tabuľka ako zoznam (história prihlásení) */
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td { padding: 0 !important; border: 0; }
    .table-stack td[data-cell=device] { grid-column: 1 / -1; order: 3; }
    .table-stack td[data-cell=event] { text-align: right; }
    .table-stack td.hide-mobile { display: none; }
    .theme-option .name .icon { display: none; }
    .table-stack tbody tr:hover td { background: none; }
}

@media (max-width: 420px) {
    .auth-row { flex-direction: column; align-items: flex-start; }
    .danger-row form { flex-direction: column; align-items: stretch; }
    .danger-row .input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* História prihlásení */
.table-flat { border: 0; border-radius: 0; margin: 0 -16px -16px; }
.table-flat .table th:first-child, .table-flat .table td:first-child { padding-left: 16px; }
.table-flat .table th:last-child, .table-flat .table td:last-child { padding-right: 16px; }
.table-flat .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
.cell-device { display: flex; align-items: center; gap: 10px; }
.cell-device .badge { margin-left: 6px; }
.device-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.theme-picker { max-width: 600px; }

/* Aktivácia projektu */
.card-highlight { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; gap: 14px; }
.step-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-text); font-size: var(--fs-sm); font-weight: 600; flex-shrink: 0; }
.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin: 2px 0 10px; }
.step-body > p { margin: -4px 0 10px; font-size: var(--fs-base); }
.inline-field { display: flex; gap: 8px; }
.inline-field .input { flex: 1; min-width: 0; }
@media (max-width: 560px) {
    .inline-field { flex-direction: column; }
    .step { gap: 10px; }
}

/* Projekt – hlavička a záložky (GitHub štýl) */
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-head { margin: -4px 0 18px; border-bottom: 1px solid var(--border); }
.project-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.project-title h1 { font-size: var(--fs-2xl); }
.project-sub { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: var(--fs-base); min-width: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: -1px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
    padding: 6px 10px 10px; font-size: var(--fs-base); color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent;
}
.tab::before { content: ""; position: absolute; inset: 0 0 6px; border-radius: var(--radius-sm); z-index: -1; transition: background-color .15s; }
.tab:hover { color: var(--text); }
.tab:hover::before { background: var(--surface-hover); }
.tab.is-active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab.is-active .icon { color: var(--text); }
.tab.is-disabled { color: var(--text-3); cursor: default; }
.tab.is-disabled:hover::before { background: none; }
.tab-count { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); font-size: var(--fs-2xs); font-weight: 500; color: var(--text-3); }

/* Štatistiky */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stats .card + .card { margin-top: 0; }
.stat { padding: 12px 14px; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.stat-value { margin-top: 4px; font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; }
.stat-hint { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-3); }
.stats + .card, .card-highlight + .stats { margin-top: 16px; }
dl.props-compact { margin-top: 18px; }
@media (max-width: 860px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .project-head { margin-top: 0; }
}

/* Toasty v aplikácii: centrovať nad obsah (vpravo od bočného panela) */
@media (min-width: 861px) {
    body:has(.app) .toasts { left: calc(50% + var(--sidebar-w) / 2); }
}

/* ---------- Relácie ---------- */
.text-danger { color: var(--danger); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.num-danger { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 600; }
.num-danger::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.empty-sm { padding: 36px 16px; }

/* Súhrnný pás metrík */
.metric-strip { display: flex; flex-wrap: wrap; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric { flex: 1 1 120px; display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; border-left: 1px solid var(--border); }
.metric:first-child { border-left: 0; }
.metric-label { font-size: var(--fs-xs); color: var(--text-2); }
.metric-value { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.metric-value small { font-size: var(--fs-xs); font-weight: 400; color: var(--text-2); }

/* Segmentové prepínače (filtre) */
.toolbar { gap: 8px; margin-bottom: 10px; }
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.segmented a, .segmented button {
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border: 0; border-radius: 999px;
    background: none; font: var(--fs-sm) var(--font); color: var(--text-2); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.segmented a:hover, .segmented button:hover:not(:disabled) { color: var(--text); }
.segmented .is-active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented button:disabled { opacity: .45; cursor: default; }
.segmented .count { font-size: var(--fs-2xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented-xs a, .segmented-xs button { height: 22px; padding: 0 8px; font-size: var(--fs-xs); }

/* Hustá tabuľka relácií */
.table-dense th, .table-dense td { padding: 6px 10px; }
.table-dense th { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .04em; }
.table-sessions td { vertical-align: middle; }
.table-sessions .group-row td {
    padding: 5px 10px; background: var(--bg-sidebar); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
    border-bottom: 1px solid var(--border);
}
.table-sessions tbody tr.group-row:hover td { background: var(--bg-sidebar); }
.row-link { cursor: pointer; }
.row-link.has-errors td:first-child { box-shadow: inset 2px 0 0 var(--danger); }
.cell-play { width: 32px; padding-right: 0 !important; }
.play-btn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.row-link:hover .play-btn { background: var(--btn-bg); color: var(--btn-text); }
.cell-journey { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); }
.cell-journey .path { color: var(--text); }
.cell-journey .arrow { margin: 0 5px; color: var(--text-3); }
.cell-device-sm { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.cell-device-sm .icon { color: var(--text-3); }

/* Detail relácie */
.session-head { margin-bottom: 12px; }
.session-title { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.session-title h2 { font-size: var(--fs-xl); }
.meta-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text); }
.meta-list li { display: inline-flex; align-items: center; gap: 5px; }
.meta-list .icon { color: var(--text-3); }
.meta-list .text-danger .icon { color: var(--danger); }
.journey { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.journey li { display: inline-flex; align-items: center; gap: 4px; }
.journey li + li::before { content: "→"; color: var(--text-3); font-size: var(--fs-xs); }
.journey-step {
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    height: 22px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
    font: var(--fs-xs) var(--mono); color: var(--text); cursor: pointer;
}
.journey-step:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.replay-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.player-frame { position: relative; min-height: 300px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.player-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--text-2); }
.player-frame .rr-player { box-shadow: none !important; border-radius: 0; background: var(--surface) !important; width: 100% !important; }
.player-frame .rr-player__frame { background: #fff; }
.player-frame .rr-controller { background: var(--surface) !important; border-top: 1px solid var(--border); }

.replay-timeline { padding: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 120px); position: sticky; top: 16px; }
.timeline-head { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 8px; border-bottom: 1px solid var(--border); }
.timeline-head h2 { font-size: var(--fs-md); }
.replay-timeline > .muted { padding: 12px; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.tl-item {
    display: grid; grid-template-columns: 34px 18px minmax(0, 1fr); gap: 6px; align-items: center;
    width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none;
    font: var(--fs-sm)/1.35 var(--font); color: var(--text); text-align: left; cursor: pointer;
}
.tl-item:hover { background: var(--surface-hover); }
.tl-item.is-current { background: var(--accent-soft); }
.tl-time { font-size: var(--fs-2xs); color: var(--text-3); text-align: right; }
.tl-icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.tone-accent .tl-icon { background: var(--accent-soft); color: var(--accent); }
.tone-danger .tl-icon { background: var(--danger-soft); color: var(--danger); }
.tl-item.tone-danger strong { color: var(--danger); }
.tl-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tl-text strong { font-weight: 500; color: var(--text); margin-right: 4px; }
.recent-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; }
.recent-head h2 { font-size: var(--fs-md); }

@media (max-width: 1100px) {
    .replay-body { grid-template-columns: 1fr; }
    .replay-timeline { position: static; max-height: 420px; }
}
@media (max-width: 560px) {
    .metric { flex-basis: 33%; border-left: 0; border-top: 1px solid var(--border); padding: 7px 10px; }
    .metric:nth-child(-n+3) { border-top: 0; }
    .metric-value { font-size: var(--fs-md); }
    /* tabuľka relácií ako karty */
    .table-sessions thead { display: none; }
    .table-sessions, .table-sessions tbody { display: block; }
    .table-sessions tr.row-link { display: grid; grid-template-columns: 28px auto 1fr auto; grid-template-areas: "play time stats errors" "play journey journey journey"; gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
    .table-sessions tr.group-row { display: block; }
    .table-sessions tr.group-row td { display: block; }
    .table-sessions tr.row-link td { padding: 0 !important; border: 0; }
    .table-sessions td[data-cell=play] { grid-area: play; align-self: center; }
    .table-sessions td[data-cell=time] { grid-area: time; font-weight: 600; }
    .table-sessions td[data-cell=duration] { grid-area: stats; text-align: left !important; color: var(--text-2); }
    .table-sessions td[data-cell=errors] { grid-area: errors; }
    .table-sessions td[data-cell=journey] { grid-area: journey; max-width: none; }
    .table-sessions td[data-cell=pages], .table-sessions td[data-cell=clicks], .table-sessions td[data-cell=device] { display: none; }
    .session-title h2 { font-size: var(--fs-lg); }
}

/* rrweb-player – farby podľa tém EyeAI (knižnica má natvrdo modrú #4950f6) */
.player-frame .rr-progress__handler,
.player-frame .rr-controller__btns button.active { background: var(--btn-bg) !important; color: var(--btn-text) !important; }
.player-frame .rr-progress { background: var(--surface-2) !important; border-color: var(--surface) !important; }
.player-frame .rr-progress__step { background: var(--accent-soft) !important; }
.player-frame .rr-timeline__time { color: var(--text-2) !important; font-family: var(--mono); font-size: var(--fs-xs) !important; }
.player-frame .rr-controller__btns button { color: var(--text) !important; font: var(--fs-sm) var(--font) !important; }
.player-frame .rr-controller__btns button:hover { background: var(--surface-hover) !important; }
.player-frame .rr-controller__btns button svg { fill: currentColor !important; }
.player-frame .switch label { color: var(--text-2) !important; font-size: var(--fs-sm) !important; }
.player-frame .switch input[type=checkbox]:checked + label:before { background: var(--accent) !important; }
.player-frame .switch label:before { background: var(--border-strong) !important; }
.player-frame .replayer-mouse:after { background: var(--accent) !important; }
.player-frame .rr-custom-event { background: var(--danger) !important; }

@media (max-width: 560px) {
    .row-link.has-errors td:first-child { box-shadow: none; }
    .table-sessions tr.row-link.has-errors { box-shadow: inset 3px 0 0 var(--danger); }
}

/* ---------- AI analýza zážitku (Insights) ---------- */
.alert-info { background: var(--accent-soft); color: var(--accent); }
.insights { margin: 18px 0 12px; }
.insights-kicker { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.insights-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.insights-head h2 { margin-top: 8px; font-size: var(--fs-xl); }
.insights-headline { margin: 6px 0 4px; font-size: var(--fs-lg); line-height: 1.45; color: var(--text); max-width: 760px; }
.insights-meta { margin: 0; font-size: var(--fs-xs); color: var(--text-3); }
.insights-run { margin: 0; flex-shrink: 0; }
.insights-inline-status { margin-bottom: 10px; }
.insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.insight-card {
    --tone: var(--text-2); --tone-soft: var(--surface-2);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.tone-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.tone-accent { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.tone-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.insight-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; background: linear-gradient(var(--tone-soft), transparent); border-bottom: 1px solid var(--border); }
.insight-card-head h3 { font-size: var(--fs-md); }
.insight-card-head p { margin: 0; font-size: var(--fs-xs); color: var(--text-2); }
.insight-icon { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--tone-soft); color: var(--tone); }
.insight-empty { margin: 0; padding: 12px 14px; font-size: var(--fs-sm); color: var(--text-3); }
.insight-list { list-style: none; margin: 0; padding: 4px 0; }
.insight { padding: 9px 14px; border-top: 1px solid var(--border); }
.insight:first-child { border-top: 0; }
.insight-title { display: flex; align-items: baseline; gap: 8px; }
.insight-title strong { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }
.insight p { margin: 3px 0 0 22px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.insights-summary { margin: 0 0 6px; max-width: 760px; font-size: var(--fs-base); line-height: 1.55; color: var(--text-2); }
.insight p.insight-action { color: var(--text); }
.insight-action span { font-weight: 600; color: var(--tone); }
.insight-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 22px; }
.insight-impact, .insight-tag { display: inline-flex; height: 18px; padding: 0 7px; align-items: center; border-radius: 999px; background: var(--tone-soft); color: var(--tone); font-size: var(--fs-2xs); font-weight: 600; }
.insight-tag { background: var(--surface-2); color: var(--text-2); font-weight: 500; }
.insight-tag.effort-quick_win { background: var(--accent-soft); color: var(--accent); }
.insight-tag.confidence-low { background: var(--warning-soft); color: var(--warning); cursor: help; }
.insight-tag.confidence-medium { cursor: help; }
.insight-priorities { margin-bottom: 10px; padding: 0; overflow: hidden; }
.insight-priorities-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.insight-priorities-head h3 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); }
.insight-priorities-head h3 svg { color: var(--accent); }
.insight-priorities-head p { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-2); }
.insight-priority-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.insight-priority-list li { display: flex; gap: 10px; padding: 12px 14px; border-left: 1px solid var(--border); }
.insight-priority-list li:first-child { border-left: 0; }
.insight-priority-list strong { display: block; font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }
.insight-priority-list p { margin: 3px 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.insight-priority-list .insight-tags { margin-left: 0; }
.insight-priority-no { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--tone-soft); color: var(--tone); font-size: var(--fs-xs); font-weight: 700; }
.sev { display: inline-flex; gap: 2px; flex-shrink: 0; transform: translateY(-1px); }
.sev i { width: 4px; height: 10px; border-radius: 2px; background: var(--border-strong); }
.sev-1 .sev i:nth-child(-n+1), .sev-2 .sev i:nth-child(-n+2), .sev-3 .sev i { background: var(--tone); }

.insights-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 20px; }
.insights-state h2 { font-size: var(--fs-lg); margin-top: 12px; }
.insights-state p { margin: 4px 0 0; color: var(--text-2); }
.insights-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.insights-teaser { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 18px; }
.insights-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; filter: blur(.6px); opacity: .85; user-select: none; }
.preview-card { --tone: var(--text-2); --tone-soft: var(--surface-2); display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-top: 3px solid var(--tone); border-radius: var(--radius-sm); background: var(--surface); }
.preview-card strong { font-size: var(--fs-xs); }
.preview-card .insight-icon { width: 22px; height: 22px; }
.preview-card i { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); }
.preview-card i.short { width: 60%; }
.insights-teaser-body h2 { margin: 8px 0 6px; font-size: var(--fs-xl); }
.insights-teaser-body > p { color: var(--text-2); }
.insights-progress { height: 6px; margin: 12px 0 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.insights-progress span { display: block; height: 100%; width: var(--progress); background: var(--accent); border-radius: 999px; }
.insights-teaser .insights-run { margin-top: 10px; }
@media (max-width: 860px) {
    .insights-grid, .insights-teaser { grid-template-columns: 1fr; }
    .insight-priority-list { grid-template-columns: 1fr; }
    .insight-priority-list li { border-left: 0; border-top: 1px solid var(--border); }
    .insight-priority-list li:first-child { border-top: 0; }
    .insights-head { flex-direction: column; }
    .insights-preview { order: 2; }
}

/* ---------- Detail relácie: zhrnutie + priebeh, prehrávač vpravo ---------- */
.session-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 14px; align-items: start; }
.session-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.session-main .card + .card { margin-top: 0; }
.session-side { position: sticky; top: 16px; }
.session-side .player-frame { min-height: 220px; }
.summary-card { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); background: linear-gradient(var(--accent-soft), transparent 60%), var(--surface); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.summary-text { margin: 0; font-size: var(--fs-lg); line-height: 1.6; color: var(--text); }
.summary-intent { margin: 8px 0 0; font-size: var(--fs-base); color: var(--text-2); }
.summary-note { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--text-3); }
.summary-loading { display: flex; flex-direction: column; gap: 7px; }
.summary-loading i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.summary-loading i.short { width: 55%; }
.summary-loading span { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
.mood { gap: 6px; }
.mood .sev i { background: var(--border-strong); }
.mood-1 .sev i:nth-child(1), .mood-2 .sev i:nth-child(-n+2), .mood-3 .sev i { background: currentColor; }

.story { list-style: none; margin: 0; padding: 0 0 0 6px; }
.story > li { position: relative; padding: 0 0 14px 22px; }
.story > li::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 2px; background: var(--border); }
.story > li:last-child { padding-bottom: 0; }
.story > li:last-child::before { display: none; }
.story-dot { position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.story-edge { font-size: var(--fs-sm); color: var(--text-2); }
.story-edge .story-dot { border-color: var(--border-strong); }
.story-exit .story-dot { background: var(--border-strong); }
.story-step.has-errors .story-dot { border-color: var(--danger); background: var(--danger-soft); }
.story-step.has-rage:not(.has-errors) .story-dot { border-color: var(--warning); background: var(--warning-soft); }
.story-line { display: flex; align-items: baseline; gap: 8px; }
.story-path { padding: 0; border: 0; background: none; font: 600 var(--fs-md) var(--mono); color: var(--text); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.story-path:hover { text-decoration: underline; }
.story-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
.fact { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border: 0; border-radius: 6px; background: var(--surface-2); font: var(--fs-sm) var(--font); color: var(--text-2); text-align: left; }
button.fact { cursor: pointer; }
button.fact:hover { filter: brightness(.97); }
.fact-danger { background: var(--danger-soft); color: var(--danger); }
.fact-warning { background: var(--warning-soft); color: var(--warning); }

.events-details { padding: 0; }
.events-details > summary { padding: 12px 16px; cursor: pointer; font-weight: 500; color: var(--text-2); list-style: none; }
.events-details > summary::-webkit-details-marker { display: none; }
.events-details > summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform .15s; }
.events-details[open] > summary::before { transform: rotate(90deg); }
.events-details[open] > summary { border-bottom: 1px solid var(--border); }
.events-details .timeline { max-height: 420px; }
.events-details .timeline-head { border-bottom: 0; padding-bottom: 0; }

@media (max-width: 1100px) {
    .session-layout { grid-template-columns: 1fr; }
    .session-side { position: static; } /* na mobile najprv zhrnutie, potom prehrávač */
}

/* ---------- Organizácie a tím ---------- */
.org-switch { position: relative; margin: 0 0 8px; }
.org-switch > summary { list-style: none; cursor: pointer; }
.org-switch > summary::-webkit-details-marker { display: none; }
.org-btn { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-base); }
.org-switch[open] .org-btn, summary.org-btn:hover { background: var(--surface-hover); }
.org-static { cursor: default; }
.org-btn .org-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--fs-2xs); text-transform: uppercase; flex-shrink: 0; }
.org-btn .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.org-btn .chev { color: var(--text-3); }
.org-switch .popover { top: calc(100% + 6px); bottom: auto; z-index: 30; max-height: 320px; overflow-y: auto; }
.org-switch .popover form { margin: 0; }
.org-switch .popover button.sb-item { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.org-switch .popover .sb-item.current { font-weight: 600; }
.org-switch .popover .sb-item .check-mark { color: var(--accent); }
.org-switch .popover .role { font-size: var(--fs-xs); color: var(--text-3); }

.card-flush { padding: 0; }
.card-flush .table { margin: 0; }
.card-flush .table tr:last-child td { border-bottom: 0; }
.card-head-pad { padding: 14px 16px 0; margin-bottom: 10px; }
.cell-projects .badge { margin: 0 4px 3px 0; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .inline-form { display: inline-flex; }
.team-form-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.team-form-row .field { margin-bottom: 0; }
.team-form .field-help { margin: 6px 0 14px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; margin-bottom: 14px; }
.check-list .label, .check-list .field-help, .check-list > p { grid-column: 1 / -1; margin: 0; }
.check-list .check { font-weight: 400; font-size: var(--fs-base); }
.check-list[data-all] .check { opacity: .45; pointer-events: none; }
.check-list:not([data-all]) [data-owner-hint] { display: none; }
.member-edit { position: relative; display: inline-block; text-align: left; }
.member-edit > summary { list-style: none; }
.member-edit > summary::-webkit-details-marker { display: none; }
.member-edit-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 340px; max-width: calc(100vw - 32px);
    padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop);
    white-space: normal; display: grid; gap: 8px;
}
.member-edit-panel .check-list { grid-template-columns: 1fr; }
.btn-danger-text { color: var(--danger); }
.inline-form-grow .input { flex: 1; min-width: 0; }
.invite-projects { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: -8px 0 20px; }
.invite-projects .label { margin: 0 4px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.auth-box .alert { margin-top: 8px; }
@media (max-width: 560px) {
    .team-form-row { grid-template-columns: 1fr; gap: 0; }
    .team-form-row .field { margin-bottom: 14px; }
    .cell-actions { text-align: left; grid-column: 1 / -1; }
    .member-edit-panel { left: 0; right: auto; }
}

/* ---------- Nastavenia AI (admin) ---------- */
.ai-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.ai-form .btn { margin-top: 2px; }
.ai-remove { margin-top: 8px; font-weight: 400; font-size: var(--fs-sm); }
.ai-effective { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-effective .mono { color: var(--text); }
.ai-sep { color: var(--text-3); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.section-head h2 { margin: 0; }
.section-title { margin: 24px 0 10px; }
.ai-usage .stats { margin-bottom: 12px; }
@media (max-width: 860px) {
    .ai-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .section-head { flex-direction: column; align-items: flex-start; }
    tr[data-ai-org] td:nth-child(2) { grid-column: 1 / -1; }
}

/* ---------- Výber z možností (karty s radiom) – napr. režim súkromia ---------- */
.choice-list { display: grid; gap: 8px; }
.choice-card {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice-card:hover { background: var(--surface-2); }
.choice-card input { margin: 2px 0 0; width: 15px; height: 15px; flex: none; accent-color: var(--accent); }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--surface); }
.choice-card:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice-body { display: grid; gap: 3px; min-width: 0; }
.choice-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500; font-size: var(--fs-md); color: var(--text); }
.choice-text { color: var(--text-2); font-size: var(--fs-base); }

/* Potvrdenie zodpovednosti – len pri prechode na „Nemaskovať“ */
.privacy-ack {
    display: none; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--text); cursor: pointer;
}
.privacy-ack input { margin: 2px 0 0; width: 15px; height: 15px; flex: none; accent-color: var(--accent); }
.privacy-form:not(.is-none):has(input[name=privacy_mode][value=none]:checked) .privacy-ack { display: flex; }
.privacy-markers { margin-top: 14px; }
.privacy-markers > summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-base); }
.privacy-markers dl.props-compact { margin-top: 10px; }
.form-note { align-self: center; color: var(--text-3); font-size: var(--fs-sm); }

/* Profil systému (záložka projektu) */
.profile-page { display: grid; gap: 12px; }
.profile-page > .card, .profile-form .card { margin: 0; }
.profile-form .fieldset-reset { display: grid; gap: 12px; }
.profile-intro h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-meta { font-size: var(--fs-xs); color: var(--text-3); }
.profile-generate { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; flex-shrink: 0; }
.profile-limit { font-size: var(--fs-2xs); color: var(--text-3); }
.profile-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); }
.profile-hint svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.profile-generating { align-items: center; margin: 4px 0 0; }
.profile-generating .insights-spinner { width: 16px; height: 16px; border-width: 2px; flex-shrink: 0; }
.profile-benefits { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.profile-benefits li { display: flex; gap: 8px; align-items: flex-start; }
.profile-benefits svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.profile-errors { margin: 0; padding-left: 18px; }
.profile-form .field textarea:not([name$="[patterns]"]) { font-family: var(--font); font-size: var(--fs-base); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.profile-priorities { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: var(--fs-sm); cursor: pointer; }
.profile-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.profile-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.profile-rows { display: grid; gap: 0; }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .9fr) 32px; gap: 0 12px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.profile-row:first-child { border-top: 0; padding-top: 0; }
.profile-row .check { margin-top: 8px; font-size: var(--fs-sm); font-weight: 400; }
.profile-remove { margin-top: 24px; color: var(--text-3); }
.profile-remove:hover { color: var(--danger); background: var(--danger-soft); }
.profile-add { margin: 4px 0 12px; }
.profile-example { margin: -4px 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.profile-example strong { color: var(--text); font-weight: 600; }
.profile-legend { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.profile-legend summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.profile-legend p { margin: 6px 0 0; }
.profile-legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.profile-legend dt { font-weight: 600; color: var(--text); }
.profile-legend dd { margin: 0; }
.profile-stat { font-size: var(--fs-xs); color: var(--text-3); }
.profile-coverage { flex-shrink: 0; }
.profile-unmatched { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--warning-soft); font-size: var(--fs-sm); }
.profile-unmatched ul { margin: 6px 0 0; padding-left: 18px; }
.profile-unmatched code { font-size: var(--fs-xs); }
.profile-actions { align-items: center; margin-top: 0; }
.profile-form fieldset:disabled .profile-remove, .profile-form fieldset:disabled .profile-add { display: none; }
.profile-form fieldset:disabled .profile-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .9fr); }
.insights-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; font-size: var(--fs-xs); color: var(--text-2); }
.insights-profile svg { color: var(--accent); }
@media (max-width: 860px) {
    .profile-grid, .profile-row, .profile-form fieldset:disabled .profile-row { grid-template-columns: 1fr; }
    .profile-row { position: relative; }
    .profile-remove { position: absolute; top: 8px; right: 0; margin: 0; }
    .profile-row:first-child .profile-remove { top: -4px; }
    .profile-legend dl { grid-template-columns: 1fr; }
    .profile-legend dd { margin-bottom: 6px; }
    .profile-intro .card-head { flex-direction: column; align-items: flex-start; }
    .profile-generate { align-items: flex-start; }
}

/* AI zhrnutie relácie sa aktualizuje (relácia pokračovala) */
.summary-updating { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: 500; }
.summary-updating svg { animation: summary-pulse 1.4s ease-in-out infinite; }
@keyframes summary-pulse { 50% { opacity: .35; } }

/* Zistené problémy (záložka Problémy) */
.stat-link { position: relative; }
.stat-link:hover { border-color: var(--border-strong); }
.stat-link .stat-label a { color: inherit; text-decoration: none; }
.stat-link .stat-label a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.stat-link .stat-label a:focus-visible::after { box-shadow: var(--focus-ring); }
.issues-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.issues-head h2 { font-size: var(--fs-xl); }
.issues-head p { margin: 4px 0 0; color: var(--text-2); max-width: 720px; }
.issue-types { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; }
.issue-chip span { color: var(--text-3); }
.issue-chip:hover { color: var(--text); background: var(--surface-hover); }
.issue-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.issue-cell { display: flex; gap: 10px; align-items: flex-start; }
.issue-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--text-2)); }
.issue-icon-lg { width: 40px; height: 40px; border-radius: 10px; }
.issue-title { display: block; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.4; overflow-wrap: anywhere; }
.issue-title:hover { text-decoration: underline; }
.issue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-3); }
.issue-impact { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-2); }
.issues-table td { vertical-align: top; }
.issue-back { margin: 0 0 8px -8px; }
.issue-hero { padding-bottom: 0; overflow: hidden; }
.issue-hero-head { display: flex; gap: 14px; align-items: flex-start; }
.issue-hero-head > .min-w-0 { flex: 1; }
.issue-hero h2 { margin: 6px 0 4px; font-size: var(--fs-xl); line-height: 1.35; overflow-wrap: anywhere; }
.issue-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.issue-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.issue-actions form { margin: 0; }
.issue-state-note { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); font-size: var(--fs-sm); }
.issue-state-note.is-danger { background: var(--danger-soft); color: var(--danger); }
.issue-metrics { margin: 14px -16px 0; border-width: 1px 0 0; border-radius: 0; }
.issue-explain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.issue-explain .card { margin: 0; }
.issue-explain h3 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); margin-bottom: 6px; }
.issue-explain h3 svg { color: var(--accent); }
.issue-explain p { margin: 0; color: var(--text-2); line-height: 1.55; }
.issue-critical-note { margin-top: 8px !important; color: var(--warning) !important; font-weight: 500; }
.issue-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 4px; }
.issue-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; }
.issue-bar span { display: block; width: 100%; height: max(var(--h), 3px); border-radius: 3px 3px 0 0; background: var(--danger); opacity: .8; }
.issue-bar.is-zero span { height: 2px; background: var(--border-strong); }
.issue-bar:hover span { opacity: 1; }
.issue-chart-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-xs); color: var(--text-3); }
.issue-details summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.issue-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 0; font-size: var(--fs-sm); }
.issue-details dt { color: var(--text-3); }
.issue-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.issue-details pre { margin: 0; padding: 10px; max-height: 260px; overflow: auto; border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-xs); white-space: pre-wrap; }
@media (max-width: 860px) {
    .issues-head, .issue-hero-head { flex-direction: column; }
    .issue-explain { grid-template-columns: 1fr; }
    .issue-details dl { grid-template-columns: 1fr; }
    .issue-chart { height: 90px; gap: 2px; }
}

/* Prihlásenie – aktivácia emailu a dvojfázové overenie */
.link-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.auth-box .field input.otp-input { text-align: center; font-family: var(--mono); font-size: var(--fs-xl); letter-spacing: .25em; }
.auth-box .field input.otp-input::placeholder { font-family: var(--font); font-size: var(--fs-md); letter-spacing: normal; }
.setup-steps { margin: 8px 0 0; gap: 16px; }
.setup-steps .step-body > p { margin: 2px 0 10px; }
.qr-box { display: inline-grid; place-items: center; padding: 10px; border-radius: var(--radius); background: var(--qr-bg); border: 1px solid var(--border); }
.qr-box img { display: block; width: 180px; height: 180px; }
.secret-details { margin-top: 10px; font-size: var(--fs-base); }
.secret-details summary { cursor: pointer; color: var(--text-2); }
.secret-details p { margin: 6px 0; }
.secret-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.secret-row code { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-sm); word-break: break-all; }
.codeblock pre.backup-codes { columns: 2; text-align: center; font-size: var(--fs-md); line-height: 1.9; }
.auth-box .codeblock { margin-bottom: 16px; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.security-row:first-of-type { border-top: 0; padding-top: 0; }
.security-row h3 { margin: 0 0 2px; font-size: var(--fs-md); }
.security-row p { margin: 0; color: var(--text-2); font-size: var(--fs-base); }
.security-row .inline-form .input { width: 120px; text-align: center; font-family: var(--mono); letter-spacing: .15em; }
@media (max-width: 560px) {
    .security-row { flex-direction: column; align-items: stretch; }
    .security-row .inline-form .input { flex: 1; width: auto; }
}

/* ---------- Ochrana údajov ---------- */
.dp { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.dp h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-lg, 15px); }
.dp h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-base); font-weight: 600; }
.dp .card + .card { margin-top: 0; }
.dp-summary { background: var(--accent-soft); border-color: transparent; }
.dp-summary h2 .icon { color: var(--accent); }
.dp-checks, .dp-never, .dp-list, .dp-steps { margin: 0; padding: 0; list-style: none; }
.dp-checks, .dp-never { display: flex; flex-direction: column; gap: 8px; }
.dp-checks li, .dp-never li, .dp-note { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.dp-checks .icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.dp-never .icon { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.dp-flow > h2 { margin-bottom: 4px; }
.dp-flow > p { margin: 0 0 12px; }
.dp-steps { display: flex; flex-direction: column; gap: 10px; counter-reset: none; }
.dp-step { position: relative; }
.dp-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dp-step-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: var(--fs-sm); font-weight: 600; flex-shrink: 0; }
.dp-step h3 .icon { color: var(--text-3); }
.dp-step > p { margin: 0 0 8px; color: var(--text-2); line-height: 1.5; }
.dp-list { display: flex; flex-direction: column; gap: 5px; }
.dp-list li { position: relative; padding-left: 16px; line-height: 1.5; }
.dp-list li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dp-two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }
.dp-modes { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.dp-modes dt { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.dp-modes dd { margin: 2px 0 0; color: var(--text-2); line-height: 1.5; }
.dp-markers td:first-child { white-space: nowrap; width: 1%; }
.dp-note { margin: 0; font-size: var(--fs-sm); }
.dp-note .icon { flex-shrink: 0; margin-top: 2px; }
.sb-foot > .sb-item { margin-bottom: 4px; }
@media (max-width: 860px) {
    .dp-two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .dp-markers td:first-child { white-space: normal; width: auto; }
}

/* ---------- Prepínač jazyka (hore) ---------- */
.main-top { display: flex; justify-content: flex-end; padding: 12px 20px 0; }
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; cursor: pointer; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
    color: var(--text-2); font-size: var(--fs-sm); font-weight: 500;
}
.lang-btn:hover, .lang-switch[open] .lang-btn { background: var(--surface-hover); color: var(--text); }
.lang-menu { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; width: 180px; z-index: 50; }
.lang-menu .sb-item { display: flex; align-items: center; }
.lang-menu .sb-item.current { font-weight: 600; }
.lang-menu .check-mark { display: inline-flex; margin-left: auto; color: var(--accent); }
.auth-top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-mobile .lang-switch { margin-left: auto; }
@media (max-width: 860px) {
    .main-top { display: none; }
}
