/* =====================================================================
   SZIF Vzdělávání — design system
   Vychází z vizuální identity SZIF (HMS design, 2023):
   - hlavní zelená Pantone 7482 C, tmavá „lesní“ zelená, programové barvy
   - diagonála z písmene Z jako hlavní grafický prvek
   - písmo Brutal Type → web náhrada Barlow (nadpisy) + Inter (text)
   UX vrstva: glassmorphism (průsvitné panely s rozostřením nad barevným pozadím)
   ===================================================================== */

/* ---------- fonty (self-hosted, bez CDN kvůli GDPR) ---------- */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-ext-600.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-ext-700.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Barlow"; font-weight: 800; font-display: swap; src: url("fonts/barlow-latin-ext-800.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 800; font-display: swap; src: url("fonts/barlow-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-ext-var.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-cyrillic-var.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-var.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }

/* ---------- tokeny ---------- */
:root {
    --szif-green: #00873F;
    --szif-green-600: #00743A;
    --szif-green-400: #2FA866;
    --szif-green-100: #DDF1E5;
    --szif-forest: #034A31;
    --szif-orange: #E48D06;
    --szif-sky: #71C5E8;
    --szif-red: #D9402B;
    --szif-plum: #8E2A6B;
    --szif-blue: #2B7FB8;

    --font-head: "Brutal Type", "Barlow", "Inter", "Segoe UI", system-ui, sans-serif;
    --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

    --bg: #EAF3EE;
    --bg-glow-1: rgba(0, 135, 63, .28);
    --bg-glow-2: rgba(113, 197, 232, .35);
    --bg-glow-3: rgba(228, 141, 6, .16);
    --ink: #10231A;
    --ink-2: #3D5246;
    --ink-3: #6B7F73;
    --line: rgba(3, 74, 49, .10);
    --line-strong: rgba(3, 74, 49, .18);

    --glass: rgba(255, 255, 255, .58);
    --glass-strong: rgba(255, 255, 255, .78);
    --glass-soft: rgba(255, 255, 255, .38);
    --glass-border: rgba(255, 255, 255, .72);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 50px -18px rgba(3, 74, 49, .28), 0 2px 8px rgba(3, 74, 49, .06);
    --blur: blur(22px) saturate(170%);

    --ok: #00873F;   --ok-bg: rgba(0, 135, 63, .12);
    --warn: #B86E00; --warn-bg: rgba(228, 141, 6, .16);
    --bad: #C2341F;  --bad-bg: rgba(217, 64, 43, .13);
    --info: #1F6E9E; --info-bg: rgba(113, 197, 232, .22);
    /* matice školení — sytější odstíny, aby se stavy daly rozlišit i na slabším monitoru */
    --m-valid: #0B6B34;   --m-valid-bg: #C6E8D3;
    --m-expiring: #7A4A00; --m-expiring-bg: #FFD98A;
    --m-progress: #0E5580; --m-progress-bg: #B9DFF5;
    --m-assigned: #4A3B7A; --m-assigned-bg: #E2DBF5;
    --m-bad: #A52A17;     --m-bad-bg: #F7C4BA;
    --m-missing-bg: #FFF4F1;
    --m-expired-bg: #EC9F90;
    --neutral: #55695D; --neutral-bg: rgba(3, 74, 49, .07);

    --radius: 22px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --sidebar-w: 268px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    /* tmavý režim: neutrální grafit (ne černá, bez zeleného nádechu); zelená zůstává jen jako akcent */
    --bg: #1A1B1E;
    --bg-glow-1: rgba(0, 135, 63, .10);
    --bg-glow-2: rgba(120, 130, 145, .10);
    --bg-glow-3: rgba(255, 255, 255, .03);
    --ink: #ECEDEF;
    --ink-2: #BCC0C6;
    --ink-3: #8D939B;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .15);
    --glass: rgba(40, 42, 46, .78);
    --glass-strong: rgba(48, 50, 55, .94);
    --glass-soft: rgba(40, 42, 46, .5);
    --glass-border: rgba(255, 255, 255, .08);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 20px 50px -20px rgba(0, 0, 0, .55);
    --ok: #5CC98C;   --ok-bg: rgba(92, 201, 140, .14);
    --warn: #F0B55A; --warn-bg: rgba(240, 181, 90, .15);
    --bad: #FF8A75;  --bad-bg: rgba(255, 138, 117, .14);
    --info: #8CC8E8; --info-bg: rgba(140, 200, 232, .14);
    --m-valid: #8FE0B2;   --m-valid-bg: rgba(92, 201, 140, .30);
    --m-expiring: #FFD38A; --m-expiring-bg: rgba(240, 181, 90, .36);
    --m-progress: #A9DAF5; --m-progress-bg: rgba(110, 180, 230, .32);
    --m-assigned: #D2C6F7; --m-assigned-bg: rgba(170, 150, 235, .26);
    --m-bad: #FFA493;     --m-bad-bg: rgba(255, 120, 100, .26);
    --m-missing-bg: rgba(255, 120, 100, .07);
    --m-expired-bg: rgba(255, 100, 80, .45);
    --neutral: #AEB3BA; --neutral-bg: rgba(255, 255, 255, .06);
    --szif-green-100: rgba(92, 201, 140, .14);
    color-scheme: dark;
}

/* ---------- základ ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
a { color: var(--szif-green); text-decoration: none; }
a:hover { text-decoration: underline; }
:root[data-theme="dark"] a { color: #6FCF9B; }
p { margin: 0 0 .8em; }
kbd { font: 600 12px var(--font-body); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--glass-soft); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--szif-green) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- pozadí: světelné skvrny + diagonály Z ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before, .backdrop::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(80px);
}
.backdrop::before { width: 62vw; height: 62vw; left: -18vw; top: -22vw; background: radial-gradient(circle, var(--bg-glow-1), transparent 65%); }
.backdrop::after { width: 55vw; height: 55vw; right: -14vw; bottom: -20vw; background: radial-gradient(circle, var(--bg-glow-2), transparent 65%); }
.backdrop .glow3 { position: absolute; width: 36vw; height: 36vw; right: 22vw; top: -10vw; border-radius: 50%; filter: blur(90px); background: radial-gradient(circle, var(--bg-glow-3), transparent 65%); }
.backdrop svg { position: absolute; right: -6vw; top: 0; height: 100vh; width: auto; opacity: .55; }
:root[data-theme="dark"] .backdrop svg { opacity: .12; }

/* ---------- glass ---------- */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
}
.glass-strong { background: var(--glass-strong); }
.card { padding: 22px 24px; }
.card-tight { padding: 16px 18px; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

/* ---------- layout aplikace ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
    border-radius: 0 var(--radius) var(--radius) 0; border-left: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand img { height: 40px; width: auto; }
.brand .product { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink-3); border-left: 1px solid var(--line-strong); padding-left: 10px; line-height: 1.2; }
:root[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
.nav-label { font: 700 11px var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 16px 12px 6px; }
.nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2);
    font-weight: 550; text-decoration: none; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--glass-soft); color: var(--ink); }
.nav a.active {
    color: #fff; background: linear-gradient(135deg, var(--szif-green) 0%, var(--szif-green-600) 100%);
    box-shadow: 0 8px 22px -8px rgba(0, 135, 63, .7);
}
.nav a.active::after {
    content: ""; position: absolute; right: 10px; top: 8px; bottom: 8px; width: 14px;
    background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.45) 43%, rgba(255,255,255,.45) 58%, transparent 59%);
}
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--bad-bg); color: var(--bad); }
.nav a.active .count { background: rgba(255,255,255,.22); color: #fff; margin-right: 22px; } /* místo pro šikmý proužek aktivní položky */
.sidebar .spacer { flex: 0; }
/* menu se při velkém počtu položek posouvá samo, panel nepřetéká */
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 -6px; padding: 0 6px; }
.nav-group-head {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent;
    color: var(--ink-2); font: inherit; font-weight: 550; text-align: left; cursor: pointer; transition: background .15s, color .15s;
}
.nav-group-head:hover { background: var(--glass-soft); color: var(--ink); }
.nav-group-head .count { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--info-bg); color: var(--info); }
.nav-group-head .chev { margin-left: auto; display: grid; color: var(--ink-3); transition: transform .2s; }
.nav-group-head .count + .chev { margin-left: 6px; }
.nav-group.open .nav-group-head .chev { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-head { color: var(--szif-green); }
:root[data-theme="dark"] .nav-group.has-active > .nav-group-head { color: #6FCF9B; }
.nav-group-items { display: grid; gap: 2px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 2px solid var(--line); }
.nav-group-items a { padding: 8px 12px; font-size: 14px; }
.sidebar .m365 { margin: 8px 4px 0; padding: 12px 14px; border-radius: 16px; font-size: 12.5px; color: var(--ink-2); background: var(--glass-soft); border: 1px solid var(--glass-border); }
.sidebar .m365 b { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); display: inline-block; }
.dot.off { background: var(--ink-3); box-shadow: 0 0 0 4px var(--neutral-bg); }

.main { min-width: 0; padding: 18px 28px 48px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 20px; margin-bottom: 26px; position: sticky; top: 12px; z-index: 20; }
.topbar .crumbs { font-family: var(--font-head); font-weight: 600; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.topbar .crumbs b { color: var(--ink); }
.topbar .grow { flex: 1; }
.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--glass-border);
    background: var(--glass-soft); color: var(--ink-2); cursor: pointer; transition: transform .1s, background .15s;
}
.icon-btn:hover { background: var(--glass-strong); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 14px; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 14px; }
.user-chip .who span { font-size: 12px; color: var(--ink-3); }
.avatar {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font: 700 14px var(--font-head); color: #fff;
    background: linear-gradient(135deg, var(--szif-green), var(--szif-forest)); flex: none;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.menu-toggle { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin: 0; max-width: 70ch; }
.eyebrow { font: 700 12px var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--szif-green); margin-bottom: 6px; display: inline-flex; gap: 8px; align-items: center; }
:root[data-theme="dark"] .eyebrow { color: #6FCF9B; }
.eyebrow::before { content: ""; width: 18px; height: 3px; background: currentColor; transform: skewX(-35deg); border-radius: 2px; }

/* ---------- mřížky ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.g-courses { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.mt-lg { margin-top: 30px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- hero ---------- */
.hero {
    position: relative; overflow: hidden; padding: 30px 32px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
    background: linear-gradient(120deg, rgba(0,135,63,.92) 0%, rgba(3,74,49,.92) 100%);
    color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.86); max-width: 52ch; }
.hero .eyebrow { color: #B9F0CF; }
.hero::before, .hero::after {
    content: ""; position: absolute; top: -20%; bottom: -20%; width: 120px; background: rgba(255,255,255,.08); transform: skewX(-34deg);
}
.hero::before { right: 26%; }
.hero::after { right: 12%; width: 50px; background: rgba(255,255,255,.12); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; z-index: 1; }
.hero-stat { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); }
.hero-stat b { font: 800 30px var(--font-head); display: block; line-height: 1; }
.hero-stat span { font-size: 12.5px; color: rgba(255,255,255,.82); }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .val { font: 800 30px var(--font-head); line-height: 1; letter-spacing: -.02em; }
.kpi .lbl { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.kpi .trend { font-size: 12px; font-weight: 600; margin-top: 6px; }
.tone-ok .ico { background: var(--ok-bg); color: var(--ok); }
.tone-warn .ico { background: var(--warn-bg); color: var(--warn); }
.tone-bad .ico { background: var(--bad-bg); color: var(--bad); }
.tone-info .ico { background: var(--info-bg); color: var(--info); }
.tone-neutral .ico { background: var(--neutral-bg); color: var(--neutral); }

/* ---------- tlačítka ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px;
    font: 600 14px var(--font-body); border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap;
    transition: transform .1s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff !important; background: linear-gradient(135deg, var(--szif-green-400), var(--szif-green) 45%, var(--szif-green-600)); box-shadow: 0 10px 24px -10px rgba(0,135,63,.8), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 30px -10px rgba(0,135,63,.9), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-ghost { color: var(--ink) !important; background: var(--glass-soft); border-color: var(--glass-border); }
.btn-ghost:hover { background: var(--glass-strong); }
.btn-light { color: var(--szif-forest) !important; background: #fff; }
.btn-danger { color: #fff !important; background: linear-gradient(135deg, #E25A44, var(--szif-red)); }
.btn-link { background: none; border: 0; color: var(--szif-green); padding: 0 4px; height: auto; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }

/* ---------- štítky stavů ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.neutral { color: var(--neutral); background: var(--neutral-bg); }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 8px; font: 700 11.5px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: #fff; }

/* ---------- karty kurzů ---------- */
.course-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow), 0 26px 50px -24px rgba(3,74,49,.45); }
.course-cover {
    --c: var(--szif-green); height: 118px; position: relative; overflow: hidden; padding: 16px 18px; color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--c) 92%, white), color-mix(in srgb, var(--c) 78%, black));
}
.course-cover::before, .course-cover::after { content: ""; position: absolute; top: -30%; bottom: -30%; background: rgba(255,255,255,.14); transform: skewX(-34deg); }
.course-cover::before { right: 18%; width: 70px; }
.course-cover::after { right: 4%; width: 26px; background: rgba(255,255,255,.22); }
.course-cover .cat { font: 800 13px var(--font-head); letter-spacing: .14em; opacity: .95; }
.course-cover .ico { position: absolute; right: 18px; bottom: 14px; opacity: .9; }
.course-cover .ring-wrap { position: absolute; left: 18px; bottom: -26px; }
.course-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { margin: 0; font-size: 18px; }
.course-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.course-meta span { display: inline-flex; gap: 5px; align-items: center; }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }

.progress { height: 8px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--szif-green-400), var(--szif-green)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.progress.warn > i { background: linear-gradient(90deg, #F3B04A, var(--szif-orange)); }
.progress.bad > i { background: linear-gradient(90deg, #EE7A66, var(--szif-red)); }

.ring { display: block; }
.ring .track { stroke: var(--neutral-bg); }
.ring .bar { stroke: var(--szif-green); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring text { font: 800 15px var(--font-head); fill: var(--ink); }

/* ---------- seznamy ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- tabulky ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.data th {
    text-align: left; font: 700 11.5px var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
    padding: 10px 12px; border-bottom: 1px solid var(--line-strong); position: sticky; top: 0; background: var(--glass-strong); backdrop-filter: blur(10px); z-index: 1;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--glass-soft); }
table.data tbody tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }
.person span { font-size: 12px; color: var(--ink-3); }

/* ---------- formuláře ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.input, select.input, textarea.input {
    width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; font: 500 14px var(--font-body); color: var(--ink);
    background: var(--glass-strong); border: 1px solid var(--line-strong); transition: border .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
textarea.code { font-family: Consolas, "Cascadia Code", monospace; font-size: 13px; }
.input:focus { outline: none; border-color: var(--szif-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--szif-green) 18%, transparent); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.input-icon .input { padding-left: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--szif-green); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--szif-green); }
.switch input:checked + i::after { transform: translateX(18px); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { height: 40px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--glass-border); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font: 600 13.5px var(--font-body); color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.tabs button.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 4px 14px -6px rgba(3,74,49,.35); }

/* ---------- modal / drawer ---------- */
/* dialogy jsou nad režimem tabletu (.kiosk 110) i nad editorem otázek (.fs-overlay 120) */
.overlay { position: fixed; inset: 0; background: rgba(4, 22, 14, .38); backdrop-filter: blur(6px); z-index: 130; display: flex; justify-content: flex-end; animation: fade .18s ease; }
.overlay.center { justify-content: center; align-items: center; padding: 20px; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px; animation: pop .22s cubic-bezier(.2,.8,.2,1); background: var(--glass-strong); }
.modal.wide { width: min(1080px, 100%); }
/* patička modálního okna zůstává při posouvání dlouhého obsahu vidět */
.modal > .drawer-foot { position: sticky; bottom: -26px; margin: 22px -26px -26px; padding: 14px 26px 18px; background: var(--glass-strong); backdrop-filter: blur(18px); border-radius: 0 0 var(--radius) var(--radius); z-index: 2; }
/* detail záznamu: formulář vlevo, související seznam vpravo */
.modal-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.modal-split > section > h3:first-child { margin-top: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; min-width: 300px; max-width: 420px; animation: pop .25s; background: var(--glass-strong); }
.toast.ok svg { color: var(--ok); } .toast.bad svg { color: var(--bad); } .toast.info svg { color: var(--info); }

/* ---------- přehrávač kurzu ---------- */
.player { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.player-nav { position: sticky; top: 96px; padding: 18px; }
.lesson-link {
    display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 10px; border-radius: 12px; border: 0; background: none;
    text-align: left; cursor: pointer; color: var(--ink-2); font: 500 14px var(--font-body);
}
.lesson-link:hover { background: var(--glass-soft); }
.lesson-link.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 6px 18px -10px rgba(3,74,49,.4); }
.lesson-link .n {
    width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 700 13px var(--font-head);
    background: var(--neutral-bg); color: var(--ink-3);
}
.lesson-link.done .n { background: var(--szif-green); color: #fff; }
.lesson-link.locked { opacity: .5; cursor: not-allowed; }
.lesson-link small { display: block; font-size: 12px; color: var(--ink-3); }
.lesson { padding: 32px 38px; min-height: 60vh; }
.lesson .lead { font-size: 17px; color: var(--ink-2); }
.lesson ul, .lesson ol { padding-left: 22px; }
.lesson li { margin: 6px 0; }
.lesson h3 { margin-top: 22px; }
.callout { margin: 18px 0; padding: 14px 18px; border-radius: 14px; background: var(--ok-bg); border-left: 4px solid var(--szif-green); }
.callout.warn { background: var(--warn-bg); border-left-color: var(--szif-orange); }
.callout.bad { background: var(--bad-bg); border-left-color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.tiles > div { padding: 14px 16px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--glass-border); }
.tiles b { display: block; font-family: var(--font-head); font-size: 16px; color: var(--szif-green); }
:root[data-theme="dark"] .tiles b { color: #6FCF9B; }
.tiles span { font-size: 13px; color: var(--ink-2); }
.steps { display: grid; gap: 10px; margin: 16px 0; }
.steps > div { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--glass-border); }
.steps b { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; font: 800 15px var(--font-head); background: var(--szif-green); }
table.tbl { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
table.tbl th, table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { font-family: var(--font-head); color: var(--ink-3); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.video-frame, .pdf-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0B1F16; border: 1px solid var(--glass-border); }
.pdf-frame { aspect-ratio: 16 / 10; }
.pdf-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder {
    display: grid; place-items: center; text-align: center; color: #D9F2E3; height: 100%; position: relative; overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(0,135,63,.6), transparent 60%), linear-gradient(135deg, #06301F, #0B1F16);
}
.video-placeholder::before { content: ""; position: absolute; right: 18%; top: -20%; bottom: -20%; width: 90px; background: rgba(255,255,255,.06); transform: skewX(-34deg); }
.play { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); margin: 0 auto 14px; backdrop-filter: blur(6px); }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }

.question { padding: 20px 22px; border-radius: 18px; background: var(--glass-soft); border: 1px solid var(--glass-border); margin-bottom: 14px; }
.question .q { font-weight: 650; font-size: 16px; margin-bottom: 12px; display: flex; gap: 12px; }
.question .q .n { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--szif-green); color: #fff; font: 800 13px var(--font-head); }
.answer { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--glass-strong); cursor: pointer; margin: 8px 0 0 40px; transition: border .12s, background .12s; }
.answer:hover { border-color: var(--szif-green); }
.answer.sel { border-color: var(--szif-green); background: var(--ok-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--szif-green) 18%, transparent); }
.answer input { accent-color: var(--szif-green); width: 18px; height: 18px; }
.result-hero { text-align: center; padding: 40px 30px; }
.result-hero .big { font: 800 64px var(--font-head); line-height: 1; }

/* ---------- certifikát (náhled) ---------- */
.cert-card { display: flex; gap: 16px; align-items: center; padding: 16px 18px; }
.cert-badge { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(135deg, var(--szif-green-400), var(--szif-forest)); box-shadow: 0 10px 20px -10px rgba(0,135,63,.8); position: relative; overflow: hidden; }
.cert-badge::after { content: ""; position: absolute; right: 8px; top: -10px; bottom: -10px; width: 10px; background: rgba(255,255,255,.25); transform: skewX(-34deg); }
.preview-frame { width: 100%; aspect-ratio: 297 / 210; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 10px 40px -14px rgba(0,0,0,.35); }

/* ---------- grafy ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--szif-green-400), var(--szif-green)); min-height: 3px; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.bars .bar span { font-size: 11px; color: var(--ink-3); }
.bars .bar b { font-size: 11px; color: var(--ink-2); }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-bottom: 12px; }
.hbar .name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .pct { font: 700 13.5px var(--font-head); font-variant-numeric: tabular-nums; }
.hbar .progress { grid-column: 1 / -1; }
.stacked { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--neutral-bg); }
.stacked i { display: block; height: 100%; }
/* verze a datum sestavení (Systém a integrace) */
.build-info { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 36px; padding: 18px 22px; }
.build-info > div:not(.kpi) { display: flex; flex-direction: column; min-width: 120px; }
.build-info span { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.build-info b { font-family: var(--font-head); font-size: 20px; color: var(--ink); }
.build-info small { font-size: 12px; color: var(--ink-3); }
/* Notifikace: seznam šablon | editor | náhled — na užší obrazovce se sloupce zalamují pod sebe */
.notif-grid { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .notif-grid { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); } .notif-grid > :nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 760px) { .notif-grid { grid-template-columns: minmax(0, 1fr); } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- prázdné stavy ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; background: var(--ok-bg); color: var(--szif-green); }

/* ---------- přihlášení / veřejné stránky ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(980px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; }
.login-side { position: relative; padding: 40px; color: #fff; overflow: hidden; background: linear-gradient(135deg, var(--szif-green), var(--szif-forest)); }
.login-side::before, .login-side::after { content: ""; position: absolute; top: -30%; bottom: -30%; transform: skewX(-34deg); background: rgba(255,255,255,.1); }
.login-side::before { right: 20%; width: 120px; }
.login-side::after { right: 4%; width: 46px; background: rgba(255,255,255,.16); }
.login-side img { height: 54px; filter: brightness(0) invert(1); }
.login-side h1 { color: #fff; margin-top: 60px; font-size: 38px; position: relative; }
.login-side p { color: rgba(255,255,255,.85); position: relative; }
.login-form { padding: 40px; }
.persona { display: flex; gap: 14px; align-items: center; width: 100%; padding: 14px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass-soft); cursor: pointer; text-align: left; margin-bottom: 10px; font: inherit; color: inherit; transition: background .15s, transform .1s; }
.persona:hover { background: var(--glass-strong); transform: translateX(3px); }
.persona b { display: block; }
.login-password { display: grid; gap: 14px; margin: 6px 0 4px; }
.login-password .field { display: grid; gap: 6px; }
.login-password .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.w-full { width: 100%; justify-content: center; }
.doc-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--info-bg); color: var(--info); text-decoration: none; }
.doc-chip:hover { text-decoration: underline; }
.upload-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--glass-soft); color: var(--ink-2); cursor: pointer; font-size: 14px; }
.upload-box:hover { border-color: var(--szif-green); color: var(--ink); }
.persona span { font-size: 12.5px; color: var(--ink-3); }

#blazor-error-ui { display: none; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 12px 18px; border-radius: 14px; background: var(--szif-red); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#blazor-error-ui a { color: #fff; font-weight: 700; margin-left: 10px; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 12px; }

/* ---------- responzivita ---------- */
@media (max-width: 1180px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-main { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
    .app { grid-template-columns: 1fr; }
    .modal-split { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 90; width: 280px; left: 0; transform: translateX(-105%); transition: transform .25s; }
    .app.nav-open .sidebar { transform: none; }
    .menu-toggle { display: grid; }
    .main { padding: 12px 14px 40px; }
    .player { grid-template-columns: 1fr; }
    .player-nav { position: static; }
    .lesson { padding: 22px 20px; }
    .g-2, .g-3 { grid-template-columns: 1fr; }
    .login { grid-template-columns: 1fr; }
    .user-chip .who { display: none; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .g-4 { grid-template-columns: 1fr; }
    .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
    .hero { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
    .sidebar, .topbar, .backdrop { display: none !important; }
    .app { display: block; }
    .glass { background: #fff; box-shadow: none; border-color: #ddd; backdrop-filter: none; }
}

/* ---------- prohlížeč prezentací ---------- */
.slides { border-radius: 18px; overflow: hidden; border: 1px solid var(--glass-border); background: var(--glass-soft); }
.slides-stage { position: relative; min-height: 240px; background: #fff; display: block; line-height: 0; }
.slides-stage canvas { display: block; width: 100%; }
.slides-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #5B6B62; line-height: 1.4; font-size: 14px; }
.slides-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.slides-dots { flex: 1; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.slides-dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; transition: width .2s, background .2s; }
.slides-dots button.on { width: 26px; background: var(--szif-green); }

/* ---------- mobilní doladění ---------- */
.hero > *, .grid > *, .player > * { min-width: 0; }
@media (max-width: 920px) {
    .topbar { padding: 8px; gap: 8px; margin-bottom: 16px; }
    .topbar .crumbs > span, .topbar .crumbs > svg { display: none; }
    .hero .btn { white-space: normal; height: auto; min-height: 48px; padding: 10px 16px; text-align: left; }
    .page-head .row { width: 100%; }
}
@media (max-width: 560px) {
    .hero-stats { gap: 8px; }
    .hero-stat { padding: 10px 12px; }
    .hero-stat b { font-size: 24px; }
    .hero-stat span { font-size: 11.5px; }
    .lesson-actions { flex-wrap: wrap; }
    .lesson-actions .btn-lg { width: 100%; }
    .answer { margin-left: 0; }
    .toasts { left: 12px; right: 12px; }
    .toast { min-width: 0; }
}

/* =====================================================================
   Formátovaný obsah (lekce, otázky) — média
   ===================================================================== */
.lesson-content figure.media { margin: 16px 0; }
.lesson-content figure.media img, .lesson-content img { max-width: 100%; height: auto; border-radius: 14px; display: block; }
.lesson-content figure.media video { width: 100%; max-height: 70vh; border-radius: 14px; background: #0B1F16; display: block; }
.lesson-content figure.media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; background: #0B1F16; }
.lesson-content figure.audio { padding: 12px 14px; border-radius: 14px; background: var(--glass-soft); border: 1px solid var(--glass-border); }
.lesson-content figure.audio audio { width: 100%; }
.lesson-content figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.lesson-content blockquote { margin: 14px 0; padding: 6px 0 6px 16px; border-left: 4px solid var(--szif-green); color: var(--ink-2); font-style: italic; }
.lesson-content hr { border: 0; height: 1px; background: var(--line-strong); margin: 22px 0; }
.lesson-content h2 { font-size: 24px; margin-top: 18px; }
.lesson-content p:last-child { margin-bottom: 0; }
.lesson-content .lead { font-size: 17px; color: var(--ink-2); }

/* =====================================================================
   WYSIWYG editor
   ===================================================================== */
.rte-wrap { display: flex; flex-direction: column; }
.rte-tabs { display: flex; gap: 2px; align-items: center; margin-bottom: -1px; position: relative; z-index: 1; }
.rte-tabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 7px 12px; border-radius: 10px 10px 0 0; font: 600 12.5px var(--font-body); color: var(--ink-3); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.rte-tabs button.on { background: var(--glass-strong); border-color: var(--line-strong); color: var(--ink); }
.rte-title { margin-left: auto; font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.rte-hidden { display: none; }
.rte { border: 1px solid var(--line-strong); border-radius: 0 14px 14px 14px; background: var(--glass-strong); position: relative; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--glass-strong); border-radius: 0 14px 0 0; backdrop-filter: blur(12px); }
.rte-bar > button, .rte-pop > button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.rte-bar > button:hover, .rte-pop > button:hover { background: var(--neutral-bg); color: var(--ink); }
.rte-bar > button.on { background: var(--ok-bg); color: var(--szif-green); }
.rte-bar .rte-text { width: auto !important; padding: 0 10px; font: 600 12.5px var(--font-body); }
.rte-bar select { height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: 500 13px var(--font-body); padding: 0 6px; }
.rte-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.rte-grow { flex: 1; }
.rte-pop { position: relative; }
.rte-menu { display: none; position: absolute; top: 36px; left: 0; z-index: 10; min-width: 200px; padding: 8px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--glass-shadow); backdrop-filter: blur(18px); }
.rte-menu.open { display: block; }
.rte-menu > button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font: 500 13.5px var(--font-body); color: var(--ink); cursor: pointer; text-align: left; }
.rte-menu > button:hover { background: var(--neutral-bg); }
.rte-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin: 4px 2px 6px; }
.rte-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rte-swatches button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.rte-area { padding: 18px 22px; outline: none; overflow-wrap: anywhere; line-height: 1.65; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; }
.rte-area img, .rte-area video, .rte-area iframe { outline: 2px solid transparent; }
.rte-area img:hover, .rte-area video:hover { outline-color: color-mix(in srgb, var(--szif-green) 40%, transparent); }
.rte-progress { position: absolute; left: 12px; right: 12px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line-strong); font-size: 12.5px; overflow: hidden; }
.rte-progress i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--szif-green); transition: width .2s; }
.rte-html { border-radius: 0 14px 14px 14px; }
.rte-preview { border: 1px solid var(--line-strong); border-radius: 0 14px 14px 14px; padding: 18px 22px; background: var(--glass-soft); }

/* =====================================================================
   Celoobrazovkový editor
   ===================================================================== */
.fs-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(4, 22, 14, .45); backdrop-filter: blur(8px); padding: 16px; animation: fade .18s ease; }
.fs-editor { height: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--glass-strong); animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.fs-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.fs-title { margin: 2px 0 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.fs-title-input { height: 52px; font: 700 22px var(--font-head); }
.fs-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.fs-main { overflow-y: auto; padding: 22px 28px 60px; }
.fs-side { overflow-y: auto; padding: 22px 22px 40px; border-left: 1px solid var(--line); background: var(--glass-soft); display: flex; flex-direction: column; gap: 16px; }
.fs-section { margin-bottom: 26px; max-width: 980px; }
.fs-section > .label { display: block; margin-bottom: 10px; font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.fs-preview .question { margin: 0; }
@media (max-width: 1100px) {
    .fs-body { grid-template-columns: 1fr; overflow-y: auto; }
    .fs-main, .fs-side { overflow: visible; }
    .fs-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) { .fs-overlay { padding: 0; } .fs-editor { border-radius: 0; } .fs-main { padding: 16px; } }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--glass-soft); color: var(--ink-2); font: 600 13px var(--font-body); text-align: left; cursor: pointer; transition: border .15s, background .15s, transform .1s; }
.type-card:hover:not(:disabled) { border-color: var(--szif-green); transform: translateY(-1px); }
.type-card.on { border-color: var(--szif-green); background: var(--ok-bg); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--szif-green) 16%, transparent); }
.type-card.on svg { color: var(--szif-green); }
.type-card:disabled { cursor: default; opacity: .7; }

.ans-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ans-row .input { flex: 1; }
.ans-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--glass-soft); color: var(--ink-3); cursor: pointer; }
.ans-row.correct .ans-mark { background: var(--szif-green); border-color: var(--szif-green); color: #fff; }
.ans-row.correct .input { border-color: color-mix(in srgb, var(--szif-green) 50%, transparent); }
.order-n { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--szif-green); color: #fff; font: 800 13px var(--font-head); }
.tf-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; }
.tf-pick button { display: flex; gap: 10px; align-items: center; justify-content: center; height: 56px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--glass-soft); font: 650 15px var(--font-body); color: var(--ink-2); cursor: pointer; }
.tf-pick button.on { background: var(--szif-green); color: #fff; border-color: var(--szif-green); }
.media-thumb { position: relative; width: 40px; height: 40px; flex: none; }
.media-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-strong); }
.media-thumb button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--szif-red); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.dropzone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px; border: 2px dashed var(--line-strong); border-radius: 18px; background: var(--glass-soft); color: var(--ink-2); cursor: pointer; font: inherit; }
.dropzone:hover { border-color: var(--szif-green); color: var(--szif-green); }
.dropzone span { font-size: 13px; color: var(--ink-3); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }

/* ---------- hotspot ---------- */
.hotspot { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); user-select: none; }
.hotspot img { max-width: 100%; display: block; }
.hotspot.active img, .hotspot.editing img { cursor: crosshair; }
.hotspot-pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(0,135,63,.25); border: 3px solid var(--szif-green); box-shadow: 0 0 0 4px rgba(255,255,255,.7); pointer-events: none; animation: pop .2s; }
.hotspot-pin::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--szif-green); }
.hotspot-region { position: absolute; border: 2px solid var(--szif-green); background: rgba(0,135,63,.18); border-radius: 6px; pointer-events: none; }
.hotspot-region.drawing { border-style: dashed; }
.hotspot-del { pointer-events: auto; position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--szif-red); color: #fff; cursor: pointer; line-height: 1; font-size: 15px; }

/* ---------- otázka v testu ---------- */
.question .q-body { flex: 1; min-width: 0; }
.question .q-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.question .q-text { font-weight: 550; font-size: 16px; }
.question .q-text p { margin: 0 0 .5em; }
.question .q-answer { margin-left: 40px; }
.question .q-answer .answer { margin-left: 0; }
.question.is-ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok-bg) 55%, var(--glass-soft)); }
.question.is-bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.question.is-partial { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.question.is-pending { border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.answer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.answer.has-media { flex-direction: column; align-items: stretch; margin: 0; }
.answer.has-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.answer:has(input:disabled) { cursor: default; }
.qv-text { max-width: 520px; }
.qv-num { max-width: 220px; }
.match { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.match-left { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong); font-weight: 550; }
.match-left img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong); cursor: grab; transition: transform .1s, box-shadow .15s; }
.order-item:active { cursor: grabbing; }
.order-item.dragging { opacity: .5; }
.order-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.order-item .grow { flex: 1; font-weight: 550; }
.cloze { font-size: 16px; line-height: 2.4; }
.cloze .gap { font: 600 15px var(--font-body); height: 34px; padding: 0 10px; margin: 0 4px; border-radius: 9px; border: 1px solid var(--line-strong); border-bottom: 2px solid var(--szif-green); background: var(--glass-strong); color: var(--ink); vertical-align: baseline; }
.cloze input.gap { min-width: 6ch; }
.essay-answer { margin: 4px 0 0 40px; padding: 14px 16px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong); white-space: pre-wrap; }
.grade-row { display: flex; gap: 14px; align-items: center; margin: 14px 0 10px 40px; }
.grade-row input[type=range] { flex: 1; accent-color: var(--szif-green); }
.grade-row + .input { margin-left: 40px; width: calc(100% - 40px); }
.question.is-auto { opacity: .8; }

/* ---------- seznam otázek v editoru kurzu ---------- */
.q-type-ico { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--ok-bg); color: var(--szif-green); }
.q-item-text { font-weight: 550; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.q-item:hover { background: var(--glass-soft); border-radius: 12px; }
@media (max-width: 600px) {
    .question .q-answer, .essay-answer, .grade-row { margin-left: 0; }
    .match-row { grid-template-columns: 1fr; }
    .match-row > svg { display: none; }
}

/* ---------- náhledy certifikátů (PNG z QuestyPDF) ---------- */
.cert-thumb { flex: none; width: 132px; aspect-ratio: 297 / 210; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 8px 20px -12px rgba(3,74,49,.5); transition: transform .15s; }
.cert-thumb:hover { transform: scale(1.03); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cert-preview { width: 100%; height: auto; display: block; border-radius: 14px; background: #fff; box-shadow: 0 10px 40px -14px rgba(0,0,0,.35); }
@media (max-width: 560px) { .cert-thumb { width: 96px; } }

/* ---------- etapa 1: průkaznost ---------- */
.declarations { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; margin-top: 18px; border-radius: 16px; }
.declarations .check { align-items: flex-start; }
.declarations .check input { margin-top: 3px; flex: none; }

/* ---------- etapa 3: matice školení ---------- */
.matrix-wrap { max-height: 68vh; overflow: auto; }
table.matrix { border-collapse: separate; }
table.matrix th.mcol { text-align: center; min-width: 78px; padding: 8px 4px; }
.mcol-head { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; }
.mcol-pct { font: 800 13px var(--font-head); margin-top: 4px; letter-spacing: 0; text-transform: none; }
.mcol-pct.ok { color: var(--ok); } .mcol-pct.warn { color: var(--warn); } .mcol-pct.bad { color: var(--bad); }
table.matrix .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--glass-strong); backdrop-filter: blur(10px); min-width: 260px; }
table.matrix th.sticky-col { z-index: 3; }
td.mcell { text-align: center; font-size: 11.5px; font-weight: 650; border-left: 1px solid var(--line); padding: 6px 4px; }
td.m-valid { background: var(--m-valid-bg); color: var(--m-valid); }
td.m-expiring { background: var(--m-expiring-bg); color: var(--m-expiring); }
td.m-assigned { background: var(--m-assigned-bg); color: var(--m-assigned); }
td.m-inprogress { background: var(--m-progress-bg); color: var(--m-progress); }
td.m-missing { background: var(--m-missing-bg); color: var(--m-bad); }
td.m-overdue { background: var(--m-bad-bg); color: var(--m-bad); }
td.m-expired { background: repeating-linear-gradient(135deg, var(--m-expired-bg) 0 6px, var(--m-bad-bg) 6px 12px); color: var(--m-bad); }
td.m-notrequired { background: transparent; }
/* značka stavu, aby rozlišení nestálo jen na barvě */
td.m-valid span::before { content: "✓ "; }
td.m-expiring span::before { content: "! "; }
td.m-assigned span::before { content: "○ "; }
td.m-inprogress span::before { content: "▸ "; }
td.m-overdue span::before, td.m-expired span::before { content: "✕ "; }
.mcell-btn { border: 1px dashed var(--m-bad); background: transparent; color: var(--m-bad); border-radius: 8px; font: 650 11px var(--font-body); padding: 3px 7px; cursor: pointer; white-space: nowrap; }
.mcell-btn.add { border-color: var(--line-strong); color: var(--ink-3, var(--ink-2)); opacity: .45; }
td.mcell:hover .mcell-btn.add, .mcell-btn.add:focus-visible { opacity: 1; border-color: var(--szif-green); color: var(--szif-green); }
td.mcell .mcell-btn.add:hover { background: var(--szif-green); border-color: var(--szif-green); color: #fff; }
.mcell-btn:hover { background: var(--m-bad); color: #fff; }

/* ---------- etapa 2: prezenční termíny ---------- */
.session-card { display: flex; gap: 18px; align-items: flex-start; }
.session-card.mine { border-color: color-mix(in srgb, var(--szif-green) 50%, transparent); }
.session-date { flex: none; width: 64px; padding: 10px 0; border-radius: 16px; text-align: center; color: #fff; background: linear-gradient(135deg, var(--szif-green-400), var(--szif-forest)); }
.session-date b { display: block; font: 800 24px var(--font-head); line-height: 1; }
.session-date span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.qr-box { width: 220px; margin: 10px auto; padding: 10px; background: #fff; border-radius: 14px; }
.qr-box svg { width: 100%; height: auto; display: block; }
.signature-pad { width: 100%; height: 260px; border-radius: 16px; background: #fff; border: 2px dashed var(--line-strong); cursor: crosshair; touch-action: none; display: block; }
.kiosk { position: fixed; inset: 0; z-index: 110; padding: 28px; overflow: auto; background: var(--bg); }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.kiosk-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border-radius: 20px; border: 1px solid var(--glass-border); background: var(--glass-strong); font: inherit; color: var(--ink); cursor: pointer; transition: transform .1s; }
.kiosk-tile:active { transform: scale(.97); }
.kiosk-tile .avatar { width: 56px; height: 56px; font-size: 20px; border-radius: 18px; }
.kiosk-tile b { font-size: 16px; }
.kiosk-tile.done { opacity: .55; border-color: var(--szif-green); }

/* ---------- etapa 5: instruktáž hostů (mobil první) ---------- */
.guest { width: min(760px, 100%); margin: 0 auto; padding: 16px 16px 40px; }
.guest-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 14px; }
.guest-head img { height: 40px; }
.guest-head .input { width: auto; height: 38px; }
.guest-hero { position: relative; overflow: hidden; padding: 24px 22px 20px; border-radius: 24px 24px 0 0; color: #fff; background: linear-gradient(135deg, var(--szif-green), var(--szif-forest)); }
.guest-hero::after { content: ""; position: absolute; top: -40%; bottom: -40%; right: 6%; width: 70px; transform: skewX(-34deg); background: rgba(255,255,255,.14); }
.guest-hero h1 { color: #fff; font-size: clamp(24px, 6vw, 34px); margin: 4px 0 6px; position: relative; }
.guest-hero p { margin: 0; color: rgba(255,255,255,.85); position: relative; }
.guest-progress { position: relative; height: 6px; margin-top: 14px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.guest-progress i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: 99px; transition: width .3s; }
.guest-body { border-radius: 0 0 24px 24px; border-top: 0; }
.guest-body h2 { font-size: clamp(22px, 5vw, 28px); }
.guest-pass { text-align: center; padding: 10px 0; }
.guest-pass .ico { width: 68px; height: 68px; margin: 0 auto 10px; border-radius: 22px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.guest-number { display: inline-block; margin: 6px 0 12px; padding: 12px 22px; border-radius: 16px; font: 800 clamp(26px, 8vw, 40px) var(--font-head); letter-spacing: .06em; color: var(--szif-forest); background: var(--ok-bg); border: 2px dashed var(--szif-green); }
.guest-foot { text-align: center; margin-top: 14px; }
.verify-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; }
.verify-card.ok { background: var(--ok-bg); color: var(--ink); border: 1px solid var(--ok); }
.verify-card.ok svg { color: var(--ok); }
.verify-card.bad { background: var(--bad-bg); border: 1px solid var(--bad); }
.verify-card.bad svg { color: var(--bad); }
@media (max-width: 640px) { .guest .form-grid { grid-template-columns: 1fr; } .guest .lesson-actions { flex-wrap: wrap; } }

/* ---------- etapa 6: zapojení ---------- */
.quiz-teaser { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--szif-green) 45%, transparent); }
.quiz-teaser .ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--szif-green-400), var(--szif-forest)); }
.quiz-teaser:hover { transform: translateY(-2px); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: 16px; border: 1px dashed var(--line-strong); opacity: .55; }
.badge-tile .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink-3); }
.badge-tile b { font-size: 12.5px; line-height: 1.2; }
.badge-tile small { font-size: 11px; color: var(--ink-3); }
.badge-tile.on { opacity: 1; border: 1px solid color-mix(in srgb, var(--szif-green) 40%, transparent); background: var(--ok-bg); }
.badge-tile.on .ico { color: #fff; background: linear-gradient(135deg, #E9B949, #C98A0B); box-shadow: 0 6px 16px rgba(201, 138, 11, .35); }
.quiz-score { font: 800 64px/1 var(--font-head); color: var(--szif-green); }

/* ---------- etapa 7: BOZP agenda ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink); font: 500 14px var(--font-body, inherit); cursor: pointer; }
.chip.on { background: var(--szif-green); border-color: var(--szif-green); color: #fff; }
.report-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin-top: 8px; }
.exam-state { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- etapa 8: API ---------- */
.snippet { display: block; margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(3, 74, 49, .08); border: 1px solid var(--line); font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink); }
:root[data-theme="dark"] .snippet { background: rgba(255, 255, 255, .06); }

/* ---------- formuláře: sekce, popisky s ikonou, volby jako karty, kontextová nápověda ---------- */
.form-sections { display: flex; flex-direction: column; gap: 18px; }
.form-section { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 18px 20px 20px; background: var(--glass-soft); }
.form-section-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-strong); }
.form-section-head h3 { margin: 0; font-size: 16px; }
.form-section-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.fsec-ico { --fsec: var(--szif-green); flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--fsec); background: color-mix(in srgb, var(--fsec) 13%, transparent); }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.form-grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.flabel { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.flabel .flabel-ico { color: var(--szif-green); flex: none; }
.flabel .req { color: var(--bad); }
.field.help-active .input, .field.help-active .rte-wrap { border-color: var(--szif-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--szif-green) 18%, transparent); }
[data-help-host].help-active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--szif-green) 18%, transparent); border-radius: var(--radius-sm); }

.help-q { flex: none; width: 18px; height: 18px; padding: 0; margin-left: 2px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--szif-green) 45%, transparent); background: transparent; color: var(--szif-green); font: 700 11px/16px var(--font-body); cursor: help; opacity: .75; transition: opacity .15s, background .15s; }
.help-q:hover, .help-active .help-q { opacity: 1; background: var(--szif-green); color: #fff; }

.check-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--glass); cursor: pointer; transition: border-color .15s, background .15s; }
.check-card:hover { border-color: color-mix(in srgb, var(--szif-green) 45%, transparent); }
.check-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-card .cc-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); background: var(--neutral-bg); transition: inherit; }
.check-card .cc-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-card .cc-body b { font-size: 14px; font-weight: 650; }
.check-card .cc-body small { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.check-card .cc-switch { flex: none; width: 36px; height: 20px; margin-top: 6px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; }
.check-card .cc-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.check-card.on { border-color: color-mix(in srgb, var(--szif-green) 55%, transparent); background: color-mix(in srgb, var(--szif-green) 7%, var(--glass)); }
.check-card.on .cc-ico { color: #fff; background: var(--szif-green); }
.check-card.on .cc-switch { background: var(--szif-green); }
.check-card.on .cc-switch i { left: 18px; }
.check-card input:focus-visible ~ .cc-switch { outline: 3px solid color-mix(in srgb, var(--szif-green) 55%, transparent); outline-offset: 2px; }
.check-card.disabled { opacity: .55; cursor: default; }
.check-card .help-q { position: absolute; top: 8px; right: 8px; }
.check-card:has(.help-q) .cc-switch { margin-right: 18px; }

/* nápověda pod polem: dva řádky, celý text po rozbalení */
.help-bubble { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 7px 8px 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--szif-green) 8%, var(--glass)); border: 1px solid color-mix(in srgb, var(--szif-green) 28%, transparent); color: var(--ink-2); font-size: 12.5px; font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: normal; font-family: var(--font-body); animation: hb-in .14s ease-out; }
.hb-body { flex: 1; min-width: 0; }
.hb-text { margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.hb-text b { color: var(--ink); font-weight: 650; }
.help-bubble:not(.open) .hb-tip, .help-bubble:not(.open) .hb-ex { display: none; }
.help-bubble.open .hb-text { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.hb-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--szif-green); color: #fff; font-weight: 700; font-size: 11px; }
.hb-more, .hb-close { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; padding: 0; }
.hb-more:hover, .hb-close:hover { background: color-mix(in srgb, var(--szif-green) 14%, transparent); color: var(--szif-green); }
.hb-more svg { transition: transform .15s; }
.help-bubble.open .hb-more svg { transform: rotate(180deg); }
.hb-close { font-size: 17px; line-height: 1; }
.hb-tip { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--ok-bg); }
.hb-ex { margin-top: 6px; }
.hb-ex span { display: block; font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.hb-ex code { display: block; padding: 5px 8px; border-radius: 8px; background: var(--neutral-bg); font-size: 12px; white-space: pre-wrap; }
@keyframes hb-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.help-toggle.on { color: var(--szif-green); }
.help-wrap { position: relative; }
.help-notice { position: absolute; top: calc(100% + 12px); right: -8px; z-index: 150; width: min(360px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--szif-green) 5%, var(--bg)); border: 1px solid color-mix(in srgb, var(--szif-green) 40%, transparent); box-shadow: 0 18px 50px -12px rgba(0,0,0,.35); font-size: 13.5px; line-height: 1.5; animation: hb-in .2s ease-out; }
.help-notice::before { content: ""; position: absolute; top: -7px; right: 20px; width: 12px; height: 12px; background: inherit; border-left: 1px solid color-mix(in srgb, var(--szif-green) 40%, transparent); border-top: 1px solid color-mix(in srgb, var(--szif-green) 40%, transparent); transform: rotate(45deg); }
.help-notice b { display: block; font-family: var(--font-head); font-size: 15px; margin-bottom: 4px; }
.help-notice p { margin: 0 0 12px; color: var(--ink-2); }
.help-notice .row { justify-content: flex-end; gap: 8px; }
.help-toggle.pulse { animation: help-pulse 1.6s ease-out infinite; }
@keyframes help-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--szif-green) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (max-width: 640px) { .help-wrap { position: static; } .help-notice { left: 0; right: 0; width: auto; } .help-notice::before { display: none; } }

/* ---------- zastoupení ---------- */
.acting-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--warn); background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); text-decoration: none; white-space: nowrap; }
.acting-chip:hover { text-decoration: none; filter: brightness(1.05); }
.list-item.on { border-color: color-mix(in srgb, var(--szif-green) 45%, transparent); background: var(--ok-bg); }
@media (max-width: 760px) { .acting-chip span { display: none; } }

/* ===================== Aplikace v Microsoft Teams (/teams) =====================
   Odlehčené rozvržení: žádné rozmazávání pozadí ani boční menu, aby se karta v Teams načetla rychle.
   Barvy berou tokeny aplikace, téma (světlé, tmavé, vysoký kontrast) nastavuje TeamsJS podle Teams. */
body:has(.tms) .backdrop { display: none; }
body:has(.tms) { background: var(--tms-bg); }
:root { --tms-bg: #F5F8F6; --tms-card: #FFFFFF; --tms-hover: #F0F6F2; }
:root[data-theme="dark"] { --tms-bg: #1F1F1F; --tms-card: #292929; --tms-hover: #323232; }
:root[data-contrast] { --tms-bg: #000; --tms-card: #000; --tms-hover: #1a1a1a; --line: #fff; --ink-3: #fff; }
.tms { min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font-body); color: var(--ink); }
.tms-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 22px; background: var(--tms-card); border-bottom: 1px solid var(--line); }
.tms-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.tms-logo { font: 800 15px var(--font-head); color: #fff; background: var(--szif-green); padding: 5px 8px; border-radius: 8px; letter-spacing: .04em; }
.tms-product { font: 700 15px var(--font-head); color: var(--ink); }
.tms-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tms-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; position: relative; }
.tms-tabs a:hover { background: var(--tms-hover); color: var(--ink); }
.tms-tabs a.active { color: var(--szif-green); }
.tms-tabs a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 3px; border-radius: 3px 3px 0 0; background: var(--szif-green); }
:root[data-theme="dark"] .tms-tabs a.active { color: #6FCF9B; }
.tms-open { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); }
.tms-open:hover { background: var(--tms-hover); }
.tms-main { width: min(1040px, 100%); margin: 0 auto; padding: 22px 22px 40px; }
.tms-hero { display: flex; gap: 22px; align-items: stretch; justify-content: space-between; flex-wrap: wrap; padding: 24px; border-radius: 16px;
    background: linear-gradient(135deg, var(--szif-forest) 0%, var(--szif-green) 100%); color: #fff; margin-bottom: 22px; position: relative; overflow: hidden; }
.tms-hero::after { content: ""; position: absolute; right: -60px; top: -40px; width: 260px; height: 260px; background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.12) 43%, rgba(255,255,255,.12) 58%, transparent 59%); pointer-events: none; }
.tms-hero.compact { padding: 20px 24px; }
.tms-hero-text { flex: 1 1 320px; position: relative; z-index: 1; }
.tms-hero h1 { font: 800 26px/1.15 var(--font-head); margin: 4px 0 14px; color: #fff; }
.tms-eyebrow { font: 700 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.tms-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tms-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 11px; border-radius: 99px; background: rgba(255,255,255,.16); font-size: 13px; }
.tms-chip b { font: 800 15px var(--font-head); }
.tms-chip.bad { background: rgba(255, 92, 72, .32); }
.tms-chip.warn { background: rgba(255, 186, 73, .3); }
.tms-chip.ok { background: rgba(255,255,255,.22); }
.tms-next { flex: 1 1 360px; display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--tms-card); color: var(--ink); text-decoration: none;
    box-shadow: 0 12px 30px -14px rgba(0,0,0,.45); position: relative; z-index: 1; transition: transform .12s; }
.tms-next:hover { transform: translateY(-2px); }
.tms-next .tms-eyebrow { color: var(--szif-green); opacity: 1; }
.tms-next-title { font: 700 17px/1.3 var(--font-head); margin: 2px 0 4px; }
.tms-sub { font-size: 13px; color: var(--ink-3); }
.tms-sub.bad, .tms-meta .bad { color: var(--bad); font-weight: 600; }
.tms-meta .warn { color: var(--warn); font-weight: 600; }
.tms-meta .ok { color: var(--ok); font-weight: 600; }
.tms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong);
    background: var(--tms-card); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; flex: none; }
.tms-btn.primary { background: var(--szif-green); border-color: var(--szif-green); color: #fff; padding: 0 16px; height: 38px; }
.tms-h2 { font: 700 16px var(--font-head); margin: 24px 2px 10px; color: var(--ink-2); }
.tms-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tms-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--tms-card); color: inherit; text-decoration: none; }
a.tms-row:hover { background: var(--tms-hover); }
.tms-row .grow, .tms-next .grow { flex: 1 1 auto; min-width: 0; }
.tms a.tms-row, .tms a.tms-next, .tms .tms-title { color: var(--ink); }
/* položky mřížky a flexu se smí zúžit, jinak dlouhý název kurzu roztáhne stránku na telefonu */
.tms-list > *, .tms-hero > * { min-width: 0; }
.tms-main { min-width: 0; overflow-x: clip; }
.tms-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tms-cat { flex: none; width: 46px; height: 32px; display: grid; place-items: center; border-radius: 8px; font: 800 11px var(--font-head); letter-spacing: .03em;
    color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tms-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font-head); color: #fff; background: var(--szif-forest); }
.tms-bar { height: 5px; border-radius: 5px; background: var(--neutral-bg); margin-top: 7px; overflow: hidden; max-width: 320px; }
.tms-bar i { display: block; height: 100%; border-radius: 5px; background: var(--szif-green); }
.tms-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; white-space: nowrap; }
.tms-meta small { color: var(--ink-3); }
.tms-score { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 14px; background: var(--tms-card); color: var(--ink); position: relative; z-index: 1; font-size: 13px; }
.tms-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px; color: var(--ink-3); background: var(--tms-card); border-radius: 14px; border: 1px solid var(--line); }
.tms-empty b { color: var(--ink); font-size: 16px; }
.tms-note { font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.tms-skeleton { display: grid; gap: 12px; }
.tms-skeleton div { height: 74px; border-radius: 12px; background: linear-gradient(90deg, var(--tms-card) 25%, var(--tms-hover) 50%, var(--tms-card) 75%); background-size: 200% 100%; animation: tms-shimmer 1.2s infinite; }
.tms-skeleton div:first-child { height: 150px; }
@keyframes tms-shimmer { to { background-position: -200% 0; } }
.tms-player .glass { background: var(--tms-card); backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 640px) {
    .tms-top { padding: 8px 12px; gap: 10px; }
    .tms-product { display: none; }
    .tms-main { padding: 14px 12px 30px; }
    .tms-hero { padding: 18px; }
    .tms-hero h1 { font-size: 21px; }
    .tms-bar { max-width: none; }
    .tms-meta small { display: none; }
    .tms-next { flex-wrap: wrap; }
    .tms-next .tms-btn.primary { width: 100%; }
    .tms-row { gap: 10px; padding: 11px 12px; }
    .tms-cat { width: 40px; }
}
