/* ==========================================================================
   Knihovna tutoriálů – vzhled
   Design tokeny → základ → rozvržení → komponenty → stránky → responzivita
   ========================================================================== */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e9edf2;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #5b6577;
    --border: #e3e7ed;
    --border-strong: #cfd6e0;
    --primary: #4338ca;
    --primary-hover: #3730a3;
    --primary-soft: #eef0fd;
    --primary-contrast: #ffffff;
    --accent: #7c3aed;
    --danger: #c62828;
    --danger-soft: #fdecec;
    --ok: #0f7a3d;
    --ok-soft: #e3f6ea;
    --warn: #9a5b00;
    --warn-soft: #fdf1dc;
    --star: #e59e0b;
    --mark: #fde68a;
    --header-bg: rgba(255, 255, 255, .82);
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 4px 10px rgba(15, 23, 42, .05), 0 16px 32px -8px rgba(15, 23, 42, .12);
    --ring: 0 0 0 3px rgba(67, 56, 202, .22);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0c1018; --surface: #131925; --surface-2: #1a2130; --surface-3: #222b3c;
        --text: #e7eaf0; --text-2: #c3cad6; --muted: #929cae; --border: #252e3e; --border-strong: #34405a;
        --primary: #8b95ff; --primary-hover: #aab2ff; --primary-soft: #1c2142; --primary-contrast: #0c1018; --accent: #b794ff;
        --danger: #ff7b7b; --danger-soft: #3a1b20; --ok: #5ad48d; --ok-soft: #13301f; --warn: #f5b84a; --warn-soft: #36290f;
        --star: #f5b84a; --mark: #6b4a0c; --header-bg: rgba(19, 25, 37, .8);
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
        --shadow-lg: 0 18px 40px -10px rgba(0, 0, 0, .6); --ring: 0 0 0 3px rgba(139, 149, 255, .3);
    }
}
:root[data-theme="dark"] {
    --bg: #0c1018; --surface: #131925; --surface-2: #1a2130; --surface-3: #222b3c;
    --text: #e7eaf0; --text-2: #c3cad6; --muted: #929cae; --border: #252e3e; --border-strong: #34405a;
    --primary: #8b95ff; --primary-hover: #aab2ff; --primary-soft: #1c2142; --primary-contrast: #0c1018; --accent: #b794ff;
    --danger: #ff7b7b; --danger-soft: #3a1b20; --ok: #5ad48d; --ok-soft: #13301f; --warn: #f5b84a; --warn-soft: #36290f;
    --star: #f5b84a; --mark: #6b4a0c; --header-bg: rgba(19, 25, 37, .8);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-lg: 0 18px 40px -10px rgba(0, 0, 0, .6); --ring: 0 0 0 3px rgba(139, 149, 255, .3);
}

/* ---------- Základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--font);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.022em; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.55rem, 2.6vw, 2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: .05em .35em; }
svg { flex: none; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-contrast); padding: .55rem 1rem; border-radius: var(--radius-sm); z-index: 100; font-weight: 600; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.lead { font-size: 1.06rem; color: var(--text-2); }
[hidden] { display: none !important; }

/* ---------- Rozvržení ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1600px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 64px; }
.layout-two { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 36px; align-items: start; }

/* ---------- Hlavička ---------- */
.site-header {
    position: sticky; top: 0; z-index: 30; background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; color: var(--primary); filter: drop-shadow(0 2px 4px rgba(67, 56, 202, .25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -.015em; }
.brand-domain { font-size: .72rem; color: var(--muted); letter-spacing: .01em; }
.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; font-size: .93rem; transition: background .15s, color .15s; }
.main-nav a svg { opacity: .8; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.main-nav a[aria-current] { background: var(--primary-soft); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .88rem; font-weight: 500; padding-right: 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: .8rem; text-transform: uppercase; }
.icon-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: block; }
    :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* Lišta administrace */
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-bar-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-bar a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 13px 12px; color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.admin-bar a svg { opacity: .75; }
.admin-bar a:hover { color: var(--text); text-decoration: none; }
.admin-bar a[aria-current] { color: var(--primary); }
.admin-bar a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }

/* ---------- Patička ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-brand svg { width: 20px; height: 20px; color: var(--primary); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Tlačítka ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px;
    border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem;
    line-height: 1.25; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); box-shadow: 0 1px 2px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* ---------- Karty a obecné bloky ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card > h2:first-child { font-size: 1.05rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.count-lg { display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); letter-spacing: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 56px 24px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); margin-top: 16px; background: var(--surface); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.empty p:last-of-type { margin-bottom: 16px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 .12em; }

/* Hero */
.hero {
    position: relative; overflow: hidden; padding: 36px 40px; margin-bottom: 32px; border-radius: var(--radius-lg); color: #fff;
    background:
        radial-gradient(60% 90% at 100% 0%, rgba(139, 92, 246, .55) 0%, rgba(139, 92, 246, 0) 70%),
        radial-gradient(50% 80% at 0% 100%, rgba(59, 130, 246, .35) 0%, rgba(59, 130, 246, 0) 70%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #3730a3 100%);
    box-shadow: var(--shadow-lg);
}
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 70%); mask-image: linear-gradient(to left, #000 0%, transparent 70%);
}
.hero > * { position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #c7d2fe; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.hero h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.03em; margin-bottom: .35em; max-width: 26ch; }
.hero p { color: #d4dafc; font-size: 1.06rem; max-width: 40rem; margin: 0; }
.hero .search { margin: 22px 0 0; max-width: 620px; }
.hero .search-field { border-color: transparent; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45); }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; color: #c7d2fe; font-size: .9rem; }
.hero-stats strong { color: #fff; font-size: 1.1rem; margin-right: 4px; }

/* Vyhledávání */
.search { display: flex; gap: 8px; max-width: 720px; margin: 0 0 28px; }
.search-field { position: relative; flex: 1; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.search-field:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.search-field > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-field input { border: 0; background: transparent; padding: 12px 14px 12px 42px; box-shadow: none; border-radius: var(--radius); }
.search-field input:focus { outline: none; box-shadow: none; }
.search-field .btn { margin: 5px; }

/* ---------- Postranní panel ---------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.sidebar-search { margin-bottom: 26px; }
.sidebar-search .sidebar-title { display: block; margin-bottom: 8px; }
.sidebar-search-row { display: flex; gap: 6px; }
.sidebar-search-row input { padding: 8px 11px; font-size: .92rem; }
.sidebar-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 8px; }
.sidebar-cats > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 2px 0; margin-bottom: 6px; }
.sidebar-cats > summary::-webkit-details-marker { display: none; }
.sidebar-cats > summary .sidebar-title { margin: 0; }
.sidebar-cats > summary svg { color: var(--muted); transition: transform .2s; }
.sidebar-cats[open] > summary svg { transform: rotate(180deg); }
.category-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.category-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: .93rem; transition: background .12s, color .12s; }
.category-list a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.category-list a[aria-current] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.category-list a[aria-current] .count { background: var(--surface); color: var(--primary); }
.count { flex: none; min-width: 26px; text-align: center; color: var(--muted); font-size: .75rem; font-weight: 600; background: var(--surface-3); padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.category-top { margin-top: 2px; }
.category-top > a { font-weight: 600; color: var(--text); }
.category-sub { list-style: none; margin: 1px 0 6px 14px; padding: 0 0 0 8px; border-left: 1px solid var(--border-strong); display: grid; gap: 1px; }
.category-sub a { padding: 5px 10px; font-size: .89rem; }
.category-list .category-sub a[aria-current] { font-weight: 600; }
.crumb-parent { color: var(--muted); }
.crumb-sep { color: var(--muted); font-weight: 400; }
.subcategories { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.subcategories .chip { font-size: .85rem; padding: 5px 8px 5px 12px; gap: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.subcategories .chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Karty tutoriálů ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 18px; }
.tutorial-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 16px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tutorial-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.tutorial-card:focus-within { border-color: var(--primary); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 22px; }
.card-stars { flex: none; color: var(--star); font-size: .9rem; letter-spacing: 1px; line-height: 1.4; }
.tutorial-card .chips { position: relative; z-index: 2; }
.tutorial-card h3 { margin: 2px 0 0; font-size: 1.07rem; line-height: 1.35; letter-spacing: -.015em; }
.tutorial-card h3 a { color: var(--text); }
.tutorial-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tutorial-card h3 a:hover { text-decoration: none; }
.tutorial-card:hover h3 a { color: var(--primary); }
.tutorial-card h3 a:focus-visible { outline: none; }
.tutorial-card p { margin: 0; font-size: .92rem; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.tutorial-card .excerpt { font-size: .84rem; border-left: 2px solid var(--primary); border-block: 7px solid transparent; background: var(--surface-2); padding: 0 10px; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; -webkit-line-clamp: 4; line-clamp: 4; }
.tutorial-card .card-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.card-code { display: block !important; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .76rem; background: var(--surface-2); padding: 0 6px; border-radius: 4px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--muted); font-size: .82rem; }
.card-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.card-meta svg { width: 14px; height: 14px; opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 1.6; transition: background .12s, color .12s, border-color .12s; }
.chip:hover { text-decoration: none; background: var(--primary); color: var(--primary-contrast); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 1.6; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.category-list .badge { font-size: .65rem; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.category-list .badge::before { display: none; }

/* ---------- Formuláře ---------- */
input, select, textarea {
    width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
select { appearance: none; padding-right: 34px; cursor: pointer; background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23748094' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
textarea.code { font-family: var(--mono); font-size: .84rem; line-height: 1.55; resize: vertical; tab-size: 4; background: var(--surface-2); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--primary); cursor: pointer; }
input[type="file"] { padding: 7px; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-size: .85rem; font-weight: 600; margin-right: 12px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; }
.form { padding: 28px; }
.form-section { border-top: 1px solid var(--border); margin: 8px -28px 0; padding: 22px 28px 0; }
.form-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 20px; }
.field { margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: .88rem; padding: 0; color: var(--text); }
.hint { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }
.error-text { color: var(--danger); font-size: .84rem; font-weight: 500; margin: 6px 0 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.has-error input:focus, .has-error textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-weight: 500 !important; font-size: .88rem !important; background: var(--surface); border: 1px solid var(--border-strong); padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: border-color .12s, background .12s; }
.check:hover { border-color: var(--primary); }
.check:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.check-sub { margin-left: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-actions-sticky { position: sticky; bottom: 0; z-index: 5; margin: 8px -28px -28px; padding: 16px 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.narrow-form { max-width: 520px; }
.inline-fields { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.inline-fields .field { margin-bottom: 0; }
.grow { flex: 1 1 180px; } .grow-2 { flex: 2 1 260px; } .narrow { width: 100px; }
.input-narrow { width: 90px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.filters input { max-width: 280px; flex: 1 1 180px; padding: 7px 11px; }
.filters select { width: auto; padding-top: 7px; padding-bottom: 7px; }
.filters + .table-wrap { margin-top: 0; }

/* Přihlášení a registrace */
.auth-card { max-width: 420px; margin: 40px auto; padding: 32px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .3em; }
.auth-logo { width: 44px; height: 44px; color: var(--primary); margin-bottom: 16px; }
.auth-card .btn-block { margin-top: 4px; padding: 11px 16px; }

/* ---------- Hlášky ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid transparent; font-size: .93rem; font-weight: 500; transition: opacity .4s, transform .4s; }
.alert::before { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--surface); margin-top: 1px; }
.alert.is-hidden { opacity: 0; transform: translateY(-4px); }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-success::before { content: "✓"; background: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-error::before { content: "!"; background: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.alert-info::before { content: "i"; background: var(--primary); }

/* ---------- Administrace ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: .85; }
.stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .muted { font-size: .85rem; font-weight: 500; }
.stat-wide { grid-column: span 2; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); font-size: .93rem; }
.plain-list li > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.plain-list li > a:hover { color: var(--primary); }
.plain-list li:first-child { border-top: 0; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin-top: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.table td a strong { color: var(--text); font-weight: 600; }
.table td a:hover strong { color: var(--primary); }
.table td input, .table td select { padding: 6px 10px; font-size: .9rem; }
.table td select { padding-right: 30px; }
th.col-code { white-space: nowrap; }
td.col-code { width: 1%; min-width: 150px; max-width: 220px; }
td.col-code code { overflow-wrap: anywhere; }
.table td[data-label="Název"] { min-width: 240px; }
.table td[data-label="Upraveno"], .table td[data-label="Zobrazení"], .table td[data-label="Čas"] { white-space: nowrap; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover, .sort-link.is-active { color: var(--primary); text-decoration: none; }
.col-actions { white-space: nowrap; text-align: right !important; }
.col-actions .btn { margin-left: 4px; }
.cell-sub { padding-left: 36px !important; position: relative; }
.cell-sub::before { content: "↳"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.row-sub td:first-child input { border-style: dashed; }
.preview { margin-top: 32px; }

/* ---------- Detail tutoriálu ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; margin-bottom: 16px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { opacity: .6; }
.tutorial-head { margin-bottom: 20px; padding: 28px; }
.tutorial-head h1 { margin: 14px 0 10px; }
.tutorial-head .lead { margin-bottom: 14px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.actions .btn-primary { margin-left: auto; }
.tutorial-frame { display: block; width: 100%; height: 82vh; min-height: 440px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); resize: vertical; overflow: auto; }

/* Textové stránky */
.prose { max-width: 820px; padding: 32px 36px; color: var(--text-2); }
.prose h2 { margin-top: 1.6em; font-size: 1.15rem; color: var(--text); }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }

/* ---------- Stránkování ---------- */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 32px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .9rem; font-weight: 500; }
.pagination span { border: 0; background: none; color: var(--muted); }
.pagination a:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.pagination a.is-current { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); font-weight: 700; }

/* ---------- Chybová stránka ---------- */
.error-page { text-align: center; padding: 72px 0; max-width: 520px; margin: 0 auto; }
.error-code { font-size: 6rem; font-weight: 800; margin: 0 0 8px; line-height: 1; letter-spacing: -.05em;
    background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .muted { margin-bottom: 24px; }

/* ---------- Responzivita ---------- */
@media (max-width: 960px) {
    .layout-two { grid-template-columns: 1fr; gap: 20px; }
    .sidebar { position: static; max-height: none; overflow: visible; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .sidebar-search { margin-bottom: 14px; }
    .sidebar-cats[open] > summary { margin-bottom: 10px; }
    .category-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .category-list a { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 6px 4px 12px; }
    .category-list .category-top { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin: 0; }
    .category-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
    .stat-wide { grid-column: auto; }
}
@media (max-width: 760px) {
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    .main { padding-top: 20px; }
    .header-inner { gap: 10px; }
    .brand-text, .user-chip span:not(.avatar) { display: none; }
    .main-nav a { padding: 7px 10px; }
    .main-nav a svg { display: none; }
    .hero { padding: 28px 22px; border-radius: var(--radius); }
    .hero-stats { gap: 16px; }
    .card, .tutorial-head, .form, .prose { padding: 20px; }
    .form-section { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
    .form-actions-sticky { margin: 8px -20px -20px; padding: 14px 20px; }
    .actions .btn-primary { margin-left: 0; }
    .cell-sub { padding-left: 16px !important; }
    .cell-sub::before { display: none; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; }
    .table tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
    .table td { border: 0; padding: 5px 16px; }
    .table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
    .table td[data-label] { min-width: 0; white-space: normal; }
    .col-actions { text-align: left !important; }
    .col-actions .btn { margin: 4px 4px 0 0; }
    .filters input, .filters select { max-width: none; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
    .site-header, .site-footer, .admin-bar, .actions, .sidebar, .search, .hero { display: none !important; }
    .layout-two { display: block; }
    .card { box-shadow: none; }
}
