/* Převzato z naucme-v17 shared.css (24. 11. 2026), upraveno: nic — jeden vzhled s naucme (_stavba.md § 5.3). */
/* ============================================================
   naucme.cz — Shared CSS
   Dark theme, sidebar layout, Lexend font
   ============================================================ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; color: inherit; }
img { max-width: 100%; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ── CSS VARIABLES ── */
:root {
    --sidebar-w:    260px;
    --sidebar-coll: 64px;
    --header-h:     60px;

    /* Brand palette */
    --indigo:       #6366f1;
    --indigo2:      #4f46e5;
    --indigo-glow:  rgba(99,102,241,0.3);
    --blue:         #3B82F6;
    --blue-glow:    rgba(59,130,246,0.28);
    --emerald:      #10b981;
    --emerald2:     #059669;
    --emerald-text: #34d399;   /* zelený TEXT (odznaky, „ušetřeno"); světlý režim níž */

    /* Jeden akcent pro výběr (aktivní položka menu, zvolená volba, hlavní akce ve výstupu).
       Modrá (--blue) zůstává jen pro informační prvky. */
    --accent:       var(--indigo);
    --accent-soft:  rgba(99,102,241,0.14);
    --accent-text:  #a5b4fc;
    --radius-pill:  999px;
    --amber:        #f59e0b;
    --danger:       #ef4444;
    --danger-text:  #fca5a5;   /* text v červených pruzích; světlý režim níž */
    --danger2:      #dc2626;

    /* Surface (dark navy) */
    --surface:      #0D1424;
    --surface2:     #16202F;
    --surface3:     #1E2D3E;
    --sidebar-bg:   #111C2D;

    /* Text */
    --text:         #f8fafc;
    --text-muted:   #94a3b8;
    --text-dim:     rgba(248,250,252,0.35);

    /* Borders / Glass */
    --border:       rgba(255,255,255,0.08);
    --border-med:   rgba(255,255,255,0.13);
    --card:         rgba(255,255,255,0.04);
    --card-hover:   rgba(255,255,255,0.07);

    /* Shadows */
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.35);
    --shadow:       0 4px 20px rgba(0,0,0,0.45);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.55);

    /* Radius */
    --r-sm:   6px;
    --r:      10px;
    --r-lg:   14px;
    --r-xl:   18px;

    /* Transition */
    --ease:   0.18s ease;

    /* Aliases for backwards-compat with local page styles */
    --input-bg:     var(--surface2);
    --primary:      var(--indigo);
    --primary-light: #818cf8;
}

/* ── BASE ── */
html, body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* ── LAYOUT ── */
.layout {
    display: flex;
    min-height: 100vh;
}

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--ease);
}

.layout.collapsed .main { margin-left: var(--sidebar-coll); }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width var(--ease);
    overflow: hidden;
}

.layout.collapsed .sidebar { width: var(--sidebar-coll); }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--ease), width var(--ease);
}

.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    transition: color var(--ease);
}
.sidebar-toggle:hover { color: var(--text); }
/* Zavřít vysunuté menu na telefonu (naucmeZavriMenu v app.js); na počítači skryté */
.sidebar-close {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    align-items: center;
    border-radius: var(--r-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--ease);
}
.sidebar-close:hover { color: #fff; }

.layout.collapsed .sidebar-logo-text { opacity: 0; width: 0; overflow: hidden; }
.layout.collapsed .sidebar-logo-icon { opacity: 0; width: 0; overflow: hidden; }
.layout.collapsed .sidebar-logo { justify-content: center; padding: 0; }
.layout.collapsed .sidebar-toggle { margin-left: 0; }

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
}
.sidebar-nav::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--r);
    color: var(--text-muted);
    transition: all var(--ease);
    white-space: nowrap;
    position: relative;
}
button.nav-item {
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.nav-item:hover { color: var(--text-muted); background: var(--card-hover); }
.nav-item:hover .nav-label { color: var(--text); }
.nav-item.active {
    color: var(--text-muted);
    background: var(--accent-soft);
    font-weight: 600;
}
.nav-item.active .nav-label { color: var(--accent-text); }

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-label {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.25px;
    overflow: hidden;
    transition: opacity var(--ease), width var(--ease);
}

.layout.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

/* Tooltip pro collapsed sidebar */
.layout.collapsed .nav-item::after {
    content: attr(data-label);
    position: absolute;
    left: calc(var(--sidebar-coll) - 4px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface3);
    color: var(--text);
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--r);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    border: 1px solid var(--border-med);
    box-shadow: var(--shadow);
    z-index: 300;
    transition: opacity 0.1s;
}
.layout.collapsed .nav-item:hover::after { opacity: 1; }

/* ── TOPBAR ── */
.topbar {
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 100;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.plan-badge.start   { background: rgba(245,158,11,0.15);  color: var(--amber); }
.plan-badge.teacher { background: rgba(99,102,241,0.15);  color: var(--indigo); }
.plan-badge.parent  { background: rgba(236,72,153,0.15);  color: #ec4899; }
.plan-badge.school  { background: rgba(16,185,129,0.15);  color: var(--emerald); }
a.plan-badge { text-decoration: none; transition: filter var(--ease); }
a.plan-badge:hover { filter: brightness(1.15); }
.topbar-cta { border-radius: 50px; padding: 4px 12px; white-space: nowrap; }

/* Přepínač světlý / tmavý vzhled v horní liště: v tmavém slunce, ve světlém měsíc */
.theme-quick {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted);
    padding: 4px; border-radius: var(--r-sm); cursor: pointer;
    transition: color var(--ease);
}
.theme-quick:hover { color: var(--text); }
.theme-quick .ikona-slunce { display: flex; }
.theme-quick .ikona-mesic { display: none; }
html.theme-light .theme-quick .ikona-slunce { display: none; }
html.theme-light .theme-quick .ikona-mesic { display: flex; }
/* Na úzkém displeji se lišta nesmí rozlézt: výzva k plánu mizí (plán je dál v odznaku),
   dlouhý název stránky se zkrátí třemi tečkami. */
@media (max-width: 600px) {
    .topbar-cta { display: none; }
    .topbar-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ── PAGE CONTENT ── */
.page-content {
    padding: 28px 24px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ── CARDS ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
}

.card-hover {
    transition: background var(--ease), border-color var(--ease), transform 0.15s;
}
.card-hover:hover {
    background: var(--card-hover);
    border-color: var(--border-med);
    transform: translateY(-1px);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.65rem 1.2rem;
    border-radius: var(--r-lg);
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--indigo), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px var(--indigo-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-secondary {
    background: var(--card);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-hover); color: var(--text); }

.btn-success {
    background: rgba(16,185,129,0.15);
    color: var(--emerald);
    border: 1px solid rgba(16,185,129,0.25);
}
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-danger {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-ghost {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--card); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 13px; }
.btn-icon { padding: 0.6rem; }

/* ── GENERATE BUTTON — unified AI CTA across all pages ── */
@keyframes genPulse {
    0%, 100% { box-shadow: 0 4px 22px rgba(99,102,241,0.38), 0 2px 8px rgba(0,0,0,0.2); }
    50%       { box-shadow: 0 4px 32px rgba(99,102,241,0.65), 0 2px 8px rgba(0,0,0,0.2); }
}
@keyframes genShimmer {
    0%        { transform: translateX(-150%) skewX(-12deg); }
    55%, 100% { transform: translateX(220%)  skewX(-12deg); }
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.btn-generate,
.btn-gen {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--r-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: genPulse 2.8s ease-in-out infinite;
    font-family: inherit;
    letter-spacing: 0.1px;
}
.btn-generate::before,
.btn-gen::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
    animation: genShimmer 2.8s ease-in-out infinite;
    pointer-events: none;
}
.btn-generate:hover:not(:disabled),
.btn-gen:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99,102,241,0.58), 0 0 0 4px rgba(99,102,241,0.12);
    animation: none;
}
.btn-generate:hover:not(:disabled)::before,
.btn-gen:hover:not(:disabled)::before { animation: none; }
.btn-generate:active:not(:disabled),
.btn-gen:active:not(:disabled) { transform: translateY(0); }
.btn-generate:disabled,
.btn-gen:disabled { opacity: 0.45; cursor: not-allowed; animation: none; }
.btn-generate:disabled::before,
.btn-gen:disabled::before { display: none; }
/* Legacy loading shimmer (generator.php) */
.btn-generate.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s infinite;
}

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 6px;
    min-height: 16px;
    border-radius: 999px;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
}

.form-badge--optional {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.12);
    color: rgba(99, 102, 241, 0.78);
}

html.theme-light .form-badge--optional {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.10);
    color: rgba(79, 70, 229, 0.72);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    transition: border-color var(--ease), box-shadow var(--ease);
    outline: none;
}
.form-control::placeholder,
.form-input::placeholder { color: var(--text-dim); }
.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control:hover:not(:focus),
.form-input:hover:not(:focus),
.form-select:hover:not(:focus),
.form-textarea:hover:not(:focus) { border-color: var(--border-med); }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

/* Password eye toggle */
.pass-wrapper { position: relative; }
.pass-wrapper .form-control,
.pass-wrapper .form-input { padding-right: 44px; }
.pass-eye {
    position: absolute; right: 0; top: 0; bottom: 0; width: 42px;
    background: transparent; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); cursor: pointer;
    transition: color .15s; border-radius: 0 var(--r) var(--r) 0;
}
.pass-eye:hover { color: var(--text-muted); }

.form-range {
    width: 100%;
    accent-color: var(--indigo);
}

/* Radio cards (type selector) */
.type-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.type-card input[type=radio] { display: none; }

.type-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    text-align: center;
    transition: all var(--ease);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.type-card label:hover { border-color: var(--border-med); color: var(--text); background: var(--card-hover); }
.type-card label .type-emoji { font-size: 22px; }

.type-card input[type=radio]:checked + label {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-pill input[type=checkbox] { display: none; }
.checkbox-pill label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ease);
    color: var(--text-muted);
}
.checkbox-pill label:hover { border-color: var(--border-med); color: var(--text); }
.checkbox-pill input:checked + label {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}


/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: all var(--ease);
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--ease);
}
.toggle input:checked + .toggle-slider { background: var(--indigo); border-color: var(--indigo); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px) translateY(-50%); background: #fff; }

/* Range slider */
.range-with-labels {
    display: flex;
    align-items: center;
    gap: 10px;
}
.range-value {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    color: var(--indigo);
}

/* ── GENERATOR PAGE ── */
.generator-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    height: calc(100vh - var(--header-h) - 56px);
    min-height: 600px;
}

.gen-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gen-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gen-panel-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

/* View toggle tabs (Příprava / Tabulka) in gen-panel header */
.gen-view-tabs { display: flex; gap: 2px; margin-left: auto; }
.gvt {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.gvt:hover { color: var(--text); border-color: var(--indigo); }
.gvt.active { background: rgba(99,102,241,.15); color: var(--indigo); border-color: rgba(99,102,241,.4); }

/* Output panel */
.gen-output-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
    gap: 16px;
    padding: 40px;
}
.gen-output-empty .empty-icon { font-size: 64px; line-height: 1; }
.gen-output-empty p { font-size: 15px; }

.gen-output-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: none;
}

.gen-output-text {
    line-height: 1.8;
    font-size: 14px;
}
.gen-output-text h1 { font-size: 18px; margin: 20px 0 10px; color: var(--text); }
.gen-output-text h2 { font-size: 16px; margin: 18px 0 8px; color: var(--indigo); border-left: 3px solid var(--indigo); padding-left: 10px; }
.gen-output-text h3 { font-size: 14px; margin: 12px 0 6px; font-weight: 700; }
.gen-output-text p { margin: 8px 0; }
.gen-output-text ul, .gen-output-text ol { margin: 8px 0 8px 20px; }
.gen-output-text li { margin: 4px 0; }
.gen-output-text strong { color: var(--text); }

.gen-output-text[contenteditable="true"] {
    outline: none;
    background: rgba(99,102,241,0.03);
    border-radius: var(--r);
    padding: 12px;
    border: 1px dashed rgba(99,102,241,0.3);
}

/* Výstup jako list papíru (třída .paper u #outputText) — učitel vidí, co vytiskne.
   Kontejner JS přepíná na display:flex, bez column by se list skládal do řádku. */
.gen-output-content { flex-direction: column; }
.gen-output-text.paper {
    background: #fff;
    color: #0f172a;
    width: 100%;
    max-width: 794px;
    margin: 0 auto;
    padding: 40px 48px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,.35);
    font-family: 'Lexend', system-ui, sans-serif;
    line-height: 1.7;
}
.gen-output-text.paper:empty { display: none; }
.gen-output-text.paper h1,
.gen-output-text.paper h3,
.gen-output-text.paper strong { color: #0f172a; }
.gen-output-text.paper h2 { color: #4338ca; border-left-color: #6366f1; }
.gen-output-text.paper[contenteditable="true"] { background: #fff; padding: 40px 48px; border: 1px dashed rgba(99,102,241,.55); }
html.theme-light .gen-output-text.paper {
    box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.08);
    border: 1px solid rgba(15,23,42,.08);
}
@media (max-width: 768px) {
    .gen-output-text.paper,
    .gen-output-text.paper[contenteditable="true"] { padding: 20px 16px; }
}

.gen-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gen-tip {
    margin: 0 20px 16px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--r);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--amber);
    display: none;
}

/* Workflow chain */
.gen-workflow-chain {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 20px 12px;
    padding: 9px 14px;
    background: rgba(99,102,241,.06);
    border: 1px solid rgba(99,102,241,.15);
    border-radius: var(--r);
    font-size: 12px;
}
.gen-workflow-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}
.gen-workflow-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Loading skeleton */
.skeleton {
    display: none;
    padding: 20px;
    flex-direction: column;
    gap: 12px;
}
.skeleton.active { display: flex; }
.skel-line {
    height: 14px;
    background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skeletonAnim 1.5s infinite;
}
@keyframes skeletonAnim {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Streaming state — spin-ring stays, skel-lines hide */
.skeleton.streaming {
    display: flex !important;
    padding: 8px 20px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    justify-content: center;
}
.skeleton.streaming .skel-line { display: none; }
/* "Generuji…" pulse animation */
@keyframes streamPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
/* Truncation warning */
.truncation-warning {
    display: none;
    margin: 12px 0 0;
    padding: 8px 12px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 12px;
    line-height: 1.5;
}
.truncation-warning.visible { display: block; }

/* ── LIBRARY ── */
.lib-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.lib-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.lib-search input { padding-left: 36px; }
.lib-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.mat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.mat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all var(--ease);
    position: relative;
}
.mat-card.bulk-selected { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(99,102,241,.25); }
.mat-card:hover {
    border-color: var(--border-med);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.mat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.mat-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(99,102,241,0.12);
    color: var(--indigo);
}

.mat-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
}

.mat-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mat-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.mat-action-primary {
    display: flex;
}
.mat-action-icons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ── REMIX (V2-T2.7 / V2-D1) ── */
.remix-field { outline: 2px solid rgba(99,102,241,.5); outline-offset: 2px; animation: remix-glow 2s ease-out forwards; }
@keyframes remix-glow { 0% { outline-color: rgba(99,102,241,.6); } 100% { outline-color: transparent; } }
.remix-notice { display: flex; align-items: center; gap: 8px; background: rgba(99,102,241,.07); border: 1px solid rgba(99,102,241,.2); border-radius: 6px; padding: 8px 12px; font-size: 12px; color: var(--indigo, #6366f1); margin-bottom: 12px; }
.remix-notice-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--indigo, #6366f1); font-size: 16px; line-height: 1; opacity: .6; padding: 0 0 0 8px; }
.remix-notice-close:hover { opacity: 1; }
/* ── ONBOARDING WIZARD (V3-T3.1) ── */
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .2s; }
.ob-dot--active { background: var(--indigo, #6366f1); }
.ob-quicklink { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: all .15s; }
.ob-quicklink:hover { background: rgba(99,102,241,.08); border-color: var(--indigo); color: var(--indigo); }

/* ── GENERATION FEEDBACK WIDGET (V2-D2) ── */
.gen-feedback-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9999; background: var(--surface2, #1e293b); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.2); animation: gf-slide .3s ease; }
@keyframes gf-slide { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.gf-text { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.gf-btn { font-size: 20px; background: none; border: none; cursor: pointer; padding: 2px 6px; line-height: 1; border-radius: 6px; transition: background .15s; }
.gf-btn:hover { background: var(--hover, rgba(255,255,255,.07)); }
.gf-close { margin-left: 4px; font-size: 18px; background: none; border: none; cursor: pointer; color: var(--text-muted); opacity: .5; padding: 0; line-height: 1; }
.gf-close:hover { opacity: 1; }

/* Knihovna v sidebaru — výsostné postavení */
.nav-item--highlight {
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(168,85,247,.06));
    border: 1px solid rgba(99,102,241,.18);
}
.nav-item--highlight:hover {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(168,85,247,.10));
    border-color: rgba(99,102,241,.3);
}
.nav-item--highlight .nav-icon { color: var(--indigo); }
.nav-item--highlight.active {
    background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(168,85,247,.15));
    border-color: var(--indigo);
}

/* Knihovna — typové barvy pro PDF/Word a sjednocený share state */
.mat-btn-pdf {
    color: #ef4444 !important;
    font-weight: 600;
    font-size: 11.5px;
    gap: 4px;
    padding: 5px 9px;
}
.mat-btn-pdf:hover { background: rgba(239,68,68,.08); color: #f87171 !important; }
.mat-btn-pdf svg { stroke: #ef4444; }
.mat-btn-word {
    color: #2b579a !important;
    font-weight: 600;
    font-size: 11.5px;
    gap: 4px;
    padding: 5px 9px;
}
.mat-btn-word:hover { background: rgba(43,87,154,.12); color: #4574c4 !important; }
.mat-btn-word svg { stroke: #2b579a; }
.mat-btn-share {
    transition: color .15s, box-shadow .15s, background .15s;
    border-radius: var(--r-lg);
}
.mat-btn-share.is-shared {
    color: var(--indigo);
    box-shadow: 0 0 0 1.5px var(--indigo);
}

/* TOP3 hover karta — fixed border state */
.top3-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .15s, background .15s;
}
.top3-card:hover {
    border-color: var(--indigo);
    background: rgba(99,102,241,.06);
}

/* ── DASHBOARD ── */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .dash-stats { grid-template-columns: 1fr; } }

.dash-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    /* minmax(0,…): dlouhý název materiálu (nowrap) jinak roztáhl sloupec mimo obrazovku. */
    .dash-bottom { grid-template-columns: minmax(0, 1fr); }
}
.dash-bottom > * { min-width: 0; }

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon.indigo { background: rgba(99,102,241,0.15); color: var(--indigo); }
.stat-icon.emerald { background: rgba(16,185,129,0.15); color: var(--emerald); }
.stat-icon.amber { background: rgba(245,158,11,0.15); color: var(--amber); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }

.stat-value {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.stat-milestone {
    font-size: 14px;
    line-height: 1;
    cursor: default;
    user-select: none;
}
.stat-ms-bar {
    margin-top: 6px;
    height: 3px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    overflow: hidden;
}
.stat-ms-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), #34d399);
    border-radius: 2px;
    transition: width .6s ease;
}

.dash-quickstart {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.qs-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.qs-card:hover {
    border-color: var(--indigo);
    background: rgba(99,102,241,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99,102,241,0.15);
}
.qs-emoji { font-size: 32px; }
.qs-icon  { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.qs-title { font-size: 13px; font-weight: 700; }

/* Sekce v dashboardu */
.qs-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Disabled qs-card (např. Digitalizátor bez Claude) */
.qs-card--disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}
.qs-badge-disabled {
    font-size: 10px;
    font-weight: 700;
    color: var(--amber);
    background: rgba(245,158,11,.12);
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: -4px;
}
/* Personas/externí AI badge */
.qs-badge-ext {
    font-size: 10px;
    font-weight: 700;
    color: var(--indigo);
    background: rgba(99,102,241,.12);
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: -4px;
}

/* Target audience badge (1.–5. ZŠ / 2. stupeň + SŠ) */
.qs-badge-audience {
    font-size: 10px;
    font-weight: 700;
    color: var(--emerald-text);
    background: rgba(16,185,129,.1);
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: -4px;
}

/* Tag chips — knihovna */
.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color .15s, color .15s;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tag-chip:hover {
    border-color: var(--indigo);
    color: var(--indigo);
}
.tag-chip--active {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}
.tag-chip__count {
    font-size: 10px;
    color: var(--text-dim);
    margin-left: 4px;
    flex-shrink: 0;
}
.tag-chip:hover .tag-chip__count { color: var(--indigo); }
.tag-chip--active .tag-chip__count { color: rgba(255,255,255,.7); }

/* Limit bar */
.limit-bar-wrap {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 16px;
    margin-bottom: 20px;
}
.limit-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.limit-bar-track {
    height: 6px;
    background: var(--surface3);
    border-radius: 3px;
    overflow: hidden;
}
.limit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--indigo), #8b5cf6);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.limit-bar-fill.warning { background: linear-gradient(90deg, var(--amber), #f97316); }
.limit-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #f97316); }

/* ── SETTINGS ── */
.settings-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.settings-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all var(--ease);
    display: flex;
    align-items: center;
    gap: 7px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

.settings-section { display: none; }
.settings-section.active { display: block; }

/* ── ALERTS / BANNERS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--r);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: var(--amber); }
.alert-info    { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.25); color: #a5b4fc; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: var(--emerald); }
.alert-danger  { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface2);
    border: 1px solid var(--border-med);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); padding: 4px; border-radius: var(--r-sm); transition: color var(--ease); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── TOAST ── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border-med);
    border-radius: var(--r-lg);
    padding: 12px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    max-width: 360px;
    min-width: 200px;
}
.toast.success { border-left: 3px solid var(--emerald); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--indigo); }
.toast.warning { border-left: 3px solid var(--amber); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-emoji { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── UPGRADE MODAL ── */
.upgrade-highlight {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: var(--r-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}
.upgrade-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--indigo);
    letter-spacing: -1px;
}
.upgrade-price span { font-size: 16px; font-weight: 500; color: var(--text-muted); }
.upgrade-features { list-style: none; text-align: left; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.upgrade-features li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.upgrade-features li::before { content: '✓'; color: var(--emerald); font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .dash-quickstart { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .generator-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    /* Nad tmavým překryvem (z-index 299) — jinak klepnutí na položku jen zavřelo menu. */
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); z-index: 300; }
    .main { margin-left: 0 !important; }
    .layout.collapsed .main { margin-left: 0; }
    .page-content { padding: 16px; }
    .dash-quickstart { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .qs-title { overflow-wrap: anywhere; hyphens: auto; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .mat-grid { grid-template-columns: 1fr; }
    .type-cards { grid-template-columns: repeat(2, 1fr); }
    .mobile-menu-btn { display: flex !important; }
    /* V menu na telefonu křížek místo „sbalit" (sbalení do pruhu ikon tu nemá smysl) */
    .sidebar-toggle { display: none; }
    .sidebar-close { display: flex; }
    .topbar { padding: 0 14px; gap: 10px; }
    .topbar-title { font-size: 15px; }
    .page-header { flex-wrap: wrap; gap: 10px; }
    .gen-panel-body { padding: 12px 14px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .gen-actions { flex-wrap: wrap; }
}

/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
}
.sidebar-overlay.open { display: block; }

/* ── Mobile hamburger (topbar) ── */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--r-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--ease);
}
.mobile-menu-btn:hover { color: var(--text); }

/* ── Form grid utility ── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ── Modal mobile ── */
@media (max-width: 600px) {
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; overflow-y: auto; }
}

/* ── INNER-PILL RADIO TOGGLES (dur-toggle, seg-ctrl, lang-toggle, mode-toggle) ── */
.dur-toggle,
.seg-ctrl,
.lang-toggle,
.mode-toggle {
    display: flex;
    background: var(--surface3);
    border: 1px solid var(--border-med);
    border-radius: var(--r);
    padding: 3px;
    gap: 3px;
}
.dur-toggle input,
.seg-ctrl input,
.lang-toggle input,
.mode-toggle input { display: none; }
.dur-toggle label,
.seg-ctrl label,
.lang-toggle label,
.mode-toggle label {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: var(--text-muted);
    border-radius: calc(var(--r) - 3px);
    user-select: none;
}
.dur-toggle label:hover,
.seg-ctrl label:hover,
.lang-toggle label:hover,
.mode-toggle label:hover { color: var(--text); background: var(--surface2); }
.dur-toggle input:checked + label,
.seg-ctrl input:checked + label,
.lang-toggle input:checked + label,
.mode-toggle input:checked + label { background: var(--accent); color: #fff; }
.dur-toggle input:checked + label:hover,
.seg-ctrl input:checked + label:hover,
.lang-toggle input:checked + label:hover,
.mode-toggle input:checked + label:hover { background: var(--accent); color: #fff; }

/* ── NAV GROUPS (sidebar collapsible) ── */
.nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--r);
    color: var(--text-muted);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all var(--ease);
    white-space: nowrap;
    position: relative;
    font-family: inherit;
    font-size: 14px;
}
.nav-group-header:hover { background: var(--card-hover); }
.nav-group-header:hover .nav-label { color: var(--text); }
.nav-group-header.has-active { background: rgba(99,102,241,0.08); }
.nav-group-header.has-active .nav-label { color: var(--accent-text); }

.nav-chevron {
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.45;
    transition: transform 0.2s ease, opacity var(--ease);
    display: flex;
    align-items: center;
}
.nav-group.open > .nav-group-header .nav-chevron { transform: rotate(180deg); opacity: 0.75; }

.nav-group-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}
.nav-group.open > .nav-group-items { max-height: 600px; }

.nav-item.nav-sub { padding-left: 20px; }
.nav-item.nav-sub .nav-label { font-size: 13px; }

.nav-item--disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Collapsed sidebar — hide groups fully */
.layout.collapsed .nav-chevron { opacity: 0; width: 0; overflow: hidden; }
.layout.collapsed .nav-group-items { max-height: 0 !important; }

/* Collapsed sidebar — group header tooltip */
.layout.collapsed .nav-group-header::after {
    content: attr(data-label);
    position: absolute;
    left: calc(var(--sidebar-coll) - 4px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface3);
    color: var(--text);
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--r);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    border: 1px solid var(--border-med);
    box-shadow: var(--shadow);
    z-index: 300;
    transition: opacity 0.1s;
}
.layout.collapsed .nav-group-header:hover::after { opacity: 1; }
html.theme-light .layout.collapsed .nav-group-header::after {
    background: #FFFFFF;
    color: rgba(15,23,42,0.90);
    border-color: rgba(15,23,42,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ── TOGGLE ROW (settings) ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-info { flex: 1; min-width: 0; }
.toggle-row-title { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-row-desc  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── LIGHT THEME ── */
html.theme-light {
    --danger-text: #b91c1c;    /* #fca5a5 je na světlém pozadí nečitelné */
    --surface:    #EFF1F5;
    --surface2:   #FFFFFF;
    --surface3:   #E4E7ED;
    --sidebar-bg: #1A2840;     /* sidebar stays dark navy in light mode */

    --text:       rgba(15,23,42,0.90);
    /* Plné barvy místo průhledné černé: 50 % mělo na šedém pozadí kontrast ~3,3 : 1 (pod WCAG AA). */
    --text-muted: #475569;
    --text-dim:   #64748b;
    --emerald-text: #047857;
    --accent-text:  #4338ca;

    --border:     rgba(15,23,42,0.09);
    --border-med: rgba(15,23,42,0.15);
    --card:       rgba(15,23,42,0.03);
    --card-hover: rgba(15,23,42,0.06);

    --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
    --shadow:     0 4px 20px rgba(0,0,0,0.09);
    --shadow-lg:  0 8px 40px rgba(0,0,0,0.13);
}

/* Sidebar stays dark in light mode — override back to dark values */
html.theme-light .sidebar {
    --accent-text: #a5b4fc;    /* sidebar zůstává tmavý */
    --text-muted: rgba(255,255,255,0.45);
    --border:     rgba(255,255,255,0.07);
    --card-hover: rgba(255,255,255,0.06);
}
html.theme-light .nav-label { color: rgba(255,255,255,0.75); }
html.theme-light .nav-item:hover .nav-label { color: #fff; }
html.theme-light .sidebar-logo-text { color: #fff; }

/* Topbar in light mode */
html.theme-light .topbar { background: #EFF1F5; }

/* Barevné hlášky: světlé odstíny pro tmavé pozadí jsou na světlém nečitelné */
html.theme-light .alert-info    { color: #3730a3; }
html.theme-light .alert-success { color: #065f46; }

/* Form inputs in light mode */
html.theme-light .form-control,
html.theme-light .form-select,
html.theme-light .form-textarea {
    background-color: #FFFFFF;   /* ne `background` — ta by smazala šipku výběru (background-image) */
    color: rgba(15,23,42,0.90);
    border-color: rgba(15,23,42,0.15);
}
html.theme-light .form-control::placeholder { color: rgba(15,23,42,0.30); }

/* Tooltip overlay in light mode */
html.theme-light .layout.collapsed .nav-item::after {
    background: #FFFFFF;
    color: rgba(15,23,42,0.90);
    border-color: rgba(15,23,42,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ═══════════════════════════════════════════════════════════════════════
   GEN2 — UNIFIED TWO-COLUMN GENERATOR LAYOUT
   (Replaces all per-file inline CSS across generator pages)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Layout grid ── */
.page-content { padding: 20px 24px; }
.gen-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; }
.gen-layout.w380 { grid-template-columns: 380px 1fr; }
.gen-layout.w340 { grid-template-columns: 340px 1fr; }
.gen-layout.align-start { align-items: start; }

/* gen-panel / gen-panel-header already defined above; extend gen-panel-body */
.gen-panel-body { max-height: calc(100vh - 120px); }

/* ── Form helpers ── */
.panel-divider { height: 1px; background: var(--border); margin: 14px 0; }

.collapse-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--r-sm, 6px);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: color .15s, border-color .15s;
}
.collapse-toggle:hover { color: var(--text); border-color: var(--indigo); }
.collapse-toggle .ct-arrow { margin-left: auto; transition: transform .2s; }
.collapse-toggle.open .ct-arrow { transform: rotate(90deg); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.form-row > * { margin-bottom: 0; }


/* ── Letter selector (vyjmenovaná slova) ── */
.letter-group { display: flex; flex-wrap: wrap; gap: 5px; }
.letter-input { display: none; }
.letter-label { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text-muted); font-size: 0.92rem; font-weight: 700; cursor: pointer; transition: all 0.15s; user-select: none; }
.letter-label:hover { border-color: var(--border-med); color: var(--text); }
.letter-input:checked + .letter-label { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* ── Spin ring (loading animation) ── */
.spin-ring { width: 48px; height: 48px; border: 3px solid rgba(99,102,241,0.2); border-top-color: #6366f1; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.gen-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; gap: 12px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.gen-empty-icon { opacity: 0.25; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.gen-empty-icon svg { width: 48px; height: 48px; }
.gen-empty h3 { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin: 0; }
.gen-empty p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; max-width: 320px; }

/* ── Loading state ── */
.gen-loading { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; gap: 14px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.gen-loading.show { display: flex; }

/* ── Action buttons bar ── */
/* Context: panel footer (big generator pages) */
.gen-panel > .gen-actions { padding: 12px 20px; border-top: 1px solid var(--border); }
/* Context: inline in result area */
.gen-panel-body .gen-actions { margin-bottom: 16px; border-top: none; padding: 0; }
.gen-actions .btn { padding: 8px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; font-family: inherit; text-decoration: none; }
.gen-actions .btn:hover { border-color: var(--accent); color: var(--accent-text); }
.gen-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.gen-actions .btn.primary:hover { opacity: 0.9; }
.gen-actions .btn.green { background: var(--emerald2); border-color: var(--emerald2); color: #fff; }
.gen-actions .btn.green:hover { opacity: 0.9; }
/* Uložit (btn-success z renderActionBar) je hlavní akce — obecné .gen-actions .btn ho zešedilo */
.gen-actions .btn.btn-success { background: var(--emerald2); border-color: var(--emerald2); color: #fff; }
.gen-actions .btn.btn-success:hover { opacity: 0.9; color: #fff; }
/* Potvrzení po uložení (app.js naucmeUlozeno) */
.gen-actions .btn.btn-saved { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.35); color: var(--emerald-text); }
/* #saveBtn má i btn-success — bez tohohle by hover dal bílý text na světle zelené */
.gen-actions .btn.btn-saved:hover { opacity: 1; color: var(--emerald-text); }
.gen-actions .btn.chatgpt { background: #10a37f; border-color: #10a37f; color: #fff; }
.gen-actions .btn.chatgpt:hover { opacity: 0.9; }
.gen-actions .btn.gemini { background: #4285f4; border-color: #4285f4; color: #fff; }
.gen-actions .btn.gemini:hover { opacity: 0.9; }
.gen-actions .btn.claude-btn { background: #d97706; border-color: #d97706; color: #fff; }
.gen-actions .btn.claude-btn:hover { opacity: 0.9; }

/* ── Result header ── */
.gen-result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.gen-result-title { font-size: 1.06rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.gen-badges { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.gen-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; background: rgba(59,130,246,0.12); color: #93c5fd; font-size: 0.73rem; font-weight: 700; }

/* ── Result section blocks ── */
.gen-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.gen-section-hdr { padding: 10px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.84rem; display: flex; align-items: center; gap: 8px; }
.gen-section-body { padding: 16px; font-size: 0.9rem; line-height: 1.9; color: var(--text); white-space: pre-wrap; font-family: inherit; }
.gen-section.success { border-color: rgba(16,185,129,0.3); }
.gen-section.success .gen-section-hdr { background: rgba(16,185,129,0.07); color: #34d399; border-bottom-color: rgba(16,185,129,0.2); }
.gen-section.warning { border-color: rgba(245,158,11,0.3); }
.gen-section.warning .gen-section-hdr { background: rgba(245,158,11,0.07); color: #fbbf24; border-bottom-color: rgba(245,158,11,0.2); }

/* ── Intro card ── */
.gen-intro-card { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08)); border: 1px solid rgba(99,102,241,0.3); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.gen-intro-card h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0 0 8px; }
.gen-intro-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* ── Tip box (empty state hint) ── */
.gen-tip-box { background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.2); border-radius: 10px; padding: 12px 16px; font-size: 0.8rem; color: var(--text-muted); text-align: left; max-width: 360px; line-height: 1.7; }
.gen-tip-box strong { color: var(--text); display: block; margin-bottom: 6px; }

/* ── Print ── */
@media print {
    .gen-output-text.paper { box-shadow: none; padding: 0; max-width: none; border: none; }
    .gen-layout .gen-panel:first-child,
    .gen-actions, .gen-loading, .gen-empty { display: none !important; }
    .gen-layout { grid-template-columns: 1fr; }
    .gen-panel { border: none; }
    .gen-panel-header { display: none; }
    .gen-panel-body { max-height: none !important; overflow: visible !important; padding: 0; }
    .page-content { padding: 0 !important; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .gen-layout,
    .gen-layout.w380,
    .gen-layout.w340 { grid-template-columns: 1fr; }
    .gen-panel-body { max-height: none; }
}

/* ─────────────────────────────────────────────────────────────────────────
   PAGE-SPECIFIC CSS (moved from inline PHP styles to this shared file)
   ───────────────────────────────────────────────────────────────────────── */

/* ── AFTERSCHOOL ── */
.as-activities { display: flex; flex-direction: column; gap: 12px; }
.as-act { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.as-act-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.as-act-num { width: 32px; height: 32px; border-radius: 50%; background: rgba(99,102,241,0.15); color: #818cf8; font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.as-act-emoji { font-size: 1.3rem; flex-shrink: 0; }
.as-act-title { font-weight: 700; font-size: 0.92rem; color: var(--text); flex: 1; }
.as-act-meta { display: flex; gap: 10px; flex-shrink: 0; }
.as-act-tag { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 50px; background: rgba(99,102,241,0.1); color: #818cf8; }
.as-act-tag.green { background: rgba(16,185,129,0.1); color: #10b981; }
.as-act-toggle { font-size: 0.7rem; color: var(--text-muted); transition: transform 0.2s; margin-left: 4px; }
.as-act-head.open .as-act-toggle { transform: rotate(180deg); }
.as-act-body { padding: 14px 16px; display: none; }
.as-act-body.open { display: block; }
.as-act-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.as-act-steps { margin: 0 0 12px 0; padding-left: 20px; }
.as-act-steps li { font-size: 0.84rem; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.as-act-equip { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.as-act-tip { font-size: 0.8rem; padding: 8px 12px; background: rgba(245,158,11,0.1); border-left: 3px solid #fbbf24; border-radius: 4px; color: #fbbf24; line-height: 1.5; margin-bottom: 6px; }
.as-act-tip::before { content: "💡 Tip: "; font-weight: 700; }
.as-act-var { font-size: 0.8rem; padding: 8px 12px; background: rgba(99,102,241,0.08); border-left: 3px solid #6366f1; border-radius: 4px; color: #818cf8; line-height: 1.5; }
.as-act-var::before { content: "🔄 Varianta: "; font-weight: 700; }
.as-teacher-note { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; margin-top: 12px; }
.as-teacher-note strong { color: var(--text); }
@media print { .gen-layout .as-act-body { display: block !important; } }

/* ── COMMSSHIELD ── */
.cs-email-card { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 600px; margin-bottom: 16px; }
.cs-email-subject { font-size: 1rem; font-weight: 700; color: #818cf8; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.cs-email-subject-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.cs-email-body { font-size: 0.92rem; line-height: 1.8; color: var(--text); white-space: pre-wrap; margin-bottom: 16px; }
.cs-email-closing { font-size: 0.88rem; font-style: italic; color: var(--text-muted); white-space: pre-wrap; }
.cs-ai-note { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.35); border-radius: 10px; padding: 12px 16px; font-size: 0.82rem; color: var(--text); line-height: 1.6; max-width: 600px; }
.cs-ai-note-label { font-weight: 700; color: #f59e0b; margin-bottom: 4px; font-size: 0.8rem; }

/* ── CROSSCURR ── */
.cc-project-header { background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.08)); border: 1px solid rgba(99,102,241,0.3); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.cc-project-title { font-size: 1.2rem; font-weight: 800; color: var(--text); margin: 0 0 10px; }
.cc-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.cc-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.76rem; font-weight: 700; background: rgba(255,255,255,0.07); border: 1px solid var(--border); color: var(--text-muted); }
.cc-goals { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.cc-goals li { display: flex; align-items: flex-start; gap: 7px; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.cc-goals li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6366f1; flex-shrink: 0; margin-top: 6px; }
.cc-phases { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cc-phase { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.cc-phase-head { padding: 11px 16px; font-weight: 800; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.cc-phase-body { padding: 14px 16px; background: var(--card); }
.cc-phase-activities { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 5px; }
.cc-phase-activities li { display: flex; align-items: flex-start; gap: 7px; font-size: 0.85rem; color: var(--text); line-height: 1.5; }
.cc-phase-activities li::before { content: "→"; flex-shrink: 0; color: inherit; opacity: 0.5; font-size: 0.8rem; margin-top: 1px; }
.cc-phase-role { font-size: 0.78rem; color: var(--text-muted); font-style: italic; padding: 6px 10px; background: rgba(255,255,255,0.03); border-radius: 6px; border-left: 2px solid var(--border); }
.cc-phase.indigo .cc-phase-head { background: rgba(99,102,241,0.15); color: #818cf8; }
.cc-phase.indigo .cc-phase-activities li::before { color: #6366f1; }
.cc-phase.emerald .cc-phase-head { background: rgba(16,185,129,0.12); color: #34d399; }
.cc-phase.emerald .cc-phase-activities li::before { color: #10b981; }
.cc-phase.amber .cc-phase-head { background: rgba(245,158,11,0.12); color: #fbbf24; }
.cc-phase.amber .cc-phase-activities li::before { color: #f59e0b; }
.cc-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.cc-card-title { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.cc-card-body { font-size: 0.88rem; color: var(--text); line-height: 1.65; }
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-tag { padding: 4px 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 20px; font-size: 0.78rem; color: var(--text-muted); }
.cc-tips-card { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.25); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.cc-tips-card .cc-card-title { color: #f59e0b; }

/* ── DEBATECLUB ── */
.db-rules { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.db-rules h4 { font-size: 0.85rem; font-weight: 700; color: var(--text); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.db-rules ol { margin: 0; padding-left: 18px; }
.db-rules li { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 4px; }
.db-sides { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.db-side { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.db-side-head { padding: 12px 14px; font-weight: 700; font-size: 0.9rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.db-side-body { background: var(--card); padding: 14px; }
.db-side-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 10px; }
.db-side-args { list-style: none; margin: 0; padding: 0; }
.db-side-args li { font-size: 0.83rem; color: var(--text); line-height: 1.55; padding: 4px 0 4px 18px; border-bottom: 1px solid var(--border); position: relative; }
.db-side-args li::before { content: "▸"; position: absolute; left: 2px; color: #818cf8; font-size: 0.75rem; }
.db-side-args li:last-child { border-bottom: none; }
.db-opening { margin-top: 10px; padding: 8px 12px; background: rgba(99,102,241,0.1); border-radius: 8px; font-size: 0.82rem; color: #818cf8; font-style: italic; line-height: 1.5; }
.db-questions { background: var(--card); border: 1px solid rgba(245,158,11,0.25); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.db-questions h4 { font-size: 0.85rem; font-weight: 700; color: #fbbf24; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.db-questions ol { margin: 0; padding-left: 18px; }
.db-questions li { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 6px; }
.db-criteria { margin-bottom: 16px; }
.db-criteria h4 { font-size: 0.85rem; font-weight: 700; color: var(--text); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.db-crit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.db-crit-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.db-crit-name { font-weight: 700; font-size: 0.85rem; color: var(--text); margin-bottom: 4px; }
.db-crit-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 6px; }
.db-crit-pts { font-size: 0.75rem; font-weight: 700; color: #10b981; }
.db-reflection { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.db-reflection h4 { font-size: 0.85rem; font-weight: 700; color: #10b981; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.db-reflection ul { margin: 0; padding-left: 18px; }
.db-reflection li { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 5px; }
.db-notes { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; }
.db-notes strong { color: var(--text); }
.side-col-0 { background: #6366f1; }
.side-col-1 { background: #ef4444; }
.side-col-2 { background: #10b981; }
.side-col-3 { background: #f59e0b; }
@media print { .db-side-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 900px) { .db-sides { grid-template-columns: 1fr; } }

/* ── DIFFERENTIATOR ── */
.variant-cards { display: flex; flex-direction: column; gap: 6px; }
.variant-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.variant-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.variant-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.variant-item.locked { opacity: 0.4; cursor: not-allowed; }
.variant-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.variant-name { font-size: 0.85rem; font-weight: 600; color: var(--text); flex: 1; }
.variant-desc { font-size: 0.75rem; color: var(--text-muted); }
.upgrade-nudge { font-size: 0.75rem; color: #fbbf24; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); border-radius: 7px; padding: 7px 10px; margin-top: 8px; }
.upgrade-nudge a { color: #fbbf24; font-weight: 700; text-decoration: underline; }
.read-toggle { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.read-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.read-toggle-text { flex: 1; }
.read-toggle-title { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.read-toggle-sub { font-size: 0.74rem; color: var(--text-muted); }
.diff-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.diff-tab { padding: 10px 16px; font-size: 0.83rem; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all 0.15s; white-space: nowrap; font-family: inherit; }
.diff-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.diff-tab:hover:not(.active) { color: var(--text); }
.diff-tab .tab-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.diff-content { padding: 18px 20px; }
.variant-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.variant-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.76rem; font-weight: 700; }
.variant-actions { display: flex; gap: 6px; }
.variant-text { font-size: 0.92rem; line-height: 1.75; color: var(--text); white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.variant-text.reading-friendly { font-size: 1.05rem; line-height: 2; letter-spacing: 0.02em; font-family: Georgia, serif; background: #fff9f0; color: #1a1a1a; border-color: #f0d9a0; }
/* Podle vzhledu aplikace, ne podle systému — světlý režim aplikace na tmavém systému dával tmavý blok. */
html:not(.theme-light) .variant-text.reading-friendly { background: #1a1810; color: #f0e8d0; border-color: #6b5830; }
.save-all-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.2); border-radius: 10px; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.save-all-bar p { font-size: 0.84rem; color: var(--text-muted); margin: 0; }
.save-all-bar .btn-save-all { padding: 7px 14px; border-radius: 8px; background: var(--emerald2); color: #fff; font-size: 0.82rem; font-weight: 700; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; font-family: inherit; }
.save-all-bar .btn-save-all:hover { opacity: 0.9; }

/* ── DIGITALIZE ── */
.dg-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 24px 16px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--input-bg); position: relative; }
.dg-upload-area:hover, .dg-upload-area.dragover { border-color: var(--primary); background: rgba(99,102,241,0.06); }
.dg-upload-area.has-file { border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.04); }
.dg-upload-icon { color: var(--text-muted); margin-bottom: 8px; }
.dg-upload-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.dg-upload-text strong { color: var(--text); display: block; margin-bottom: 3px; }
.dg-upload-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }
.dg-preview-wrap { position: relative; }
.dg-preview-img { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: contain; display: block; margin: 0 auto; }
.dg-preview-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.85); border: none; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.dg-file-name { font-size: 0.8rem; color: #34d399; font-weight: 600; margin-top: 6px; }
.dg-doc-preview { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; }
.dg-doc-title { font-size: 1.2rem; font-weight: 800; color: var(--text); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.dg-section { margin-bottom: 14px; }
.dg-heading { font-size: 1rem; font-weight: 800; color: var(--text); margin: 14px 0 6px; }
.dg-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }
.dg-question { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: rgba(255,255,255,0.02); }
.dg-question-num { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.dg-question-text { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 6px; }
.dg-answer-short { border-bottom: 1px dashed var(--border); height: 22px; margin-top: 6px; }
.dg-answer-long { border-bottom: 1px dashed var(--border); height: 60px; margin-top: 6px; }
.dg-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.dg-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dg-table th { padding: 7px 10px; background: rgba(99,102,241,0.12); border: 1px solid var(--border); font-weight: 700; color: var(--text); text-align: left; }
.dg-table td { padding: 7px 10px; border: 1px solid var(--border); color: var(--text-muted); }
.dg-extract-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; padding: 8px 12px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2); border-radius: 8px; }
.dg-extract-note strong { color: #f59e0b; }

/* ── ESCAPROOM ── */
.er-story-card { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08)); border: 1px solid rgba(99,102,241,0.3); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.er-story-card .er-story-icon { font-size: 1.5rem; margin-bottom: 8px; }
.er-story-card h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 0 0 8px; }
.er-story-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.er-stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.er-station { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.er-station-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.er-station-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.82rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.er-station-title { font-weight: 700; font-size: 0.9rem; color: var(--text); flex: 1; }
.er-station-body { padding: 14px; }
.er-station-challenge { font-size: 0.87rem; color: var(--text); line-height: 1.6; margin-bottom: 10px; }
.er-station-hint { font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-bottom: 10px; padding: 8px 10px; background: rgba(250,204,21,0.1); border-left: 3px solid #fbbf24; border-radius: 4px; }
.er-station-hint::before { content: "💡 Nápověda: "; font-style: normal; font-weight: 700; }
.er-answer-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 8px 10px; background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); border-radius: 8px; font-size: 0.8rem; font-weight: 700; color: #10b981; user-select: none; }
.er-answer-toggle .toggle-icon { font-size: 0.7rem; transition: transform 0.2s; }
.er-answer-code { display: none; margin-top: 8px; padding: 10px 12px; background: rgba(16,185,129,0.1); border-radius: 8px; font-size: 0.95rem; font-weight: 800; color: #10b981; letter-spacing: 2px; text-align: center; font-family: monospace; }
.er-answer-expl { display: none; margin-top: 6px; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.er-final-card { background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08)); border: 1px solid rgba(16,185,129,0.3); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.er-final-card h4 { font-size: 0.95rem; font-weight: 800; color: var(--text); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.er-final-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 10px; }
.er-final-code { font-size: 1.1rem; font-weight: 800; color: #10b981; letter-spacing: 3px; font-family: monospace; padding: 8px 14px; background: rgba(16,185,129,0.1); border-radius: 8px; display: inline-block; cursor: pointer; }
.er-teacher-key { background: var(--card); border: 2px solid #f59e0b; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.er-teacher-key-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(245,158,11,0.1); cursor: pointer; user-select: none; }
.er-teacher-key-head h4 { margin: 0; font-size: 0.9rem; font-weight: 800; color: #f59e0b; display: flex; align-items: center; gap: 8px; }
.er-teacher-key-body { padding: 16px; display: none; }
.er-teacher-key-body.open { display: block; }
.er-key-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.er-key-row:last-child { border-bottom: none; }
.er-key-num { width: 24px; height: 24px; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 0.75rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.er-key-content { flex: 1; }
.er-key-title { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.er-key-answer { font-size: 0.92rem; font-weight: 800; color: #10b981; font-family: monospace; letter-spacing: 1px; }
.er-key-expl { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.er-key-final { margin-top: 12px; padding-top: 12px; border-top: 2px solid #f59e0b; }
.er-key-final .er-key-answer { font-size: 1.1rem; letter-spacing: 3px; }
.er-notes-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; }
.er-notes-card strong { color: var(--text); }
@media print { .er-station { break-inside: avoid; border: 1px solid #ccc; } .er-teacher-key { display: none !important; } }
@media (max-width: 900px) { .er-stations { grid-template-columns: 1fr; } }

/* ── FAKESOCIAL ── */
.fs-disclaimer { background: #fef2f2; border: 2px solid #fca5a5; border-radius: 10px; padding: 10px 16px; font-size: 0.82rem; font-weight: 700; color: #dc2626; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.ig-widget { background: #fff; border: 1px solid #dbdbdb; border-radius: 12px; max-width: 470px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; color: #262626; }
.ig-header { display: flex; align-items: center; padding: 10px 14px; gap: 10px; }
.ig-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0; }
.ig-username { font-weight: 700; font-size: 0.88rem; color: #262626; }
.ig-more { margin-left: auto; font-size: 1.2rem; color: #8e8e8e; cursor: pointer; }
.ig-image-wrap { width: 100%; min-height: 200px; background: #f0f0f0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ig-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: none; }
.ig-image-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #8e8e8e; padding: 40px 20px; text-align: center; font-size: 0.78rem; }
.ig-actions { display: flex; align-items: center; gap: 14px; padding: 10px 14px 4px; font-size: 1.3rem; }
.ig-likes { font-size: 0.85rem; font-weight: 700; padding: 0 14px 6px; color: #262626; }
.ig-caption { font-size: 0.85rem; padding: 0 14px 8px; line-height: 1.5; color: #262626; }
.ig-caption strong { font-weight: 700; }
.ig-comment { font-size: 0.82rem; padding: 2px 14px; color: #262626; line-height: 1.4; }
.ig-comment span.un { font-weight: 700; margin-right: 4px; }
.ig-comment-likes { font-size: 0.72rem; color: #8e8e8e; margin-left: 8px; }
.ig-timestamp { font-size: 0.7rem; color: #8e8e8e; padding: 8px 14px 14px; text-transform: uppercase; letter-spacing: 0.3px; }
.wa-widget { background: #e5ddd5; border-radius: 12px; max-width: 400px; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.wa-header { background: #075e54; color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.wa-header-avatar { width: 36px; height: 36px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.wa-header-name { font-weight: 700; font-size: 0.9rem; }
.wa-header-status { font-size: 0.72rem; opacity: 0.8; }
.wa-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: #e5ddd5; }
.wa-bubble { max-width: 80%; padding: 7px 10px; border-radius: 8px; font-size: 0.84rem; line-height: 1.45; position: relative; color: #111; }
.wa-bubble.sent { background: #dcf8c6; align-self: flex-end; border-bottom-right-radius: 2px; }
.wa-bubble.recv { background: #fff; align-self: flex-start; border-bottom-left-radius: 2px; }
.wa-bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; font-size: 0.68rem; color: #92a5a3; }
.wa-checks { color: #53bdeb; }
.fb-widget { background: #fff; border: 1px solid #ddd; border-radius: 12px; max-width: 500px; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif; color: #1c1e21; }
.fb-topbar { background: #1877f2; padding: 9px 16px; display: flex; align-items: center; gap: 6px; color: #fff; }
.fb-topbar-f { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.fb-topbar-label { font-weight: 700; font-size: 0.92rem; }
.fb-cover { width: 100%; height: 110px; background: linear-gradient(135deg, #1877f2 0%, #42b0ff 100%); flex-shrink: 0; }
.fb-profile-row { display: flex; align-items: flex-end; gap: 10px; padding: 0 14px 12px; background: #fff; border-bottom: 1px solid #e5e7eb; margin-top: -28px; }
.fb-profile-avatar { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; color: #fff; flex-shrink: 0; }
.fb-profile-name { font-weight: 700; font-size: 0.95rem; color: #1c1e21; margin-bottom: 1px; }
.fb-profile-bio { font-size: 0.75rem; color: #65676b; }
.fb-post { padding: 12px 14px; border-bottom: 1px solid #e5e7eb; }
.fb-post:last-child { border-bottom: none; }
.fb-post-header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.fb-post-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.82rem; color: #fff; flex-shrink: 0; }
.fb-post-name { font-weight: 700; font-size: 0.85rem; color: #1c1e21; }
.fb-post-time { font-size: 0.7rem; color: #65676b; }
.fb-post-text { font-size: 0.88rem; color: #1c1e21; line-height: 1.55; margin-bottom: 9px; }
.fb-post-stats { display: flex; align-items: center; gap: 12px; font-size: 0.76rem; color: #65676b; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; margin-bottom: 8px; }
.fb-post-comments { display: flex; flex-direction: column; gap: 5px; }
.fb-comment { display: flex; gap: 6px; align-items: flex-start; }
.fb-comment-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.fb-comment.positive .fb-comment-avatar { background: linear-gradient(135deg, #16a34a, #22c55e); }
.fb-comment.negative .fb-comment-avatar { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.fb-comment-bubble { background: #f0f2f5; border-radius: 12px; padding: 5px 10px; }
.fb-comment-name { font-weight: 700; font-size: 0.73rem; color: #1c1e21; }
.fb-comment-text { font-size: 0.8rem; color: #1c1e21; line-height: 1.4; }
.disc-widget { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; max-width: 560px; overflow: hidden; font-family: Roboto, Arial, sans-serif; }
.disc-video-bar { background: #f9f9f9; padding: 12px 16px; border-bottom: 1px solid #e0e0e0; }
.disc-video-title { font-size: 0.88rem; font-weight: 500; color: #0f0f0f; }
.disc-comments-label { font-size: 0.82rem; color: #606060; margin-top: 4px; }
.disc-comment { padding: 12px 16px; display: flex; gap: 10px; border-bottom: 1px solid #f0f0f0; }
.disc-comment:last-child { border-bottom: none; }
.disc-comment.reply { padding-left: 56px; }
.disc-comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #ff6b6b, #ffa500); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.disc-comment.reply .disc-comment-avatar { width: 24px; height: 24px; font-size: 0.65rem; }
.disc-comment-body { flex: 1; }
.disc-comment-username { font-size: 0.8rem; font-weight: 500; color: #0f0f0f; margin-bottom: 3px; }
.disc-comment-time { font-size: 0.72rem; color: #606060; margin-left: 8px; font-weight: 400; }
.disc-comment-text { font-size: 0.85rem; color: #0f0f0f; line-height: 1.5; margin-bottom: 6px; }
.disc-comment-actions { display: flex; align-items: center; gap: 12px; font-size: 0.75rem; color: #606060; }
.disc-comment-likes { display: flex; align-items: center; gap: 3px; }
@media print {
    .fs-disclaimer { display: flex !important; background: #fef2f2 !important; color: #dc2626 !important; border: 2px solid #fca5a5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ig-widget, .wa-widget, .fb-widget, .disc-widget { max-width: 100%; }
    .fb-topbar, .fb-cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .wa-bubble.sent { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── FLASHCARDS ── */
.fc-canvas { background: var(--card); border: 1px solid var(--border); border-radius: 14px; min-height: 500px; display: flex; flex-direction: column; }
.fc-canvas-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-canvas-title { font-weight: 700; font-size: 0.9rem; flex: 1; }
.fc-canvas-body { padding: 20px; flex: 1; }
.fc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 340px; color: var(--text-muted); text-align: center; }
.fc-empty-icon { opacity: 0.25; }
.fc-empty h3 { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.fc-empty p { font-size: 0.85rem; max-width: 300px; line-height: 1.6; }
.fc-stats { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.fc-stat { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.fc-stat strong { color: var(--text); font-weight: 700; }
.fc-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.fc-cat { padding: 4px 10px; border-radius: 20px; font-size: 0.76rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); color: var(--text-muted); background: none; transition: all 0.15s; }
.fc-cat:hover { border-color: rgba(99,102,241,0.5); color: var(--text); }
.fc-cat.active { background: rgba(99,102,241,0.15); border-color: var(--indigo); color: #a5b4fc; }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.count-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.count-pill { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 5px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.count-pill:hover { border-color: var(--accent); color: var(--text); }
.count-pill.active { border-color: transparent; background: var(--accent); color: #fff; }
.count-pill--ai { border-style: dashed; background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(168,85,247,.08)); }
.count-pill--ai.active { background: linear-gradient(135deg, var(--indigo), #a855f7); color: #fff; border-style: solid; }
/* chip-input — pro fakesocial protagonisty a podobné */
.chip-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); min-height: 38px; cursor: text; align-items: center; }
.chip-input-wrap:focus-within { border-color: var(--indigo); }
.chip-item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: var(--indigo); color: #fff; border-radius: 14px; font-size: 12px; font-weight: 600; }
.chip-remove { background: none; border: 0; color: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.chip-remove:hover { opacity: 0.7; }
.chip-input-field { flex: 1; min-width: 80px; background: transparent; border: 0; outline: none; color: var(--text); font-size: 13px; padding: 4px 0; }
/* grade-scale: červená→zelená gradient při hover na jednotlivých tlačítkách */
.grade-scale-pills .grade-pill:nth-child(1).active { background: #22c55e; }
.grade-scale-pills .grade-pill:nth-child(2).active { background: #84cc16; }
.grade-scale-pills .grade-pill:nth-child(3).active { background: #f59e0b; }
.grade-scale-pills .grade-pill:nth-child(4).active { background: #f97316; }
.grade-scale-pills .grade-pill:nth-child(5).active { background: #ef4444; }
.grade-scale-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.fc-card-wrap { perspective: 900px; height: 170px; cursor: pointer; }
.fc-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(0.4,0,0.2,1); }
.fc-card-wrap:hover .fc-card-front { border-color: rgba(99,102,241,0.4); }
.fc-card-wrap.flipped .fc-card { transform: rotateY(180deg); }
.fc-card-front, .fc-card-back { position: absolute; inset: 0; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 12px; padding: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; overflow: hidden; }
.fc-card-back { transform: rotateY(180deg); background: rgba(99,102,241,0.07); border-color: rgba(99,102,241,0.2); }
.fc-card-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.fc-card-text { font-size: 0.85rem; line-height: 1.5; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.fc-card-front .fc-card-text { font-weight: 600; color: var(--text); }
.fc-card-back .fc-card-text { color: #c7d2fe; }
.fc-card-hint { font-size: 0.7rem; color: var(--text-dim); margin-top: auto; padding-top: 6px; text-align: center; }
.fc-card-num { position: absolute; top: 8px; right: 10px; font-size: 0.68rem; color: var(--text-dim); font-weight: 600; }
.fc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-emerald { background: linear-gradient(135deg, var(--emerald), var(--emerald2)); color: #fff; }
.btn-emerald:hover { opacity: 0.88; }
.btn-amber { background: linear-gradient(135deg, var(--amber), #d97706); color: #fff; }
.btn-amber:hover { opacity: 0.88; }
.fc-saved { margin-top: 20px; }
.fc-saved-header { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.fc-saved-list { display: flex; flex-direction: column; gap: 8px; }
.fc-saved-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.15s; cursor: pointer; }
.fc-saved-item:hover { border-color: rgba(99,102,241,0.35); }
.fc-saved-item-info { flex: 1; min-width: 0; }
.fc-saved-item-title { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-saved-item-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.fc-saved-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fc-generating { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; height: 300px; }
.fc-gen-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--indigo); border-radius: 50%; animation: spin 0.8s linear infinite; }
.fc-gen-label { font-size: 0.9rem; color: var(--text-muted); }
.fc-study-mode { display: none; }
.fc-study-mode.active { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 20px; }
.fc-study-card-wrap { perspective: 1000px; width: 420px; height: 280px; cursor: pointer; }
.fc-study-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.fc-study-card-wrap.flipped .fc-study-card { transform: rotateY(180deg); }
.fc-study-front, .fc-study-back { position: absolute; inset: 0; background: rgba(255,255,255,0.06); border: 1px solid var(--border-med); border-radius: 18px; padding: 28px 32px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.fc-study-back { transform: rotateY(180deg); background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); }
.fc-study-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.fc-study-text { font-size: 1.05rem; font-weight: 600; line-height: 1.55; color: var(--text); }
.fc-study-back .fc-study-text { color: #c7d2fe; font-weight: 400; font-size: 0.95rem; }
.fc-study-nav { display: flex; align-items: center; gap: 14px; }
.fc-study-progress { font-size: 0.9rem; color: var(--text-muted); }
.fc-study-progress strong { color: var(--text); }
.fc-loader { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@media (max-width: 900px) { .fc-study-card-wrap { width: 100%; max-width: 400px; } }

/* ── MISCONCEPTIONS ── */
.mc-section-title { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.mc-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.mc-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mc-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.mc-severity-badge { padding: 3px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.mc-severity-badge.high { background: #ef4444; }
.mc-severity-badge.medium { background: #f59e0b; }
.mc-severity-badge.low { background: #eab308; color: #1e1e2e; }
.mc-card-title { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.mc-card-body { padding: 12px 14px; }
.mc-card-desc { font-size: 0.84rem; color: var(--text); line-height: 1.6; margin-bottom: 10px; }
.mc-card-address { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; color: var(--text); line-height: 1.5; }
.mc-card-address-label { font-size: 0.72rem; font-weight: 700; color: #10b981; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.mc-cognitive-card { background: var(--card); border: 2px solid rgba(245,158,11,0.4); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.mc-cognitive-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mc-cog-level-badge { padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.mc-cog-level-badge.low { background: #22c55e; }
.mc-cog-level-badge.medium { background: #f59e0b; color: #1e1e2e; }
.mc-cog-level-badge.high { background: #ef4444; }
.mc-cognitive-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.mc-cog-issues { list-style: none; padding: 0; margin: 0 0 12px 0; }
.mc-cog-issues li { font-size: 0.84rem; color: var(--text); line-height: 1.6; padding: 4px 0 4px 16px; position: relative; }
.mc-cog-issues li::before { content: "•"; position: absolute; left: 0; color: #f59e0b; }
.mc-cog-simplified { margin-top: 10px; }
.mc-cog-simplified-title { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.mc-simp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; font-size: 0.8rem; }
.mc-simp-before { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); border-radius: 6px; padding: 7px 10px; color: var(--text); line-height: 1.5; }
.mc-simp-after { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); border-radius: 6px; padding: 7px 10px; color: var(--text); line-height: 1.5; }
.mc-simp-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.mc-simp-before .mc-simp-label { color: #ef4444; }
.mc-simp-after .mc-simp-label { color: #22c55e; }
.mc-tips-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.mc-tips-list { list-style: none; padding: 0; margin: 0; }
.mc-tips-list li { font-size: 0.85rem; color: var(--text); line-height: 1.65; padding: 5px 0 5px 20px; border-bottom: 1px solid var(--border); position: relative; }
.mc-tips-list li:last-child { border-bottom: none; }
.mc-tips-list li::before { content: "→"; position: absolute; left: 0; color: #6366f1; font-weight: 700; }
@media (max-width: 900px) { .mc-cards-grid { grid-template-columns: 1fr; } .mc-simp-row { grid-template-columns: 1fr; } }

/* ── PERSONAS ── */
.ps-prompt-wrap { position: relative; }
.ps-prompt { width: 100%; min-height: 420px; padding: 18px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-family: 'Courier New', monospace; font-size: 0.83rem; line-height: 1.7; resize: vertical; box-sizing: border-box; }
.ps-prompt:focus { outline: none; border-color: var(--primary); }
.ps-service-info { background: rgba(99,102,241,0.07); border: 1px solid rgba(99,102,241,0.2); border-radius: 10px; padding: 10px 14px; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.ps-service-info strong { color: var(--text); }
.ps-tip { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); border-radius: 10px; padding: 10px 14px; font-size: 0.82rem; color: #fbbf24; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }

/* ── QUIZ ── */
.quiz-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.quiz-empty-icon { width: 64px; height: 64px; background: rgba(99,102,241,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary-light); }
.quiz-empty-state h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0; }
.quiz-empty-state p { font-size: 0.85rem; margin: 0; max-width: 260px; }
.quiz-preview-header { margin-bottom: 16px; }
.quiz-preview-title { font-size: 1.2rem; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.quiz-preview-meta { font-size: 0.82rem; color: var(--text-muted); }
.quiz-preview-intro { margin: 10px 0; padding: 10px 14px; background: rgba(99,102,241,0.08); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; font-size: 0.88rem; color: var(--text-muted); }
.question-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.question-num { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--primary-light); margin-bottom: 4px; }
.question-text { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.option-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.option-list li { padding: 6px 10px; border-radius: 6px; font-size: 0.82rem; color: var(--text-muted); border: 1px solid transparent; display: flex; align-items: center; gap: 6px; }
.option-list li.correct { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; font-weight: 600; }
.question-explanation { margin-top: 6px; padding: 6px 10px; background: rgba(99,102,241,0.06); border-radius: 6px; font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 14px; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); }
.quiz-actions .btn { padding: 8px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; text-decoration: none; }
.quiz-actions .btn:hover { border-color: var(--primary); color: var(--primary-light); }
.quiz-actions .btn.btn-save { background: var(--primary); border-color: var(--primary); color: #fff; }
.quiz-actions .btn.btn-save:hover { opacity: 0.9; }
.qr-section { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.qr-section img { width: 100px; height: 100px; border-radius: 6px; background: #fff; }
.qr-info { flex: 1; }
.qr-info .url-text { font-size: 0.78rem; color: var(--text-muted); word-break: break-all; background: var(--input-bg); padding: 6px 10px; border-radius: 6px; margin: 6px 0; }
.qr-info p { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 6px; }
.section-heading { font-size: 1rem; font-weight: 800; color: var(--text); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.quizzes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.quiz-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s; }
.quiz-card:hover { border-color: var(--primary); }
.quiz-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.quiz-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.quiz-card-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.badge-practice { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.badge-test { background: rgba(245,158,11,0.15); color: #fbbf24; }
.quiz-card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-card-meta span { display: flex; align-items: center; gap: 4px; }
.quiz-card-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.quiz-card-stats { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 12px; }
.quiz-card-stats span { display: flex; align-items: center; gap: 3px; }
.quiz-loading { display: none; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 14px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.quiz-loading.show { display: flex; }
.nav-badge { font-size: 0.65rem; font-weight: 700; background: var(--primary); color: #fff; padding: 1px 5px; border-radius: 10px; margin-left: auto; }
.limit-bar { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 0.85rem; color: #fbbf24; }
.limit-bar a { color: #fbbf24; font-weight: 700; text-decoration: underline; }
@media (max-width: 900px) { .quizzes-grid { grid-template-columns: 1fr; } }

/* ── RUBRICS ── */
.rb-check-row { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.rb-check-row input { width: 15px; height: 15px; accent-color: var(--primary); }
.rb-check-row span { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.rb-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.rb-tab { padding: 11px 20px; font-size: 0.84rem; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all 0.15s; font-family: inherit; }
.rb-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.rb-tab:hover:not(.active) { color: var(--text); }
.rb-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.rb-actions .btn { padding: 8px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; font-family: inherit; text-decoration: none; }
.rb-actions .btn:hover { border-color: var(--accent); color: var(--accent-text); }
.rb-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rb-actions .btn.primary:hover { opacity: 0.9; }
.rb-actions .btn.green { background: var(--emerald2); border-color: var(--emerald2); color: #fff; }
.rb-actions .btn.green:hover { opacity: 0.9; }
.rb-table-wrap { overflow-x: auto; padding: 16px; }
.rb-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 600px; }
.rb-table th { padding: 10px 12px; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; border: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.rb-table th:first-child { background: rgba(30,41,59,0.98); min-width: 160px; max-width: 200px; position: sticky; left: 0; z-index: 2; }
.rb-table th.level-1 { background: rgba(239,68,68,0.15); color: #fca5a5; }
.rb-table th.level-2 { background: rgba(245,158,11,0.12); color: #fcd34d; }
.rb-table th.level-3 { background: rgba(99,102,241,0.12); color: #a5b4fc; }
.rb-table th.level-4 { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.rb-table td { padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; line-height: 1.55; color: var(--text-muted); }
.rb-table td:first-child { background: rgba(30,41,59,0.95); font-weight: 700; color: var(--text); font-size: 0.85rem; position: sticky; left: 0; }
.rb-table td.cell-1 { background: rgba(239,68,68,0.05); }
.rb-table td.cell-4 { background: rgba(16,185,129,0.05); }
.rb-weight { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; display: block; margin-top: 3px; }
.rb-note { font-size: 0.84rem; color: var(--text-muted); line-height: 1.65; padding: 12px 16px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2); border-radius: 10px; margin: 12px 16px; }
.rb-note strong { color: #f59e0b; }
@media print {
    .rb-tabs { display: none !important; }
    .rb-table-wrap { padding: 0; }
    .rb-table { font-size: 9pt; }
    .rb-table th, .rb-table td { border: 1pt solid #ccc; padding: 5pt 6pt; }
    .rb-table td:first-child, .rb-table th:first-child { position: static; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4 landscape; margin: 10mm; }
}

/* ── SUBSTITUTION ── */
.sub-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; gap: 14px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.sub-empty-icon { opacity: 0.25; display: flex; align-items: center; justify-content: center; }
.sub-empty-icon svg { width: 48px; height: 48px; }
.sub-empty h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.sub-loading { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; gap: 14px; color: var(--text-muted); text-align: center; padding: 40px 20px; }
.sub-loading.show { display: flex; }
.sub-loading .spin-ring { border-color: rgba(245,158,11,0.2); border-top-color: #f59e0b; }
.view-tabs { display: flex; gap: 0; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.view-tab { flex: 1; padding: 8px 12px; text-align: center; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: all 0.15s; color: var(--text-muted); border: none; background: transparent; font-family: inherit; }
.view-tab.active { background: #f59e0b; color: #fff; }
.view-tab:not(.active):hover { background: rgba(245,158,11,0.1); color: var(--text); }
.plan-title { font-size: 1.2rem; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.plan-meta { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 16px; }
.plan-summary { padding: 11px 15px; background: rgba(245,158,11,0.08); border-left: 3px solid #f59e0b; border-radius: 0 8px 8px 0; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.plan-section { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.plan-section-header { padding: 10px 14px; background: var(--surface); font-size: 0.82rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.plan-section-header .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.plan-section-body { padding: 12px 14px; font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; white-space: pre-wrap; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.plan-table th { padding: 8px 12px; background: var(--surface); text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.plan-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; line-height: 1.5; }
.plan-table tr:last-child td { border-bottom: none; }
.plan-table tr:hover td { background: rgba(255,255,255,0.02); }
.td-time { font-weight: 700; color: #fbbf24; white-space: nowrap; width: 80px; }
.td-act { font-weight: 600; color: var(--text); width: 130px; }
.td-det { color: var(--text-muted); }
.crisis-box { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.crisis-box h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #fca5a5; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.crisis-box p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; white-space: pre-wrap; }
.crisis-note { font-size: 0.78rem; color: var(--text-muted); text-align: center; padding: 12px; border: 1px dashed rgba(255,255,255,0.1); border-radius: 8px; margin-bottom: 12px; }
.tabule-box { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: 10px; padding: 14px 16px; font-family: "Courier New", monospace; font-size: 0.85rem; color: var(--primary-light); white-space: pre-wrap; line-height: 1.6; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.plan-actions .btn { padding: 8px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; text-decoration: none; font-family: inherit; }
.plan-actions .btn:hover { border-color: #f59e0b; color: #fbbf24; }
.plan-actions .btn.primary { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.plan-actions .btn.primary:hover { opacity: 0.9; }
.share-box { background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 0.78rem; color: var(--text-muted); word-break: break-all; margin-top: 8px; display: none; }
.share-box.show { display: block; }

/* ── WORDPROBLEMS ── */
.wp-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; padding: 24px; height: calc(100vh - var(--header-h) - 1px); overflow: hidden; }
.wp-panel { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow-y: auto; padding: 20px; }
.wp-section { margin-bottom: 18px; }
.wp-section .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.count-row { display: flex; align-items: center; gap: 10px; }
.count-val { min-width: 26px; text-align: center; font-weight: 700; color: var(--indigo); font-size: 15px; }
.wp-right { display: flex; flex-direction: column; gap: 0; }
.wp-right .wp-panel { flex: 1; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.wp-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); padding: 40px; text-align: center; }
.wp-empty svg { opacity: .3; }
.wp-empty p { font-size: 14px; }
.wp-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text-muted); }
.wp-loading .spin { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: #f59e0b; border-radius: 50%; animation: spin .8s linear infinite; }
.wp-loading p { font-size: 14px; }
.wp-loading-phases { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 8px; }
.wp-loading-phase { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; opacity: .4; transition: opacity .3s; }
.wp-loading-phase.active { opacity: 1; color: #f59e0b; }
.wp-loading-phase.done { opacity: 1; color: var(--emerald); }
.wp-loading-phase .ph-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wp-result-head { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.wp-result-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.wp-result-meta strong { color: var(--text); }
.wp-result-tabs { display: flex; gap: 0; }
.wp-tab { padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all .15s; }
.wp-tab.active { color: #f59e0b; border-bottom-color: #f59e0b; }
.wp-actions { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.wp-tab-body { flex: 1; overflow-y: auto; padding: 20px; }
.wp-teacher-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wp-teacher-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.wp-teacher-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; }
.wp-teacher-table tr:last-child td { border-bottom: none; }
.wp-teacher-table .num-cell { width: 36px; font-weight: 700; color: var(--indigo); }
.wp-teacher-table .zadani-cell { max-width: 340px; }
.wp-teacher-table .result-cell { color: var(--emerald); font-weight: 600; white-space: nowrap; }
.wp-teacher-table .postup-cell { color: var(--text-muted); font-size: 12px; }
.wp-student-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; }
.wp-student-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.wp-student-card .card-num { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.wp-student-card .card-text { font-size: 13px; line-height: 1.6; color: var(--text); }
.print-templates { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.print-tpl { background: var(--card); border: 2px solid var(--border); border-radius: 8px; padding: 12px 8px; text-align: center; cursor: pointer; transition: all .15s; }
.print-tpl input { display: none; }
.print-tpl .tpl-icon { font-size: 22px; margin-bottom: 4px; }
.print-tpl .tpl-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.print-tpl:has(input:checked) { border-color: #f59e0b; background: rgba(245,158,11,.1); }
.print-tpl:has(input:checked) .tpl-label { color: #f59e0b; }
.wp-free-note { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #f59e0b; margin-bottom: 14px; }
.wp-preview3-bar { display: flex; gap: 8px; padding: 10px 16px; background: rgba(99,102,241,.04); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.wp-prev-card { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.wp-prev-num { font-size: 10px; font-weight: 700; color: var(--indigo, #6366f1); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.wp-prev-text { font-size: 11px; color: var(--text-muted); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
@media (max-width: 900px) { .wp-layout { grid-template-columns: 1fr; height: auto; overflow: visible; } .wp-panel { max-height: none; } .wp-right .wp-panel { min-height: 400px; } }

/* ── GENERATOR PAGES — page-content variant with fixed height ── */
.page-gen-content { display: flex; flex-direction: column; height: calc(100vh - 60px); overflow: hidden; padding: 20px 24px; }

/* ── RVP / VZDĚLÁVACÍ CÍL (generator right panel) ── */
.rvp-section { border-top: 1px solid var(--border); background: rgba(245,158,11,0.04); }
.rvp-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; cursor: pointer; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); user-select: none; transition: background 0.15s; }
.rvp-header:hover { background: rgba(245,158,11,0.08); }
.rvp-header-left { display: flex; align-items: center; gap: 6px; }
.rvp-header-badge { font-size: 0.7rem; font-weight: 700; color: #f59e0b; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); padding: 1px 6px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.rvp-body { padding: 12px 16px 16px; border-top: 1px solid rgba(245,158,11,0.15); }
.rvp-body .form-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; display: block; margin-bottom: 5px; }
.rvp-body textarea, .rvp-body input[type="text"] { width: 100%; padding: 7px 10px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: inherit; font-size: 0.85rem; box-sizing: border-box; resize: vertical; }
.rvp-body textarea:focus, .rvp-body input:focus { outline: none; border-color: #f59e0b; }
.rvp-suggest-btn { margin-top: 10px; padding: 7px 14px; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); border-radius: 7px; color: #f59e0b; font-size: 0.8rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; font-family: inherit; }
.rvp-suggest-btn:hover { background: rgba(245,158,11,0.2); }
.rvp-suggest-btn:disabled { opacity: 0.5; cursor: not-allowed; }


/* ── Gradebook (gradebook.php) ── */
.gb-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

/* ── Parent mail (parentmail.php) ── */
.pm-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; min-height: calc(100vh - 120px); }

/* ── Tematický plán (planner.php) ── */
.pl-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }

/* Na telefonu pod sebe — pravý panel (třída, plán, dopis) jinak utekl mimo obrazovku.
   min-width:0: široká tabulka se posouvá uvnitř buňky, ne celá stránka. */
.gb-layout > *, .pm-layout > *, .pl-layout > * { min-width: 0; }
@media (max-width: 900px) {
    .gb-layout, .pm-layout, .pl-layout { grid-template-columns: 1fr; }
    .pm-layout { min-height: 0; }
}

/* ── IVP / Podpora žáků (ivp.php) ── */
/* ── Confidential banner ──────────────────────────────────────────── */
.ivp-confidential {
    background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(239,68,68,.06));
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #fca5a5;
    margin-bottom: 18px;
}
.ivp-confidential strong { color: #ef4444; }

/* ── Layout ───────────────────────────────────────────────────────── */
.ivp-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

/* ── Sidebar: doc list ────────────────────────────────────────────── */
.ivp-sidebar {}
.ivp-doc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ivp-doc-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}
.ivp-doc-item:hover { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.05); }
.ivp-doc-item.active { border-color: #ef4444; background: rgba(239,68,68,.08); }
.ivp-doc-icon {
    width: 28px; height: 28px;
    background: rgba(239,68,68,.12);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #ef4444; flex-shrink: 0;
}
.ivp-doc-name { font-size: 12px; font-weight: 600; line-height: 1.4; }
.ivp-doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ivp-doc-lock { font-size: 9px; background: rgba(239,68,68,.2); color: #fca5a5; padding: 2px 5px; border-radius: 4px; font-weight: 700; letter-spacing: .05em; }

/* ── Main area ────────────────────────────────────────────────────── */
.ivp-main {}

/* ── Form ─────────────────────────────────────────────────────────── */
.ivp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ivp-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); margin: 18px 0 10px; display: flex; align-items: center; gap: 6px;
}
.ivp-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Guardrail notice ─────────────────────────────────────────────── */
.ivp-guardrail {
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #fcd34d;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Generate button ──────────────────────────────────────────────── */
.btn-ivp-gen {
    width: 100%;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.btn-ivp-gen:hover { opacity: .9; }
.btn-ivp-gen:disabled { opacity: .5; cursor: not-allowed; }

/* ── Result document ──────────────────────────────────────────────── */
.ivp-result {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.ivp-result-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ivp-result-title { font-size: 15px; font-weight: 700; }
.ivp-result-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ivp-result-body  { padding: 20px; }

/* Sections */
.ivp-section {
    margin-bottom: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.ivp-section-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ivp-section-body { padding: 12px 14px; font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

/* Section colors */
.ivp-sec-profil   .ivp-section-head { background: rgba(99,102,241,.08); color: var(--indigo); }
.ivp-sec-cile     .ivp-section-head { background: rgba(16,185,129,.08); color: var(--emerald); }
.ivp-sec-metody   .ivp-section-head { background: rgba(245,158,11,.08); color: #f59e0b; }
.ivp-sec-hodnoceni .ivp-section-head { background: rgba(139,92,246,.08); color: #8b5cf6; }
.ivp-sec-podpora  .ivp-section-head { background: rgba(59,130,246,.08); color: #3b82f6; }
.ivp-sec-spoluprace .ivp-section-head { background: rgba(20,184,166,.08); color: #14b8a6; }
.ivp-sec-poznamka .ivp-section-head { background: rgba(239,68,68,.08); color: #ef4444; }

/* ── Loading ──────────────────────────────────────────────────────── */
.ivp-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.ivp-loading .spin {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Actions ──────────────────────────────────────────────────────── */
.ivp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}

/* ── Empty ────────────────────────────────────────────────────────── */
.ivp-empty {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.ivp-empty svg { opacity: .25; margin-bottom: 14px; }
.ivp-empty h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.ivp-empty p  { font-size: 13px; max-width: 400px; margin: 0 auto; }

@media (max-width: 900px) {
    .ivp-layout { grid-template-columns: 1fr; }
    .ivp-form-grid { grid-template-columns: 1fr; }
}

/* ── Lesson Table (lesson_table.php) ── */

/* ── Layout ────────────────────────────────────────────────────── */
.lt-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 24px; height: calc(100vh - var(--header-h) - 1px); overflow: hidden; }
.lt-panel  { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow-y: auto; padding: 20px; }

/* ── Form labels ───────────────────────────────────────────────── */
.lt-section { margin-bottom: 16px; }
.lt-section .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Generate button ───────────────────────────────────────────── */

/* ── Right: empty / loading / result ──────────────────────────── */
.lt-right .lt-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.lt-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--text-muted); padding:40px; text-align:center; }
.lt-empty svg { opacity:.25; }

.lt-loading { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:var(--text-muted); }
.lt-loading .spin { width:38px; height:38px; border:3px solid var(--border); border-top-color:var(--indigo); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Result header & tabs ──────────────────────────────────────── */
.lt-result-head { padding:14px 18px; border-bottom:1px solid var(--border); }
.lt-result-meta { font-size:12px; color:var(--text-muted); margin-bottom:8px; }
.lt-result-meta strong { color:var(--text); }
.lt-tabs { display:flex; gap:0; }
.lt-tab { padding:7px 14px; font-size:13px; font-weight:500; cursor:pointer; border:none; background:transparent; color:var(--text-muted); border-bottom:2px solid transparent; transition:all .15s; }
.lt-tab.active { color:var(--indigo); border-bottom-color:var(--indigo); }

/* ── Table ─────────────────────────────────────────────────────── */
.lt-tab-body { flex:1; overflow:auto; padding:16px; }

.lt-table { width:100%; border-collapse:collapse; font-size:12.5px; min-width:900px; }
.lt-table th { background:rgba(99,102,241,.08); text-align:left; padding:8px 10px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); border-bottom:2px solid var(--border); white-space:nowrap; }
.lt-table td { padding:10px 10px; border-bottom:1px solid var(--border); vertical-align:top; line-height:1.6; font-size:12.5px; }
.lt-table tr:last-child td { border-bottom:none; }
.lt-table tr:hover td { background:rgba(255,255,255,.02); }

/* Column color accents */
.lt-table .col-faze   { color:var(--indigo); font-weight:700; font-size:11px; text-transform:uppercase; white-space:nowrap; min-width:90px; }
.lt-table .col-cas    { color:var(--text-muted); white-space:nowrap; min-width:65px; font-variant-numeric:tabular-nums; }
.lt-table .col-ucitel { min-width:160px; }
.lt-table .col-zak    { min-width:140px; color:#a5b4fc; }
.lt-table .col-pomucky{ min-width:110px; color:#6ee7b7; font-size:12px; }
.lt-table .col-dif    { min-width:130px; color:#fcd34d; font-size:12px; }
.lt-table .col-zaloha { min-width:120px; color:var(--text-muted); font-size:12px; font-style:italic; }

/* Phase badge colors */
.phase-uvod    { background:rgba(99,102,241,.12); color:#818cf8; }
.phase-rozvoj  { background:rgba(16,185,129,.12); color:#34d399; }
.phase-praxe   { background:rgba(245,158,11,.12); color:#fbbf24; }
.phase-zaver   { background:rgba(139,92,246,.12); color:#c084fc; }
.phase-default { background:var(--card); color:var(--text-muted); }
.phase-badge { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; letter-spacing:.04em; }

/* ── Actions bar ───────────────────────────────────────────────── */
.lt-actions { display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--border); flex-wrap:wrap; align-items:center; }

/* ── Navazující akce ───────────────────────────────────────────── */
.lt-followup { padding:14px 16px; border-top:1px solid var(--border); background:rgba(255,255,255,.02); }
.lt-followup-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:8px; }
.lt-followup-btns  { display:flex; gap:8px; flex-wrap:wrap; }
.lt-followup-btn { display:flex; align-items:center; gap:6px; background:var(--card); border:1px solid var(--border); border-radius:8px; padding:7px 12px; font-size:12px; font-weight:500; cursor:pointer; text-decoration:none; color:var(--text); transition:all .15s; }
.lt-followup-btn:hover { border-color:var(--indigo); color:var(--indigo); background:rgba(99,102,241,.06); }
.lt-followup-btn svg { opacity:.7; }

/* Responsive */
@media (max-width:900px) {
    .lt-layout { grid-template-columns:1fr; height:auto; overflow:visible; }
    .lt-panel  { max-height:none; }
    .lt-right .lt-panel { min-height:500px; }
}


/* ── Setup (setup.php) ── */

.setup-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface); }
.setup-box { width: 100%; max-width: 580px; }
.setup-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.setup-logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--indigo), #8b5cf6);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.setup-logo-text { font-size: 22px; font-weight: 800; }
.setup-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px; }
.setup-step-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--indigo); margin-bottom: 8px; }
.setup-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.setup-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.setup-divider { height: 1px; background: var(--border); margin: 20px 0; }
.setup-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--indigo); margin-bottom: 16px; }
.setup-success { text-align: center; padding: 20px 0; }
.setup-success h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.setup-success p { color: var(--text-muted); margin-bottom: 24px; }


/* ── Admin panel (admin.php) ── */

:root { --admin-sidebar: 226px; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: var(--admin-sidebar); flex-shrink: 0;
    background: var(--surface-2, #1e293b);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 24px 0;
}
.admin-sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.admin-sidebar-logo svg { display:block; flex-shrink:0; }
.admin-sidebar-logo-text { font-size: 15px; font-weight: 800; }
.admin-sidebar-badge { font-size: 10px; background: var(--indigo); color: #fff; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.admin-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; font-size: 14px; font-weight: 500;
    color: var(--text-muted); text-decoration: none;
    border-left: 3px solid transparent; transition: all .15s;
}
.admin-nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.admin-nav-item.active { color: #fff; border-left-color: var(--indigo); background: rgba(99,102,241,.1); }
.admin-sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(148,163,184,.5); padding: 16px 20px 4px; }
.admin-sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; height: 60px;
    background: var(--card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.admin-topbar-title { font-size: 16px; font-weight: 700; }
.admin-content { padding: 28px; flex: 1; overflow-y: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.stat-card-value { font-size: 28px; font-weight: 900; color: var(--indigo); }
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-card-value { white-space: nowrap; }
/* Admin na telefonu: postranní menu se vysouvá tlačítkem v liště (.admin-menu-btn v admin.php) */
.admin-menu-btn { display: none; }
@media (max-width: 900px) {
    .admin-layout { display: block; }
    .admin-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 300;
        overflow-y: auto; transform: translateX(-100%); transition: transform .2s;
    }
    .admin-sidebar.open { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.4); }
    .admin-main { overflow: visible; }
    .admin-topbar { padding: 0 14px; gap: 10px; }
    .admin-content { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-menu-btn { display: inline-flex !important; }
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-start { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-teacher { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-parent { background: rgba(236,72,153,.15); color: #ec4899; }
.badge-school { background: rgba(16,185,129,.15); color: #34d399; }
.badge-active { background: rgba(16,185,129,.15); color: #34d399; }
.badge-inactive { background: rgba(239,68,68,.15); color: #f87171; }
.badge-pending { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-paid { background: rgba(16,185,129,.15); color: #34d399; }
.badge-cancelled { background: rgba(100,116,139,.15); color: #94a3b8; }
.admin-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text-muted); text-decoration: none; cursor: pointer; transition: all .15s; }
.filter-btn:hover, .filter-btn.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-tab-bar { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

/* Settings — kartový grid přes celou šířku (jako Ceny plánů) */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 20px; align-items: start; }
.set-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.set-card > .form-section-title:first-child { margin-top: 0; }
.set-span-all { grid-column: 1 / -1; }
@media (max-width: 720px) { .set-grid { grid-template-columns: 1fr; } }
.settings-tab { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; }
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--indigo); margin: 24px 0 14px; }
.form-section-title:first-child { margin-top: 0; }
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.plan-select-inline { padding: 4px 8px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); cursor: pointer; }

/* AI Provider Cards */
.ai-providers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.ai-provider-card {
    display: block;
    cursor: pointer;
    user-select: none;
}
.ai-provider-card input[type="radio"] { display: none; }
.ai-provider-inner {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    transition: border-color .15s, background .15s;
    background: var(--card);
    position: relative;
}
.ai-provider-card input:checked + .ai-provider-inner {
    border-color: var(--provider-color, var(--indigo));
    background: rgba(var(--provider-rgb, 99,102,241), 0.08);
}
.ai-provider-card:hover .ai-provider-inner { border-color: rgba(255,255,255,.2); }
.ai-provider-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-provider-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ai-provider-name { font-size: 13px; font-weight: 700; }
.ai-provider-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: auto; }
.ai-provider-model { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.ai-provider-check {
    position: absolute; top: 8px; right: 8px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--provider-color, var(--indigo));
    display: none; align-items: center; justify-content: center;
}
.ai-provider-card input:checked + .ai-provider-inner .ai-provider-check { display: flex; }
.ai-key-section { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.ai-key-section-inner { display: none; }
.ai-key-section-inner.active { display: block; }

/* Plan pricing cards (admin) */
.plan-price-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 8px; }
.plan-price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; display: flex; flex-direction: column; }
.plan-price-card.plan-amber { border-color: rgba(245,158,11,.25); }
.plan-price-card.plan-indigo { border-color: rgba(99,102,241,.35); }
.plan-price-card.plan-emerald { border-color: rgba(16,185,129,.25); }
.ppc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.ppc-label.amber { color: #fbbf24; }
.ppc-label.indigo { color: #818cf8; }
.ppc-label.emerald { color: #34d399; }
.ppc-free { font-size: 26px; font-weight: 900; margin-bottom: 12px; color: var(--text-muted); }
.ppc-features { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; font-size: 12px; color: var(--text-muted); }
.ppc-feature { display: flex; align-items: center; gap: 7px; }
.ppc-feature svg { flex-shrink: 0; }
.ppc-dim { opacity: .4; }

/* Templates */
.tpl-list { display: flex; flex-direction: column; gap: 12px; }
.tpl-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); }
.tpl-item-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.tpl-item-icon { width: 34px; height: 34px; border-radius: 8px; background: rgba(99,102,241,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tpl-item-title { font-size: 14px; font-weight: 700; }
.tpl-item-desc { font-size: 12px; color: var(--text-muted); }
.tpl-item-toggle { margin-left: auto; color: var(--text-muted); transition: transform .2s; }
.tpl-item-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); margin-top: 0; }
.tpl-item.open .tpl-item-toggle { transform: rotate(180deg); }
.tpl-item.open .tpl-item-body { display: block; padding-top: 16px; }
.tpl-vars { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tpl-var { font-size: 11px; background: rgba(99,102,241,.12); color: #818cf8; padding: 2px 8px; border-radius: 4px; font-family: monospace; cursor: pointer; }
.tpl-var:hover { background: rgba(99,102,241,.22); }

/* SMTP test row */
.test-row { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.test-result { font-size: 13px; padding: 8px 12px; border-radius: 8px; flex: 1; min-height: 36px; display: flex; align-items: center; }
.test-result.ok { background: rgba(16,185,129,.1); color: #34d399; }
.test-result.error { background: rgba(239,68,68,.1); color: #f87171; }

/* Upload row */
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-preview { width: 60px; height: 40px; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.upload-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }


/* ── WYSIWYG component (wysiwyg.php) ── */

/* ─── WYSIWYG Component ─────────────────────────────────────────────────────── */
.wysiwyg-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.wysiwyg-toolbar {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--border);
    padding: 6px 8px; display: flex; gap: 3px; flex-wrap: wrap; align-items: center;
}
.wysiwyg-toolbar button {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 7px; cursor: pointer; border-radius: 5px;
    font-size: 12px; min-width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .12s; color: var(--text-muted); font-family: inherit; font-weight: 600;
}
.wysiwyg-toolbar button:hover { background: rgba(255,255,255,0.12); color: var(--text); border-color: rgba(255,255,255,0.22); }
.wysiwyg-toolbar button:disabled { opacity: .3; cursor: not-allowed; }
.wysiwyg-toolbar button.active { background: rgba(99,102,241,0.22); color: #818cf8; border-color: rgba(99,102,241,0.4); }
.wysiwyg-sep { width: 1px; background: var(--border); height: 20px; margin: 0 3px; flex-shrink: 0; }
/* Editor area — light bg for HTML content */
.wysiwyg-editor {
    padding: 16px 18px; outline: none; overflow-y: auto;
    background: #fff; color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px; line-height: 1.7;
}
.wysiwyg-editor:focus { box-shadow: inset 0 0 0 2px rgba(99,102,241,0.25); }
.wysiwyg-editor table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.wysiwyg-editor table td, .wysiwyg-editor table th { border: 1px solid #cbd5e1; padding: 6px 8px; min-width: 40px; }
.wysiwyg-editor table th { background: #f8fafc; font-weight: 700; }
.wysiwyg-editor h1 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.wysiwyg-editor h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.wysiwyg-editor h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.wysiwyg-editor p  { margin-bottom: 8px; }
.wysiwyg-editor ul, .wysiwyg-editor ol { padding-left: 20px; margin-bottom: 8px; }
.wysiwyg-editor a  { color: #6366f1; }
/* HTML source view */
.wysiwyg-html-view {
    width: 100%; padding: 14px; resize: vertical;
    background: #1e293b; color: #7dd3fc;
    font-family: "Courier New", monospace; font-size: 12px; border: none; outline: none;
}
/* Unsaved badge */
.wys-dirty-badge {
    display: none; align-items: center; gap: 5px;
    background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.35);
    color: #fbbf24; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
    white-space: nowrap;
}
.wys-dirty-badge.visible { display: flex; }
.wys-dirty-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #f59e0b;
    animation: wys-pulse 1.2s ease-in-out infinite;
}
@keyframes wys-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.45;transform:scale(1.4)} }
/* Shared color picker */
#wys-color-picker {
    position: fixed; background: #1e293b; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.5);
    z-index: 9999; display: none;
}
#wys-color-picker.show { display: block; }
.wys-color-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; }
.wys-color-opt {
    width: 30px; height: 30px; border: 2px solid transparent;
    border-radius: 5px; cursor: pointer; transition: all .12s;
}
.wys-color-opt:hover { border-color: #fff; transform: scale(1.1); }
/* Shared modals */
.wys-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.65); z-index: 9998;
    align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(4px);
}
.wys-modal.show { display: flex; }
.wys-modal-box {
    background: #1e293b; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px; padding: 24px; max-width: 440px; width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.wys-modal-box h3 { font-size: 15px; font-weight: 700; color: #f8fafc; margin-bottom: 18px; }
.wys-modal-box .wys-form-row { margin-bottom: 12px; }
.wys-modal-box label { display: block; font-size: 12px; font-weight: 600; color: #94a3b8; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em; }
.wys-modal-box input[type="text"], .wys-modal-box input[type="number"] {
    width: 100%; padding: 8px 12px; background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    color: #f8fafc; font-size: 14px; font-family: inherit; outline: none;
}
.wys-modal-box input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.wys-modal-box .wys-chk-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wys-modal-box .wys-chk-row label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.wys-modal-btns { display: flex; gap: 8px; margin-top: 18px; }
.wys-modal-btns button { flex: 1; padding: 9px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.wys-btn-ok  { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; }
.wys-btn-del { background: rgba(239,68,68,.2); color: #f87171; border: 1px solid rgba(239,68,68,.3) !important; }
.wys-btn-cancel { background: rgba(255,255,255,.07); color: #94a3b8; border: 1px solid rgba(255,255,255,.12) !important; }


/* ── Planner animation (planner.php) ── */
@keyframes plannerProgress { 0%{width:0%} 90%{width:88%} 100%{width:93%} }

/* ── Správa školy (school.php): řádky učitelů na telefonu ── */
@media (max-width: 480px) {
    .skola-radek { flex-wrap: wrap; }
    .skola-naposledy { display: none; }
    .skola-akce { width: 100%; justify-content: flex-end; }
}

/* ── Přehled: první kroky nového učitele (dashboard.php) ── */
.onb-card { margin-bottom: 24px; padding: 18px 20px; }
.onb-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.onb-step a { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13.5px; }
.onb-step a:hover { color: var(--accent-text); }
.onb-num {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700;
}
.onb-step.done { opacity: .55; text-decoration: line-through; }
.onb-step.done .onb-num { background: rgba(16,185,129,.15); color: var(--emerald-text); }

/* ── Zelený štítek „~X min ušetřeno" (library.php) ── */
.saved-pill {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--emerald-text);
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.25);
    border-radius: 20px;
    font-weight: 600;
}

/* ── Přístupnost ── */
/* Viditelný rámeček při ovládání klávesnicí (myš ho nevyvolá) */
:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
/* Omezení pohybu: animace doběhnou okamžitě do konečného stavu. Ne `animation:none` —
   prvky, které začínají neviditelné a zobrazí je až animace, by zůstaly skryté. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
    /* Kolečka načítání se točit musí (pomaleji) — zastavené by při 20–90 s generování
       vypadalo jako zaseklá aplikace. */
    .spin-ring, .fc-gen-spinner, .fc-loader, .wp-loading .spin, .lt-loading .spin, .ivp-loading .spin {
        animation-duration: 1.4s !important;
        animation-iteration-count: infinite !important;
    }
}
