/* =========================================================
   Wiki – design systém
   Všechna pravidla jsou omezená na .wiki-shell (WikiLayout).
   ========================================================= */
.wiki-shell {
    /* Plochy */
    --wiki-bg: #fffdf9;
    --wiki-sidebar-bg: #f7f4ee;
    --wiki-surface: #ffffff;
    --wiki-surface-muted: #faf6ee;
    --wiki-hover: rgba(47, 42, 34, 0.05);

    /* Čáry */
    --wiki-border: #ece5d8;
    --wiki-border-strong: #ddd2bd;
    --wiki-border-hover: #d9c9a8;

    /* Text */
    --wiki-text: #2f2a22;
    --wiki-text-soft: #6f685c;
    --wiki-text-muted: #97907f;

    /* Akcent wiki (bronz a zlatá z palety webu) */
    --wiki-accent: #7a5c2e;
    --wiki-accent-strong: #5a3e18;
    --wiki-accent-soft: #c8a86b;
    --wiki-accent-bg: #f4eddd;
    --wiki-gold: #DAA520;
    --wiki-em: var(--c-sage);

    /* Správa – vše, co vidí jen správce, má šalvějový tón (--c-sage) */
    --wiki-admin: var(--c-sage);
    --wiki-admin-bg: color-mix(in srgb, var(--c-sage-soft) 65%, transparent);
    --wiki-admin-bg-strong: var(--c-sage-soft);
    --wiki-admin-border: var(--c-sage-line);

    /* Stavy */
    --wiki-danger: #dc3545;
    --wiki-danger-ink: #842029;
    --wiki-danger-bg: rgba(220, 53, 69, 0.07);
    --wiki-danger-border: rgba(220, 53, 69, 0.28);
    --wiki-warning-ink: #55411a;
    --wiki-warning-bg: #FAF2E2;
    --wiki-warning-border: #d9c9a8;
    --wiki-gold-dark: #B8860B;

    /* Šalvějová; ve výsledcích termínů setkání jen pro vítěze a doporučené termíny */
    --wiki-sage: var(--c-sage);
    --wiki-sage-ink: var(--c-sage-ink);
    --wiki-sage-soft: var(--c-sage-soft);
    --wiki-sage-line: var(--c-sage-line);

    /* Tvary a stíny */
    --wiki-radius-sm: 8px;
    --wiki-radius: 12px;
    --wiki-radius-lg: 16px;
    --wiki-shadow-xs: 0 1px 2px rgba(67, 52, 26, 0.06);
    --wiki-shadow-sm: 0 1px 2px rgba(67, 52, 26, 0.04), 0 4px 14px rgba(67, 52, 26, 0.05);
    --wiki-shadow-md: 0 2px 6px rgba(67, 52, 26, 0.05), 0 16px 36px -14px rgba(67, 52, 26, 0.18);
    --wiki-ring: 0 0 0 4px rgba(200, 168, 107, 0.24);
    --wiki-ring-danger: 0 0 0 4px rgba(220, 53, 69, 0.16);
    --wiki-ease: 160ms cubic-bezier(0.4, 0, 0.2, 1);

    --wiki-width-read: 760px;
    --wiki-width-wide: 980px;

    /* Měřítko písma; v obsahové části (.wiki-main) je menší, aby se obsah vešel do tabulek */
    --wiki-text-scale: 1;

    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    color: var(--wiki-text);
    background: var(--wiki-bg);
    font-size: 15px;
}

.wiki-shell a {
    border-bottom: 0;
    transition: color var(--wiki-ease), background-color var(--wiki-ease), border-color var(--wiki-ease);
}

.wiki-shell h1,
.wiki-shell h2,
.wiki-shell h3 {
    color: var(--wiki-text);
    text-shadow: none;
    letter-spacing: -0.015em;
}

.wiki-shell .wiki-content em {
    color: var(--wiki-em);
    font-style: normal;
}

/* =========================================================
   Postranní panel
   ========================================================= */
.wiki-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px 14px;
    background: var(--wiki-sidebar-bg);
    border-right: 1px solid var(--wiki-border);
}

.wiki-shell .wiki-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px;
    border-radius: var(--wiki-radius);
    color: var(--wiki-text);
}

.wiki-shell .wiki-brand:hover {
    color: var(--wiki-text);
    background: var(--wiki-hover);
}

.wiki-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--wiki-accent-soft), var(--wiki-accent));
    color: #fff;
    font-size: 14px;
    box-shadow: var(--wiki-shadow-xs);
}

.wiki-brand-text {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.wiki-brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.wiki-brand-sub {
    color: var(--wiki-text-muted);
    font-size: 12px;
}

.wiki-nav-groups {
    display: grid;
    gap: 18px;
}

.wiki-nav-group {
    min-width: 0;
}

.wiki-nav-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
    padding: 0 10px;
    color: var(--wiki-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.wiki-nav {
    display: grid;
    gap: 2px;
}

.wiki-shell .wiki-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: var(--wiki-radius-sm);
    color: var(--wiki-text-soft);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.wiki-shell .wiki-nav a i {
    flex: 0 0 auto;
    width: 18px;
    text-align: center;
    color: var(--wiki-text-muted);
    font-size: 14px;
    transition: color var(--wiki-ease);
}

.wiki-shell .wiki-nav a:hover {
    color: var(--wiki-text);
    background: var(--wiki-hover);
}

.wiki-shell .wiki-nav a:hover i {
    color: var(--wiki-accent);
}

.wiki-shell .wiki-nav a.active {
    color: var(--wiki-text);
    font-weight: 600;
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-xs), inset 0 0 0 1px var(--wiki-border);
}

.wiki-shell .wiki-nav a.active i {
    color: var(--wiki-accent);
}

/* Správa – oddělená skupina, kterou vidí jen správce */
.wiki-nav-admin {
    padding: 10px 6px 6px;
    border: 1px solid var(--wiki-admin-border);
    border-radius: var(--wiki-radius);
    background: var(--wiki-admin-bg);
}

.wiki-nav-admin .wiki-nav-label {
    padding: 0 6px 0 8px;
    color: var(--wiki-admin);
}

.wiki-nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--wiki-surface);
    color: var(--wiki-admin);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    box-shadow: inset 0 0 0 1px var(--wiki-admin-border);
}

.wiki-shell .wiki-nav-admin .wiki-nav a {
    color: var(--wiki-admin);
}

.wiki-shell .wiki-nav-admin .wiki-nav a i {
    color: var(--wiki-admin);
    opacity: 0.75;
}

.wiki-shell .wiki-nav-admin .wiki-nav a:hover {
    background: color-mix(in srgb, var(--wiki-admin) 8%, transparent);
}

.wiki-shell .wiki-nav-admin .wiki-nav a:hover i,
.wiki-shell .wiki-nav-admin .wiki-nav a.active i {
    color: var(--wiki-admin);
    opacity: 1;
}

.wiki-shell .wiki-nav-admin .wiki-nav a.active {
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-xs), inset 0 0 0 1px var(--wiki-admin-border);
}

/* Patička panelu */
.wiki-sidebar-footer {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--wiki-border);
}

.wiki-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 4px 10px 8px;
}

.wiki-shell .wiki-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent-strong);
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(200, 168, 107, 0.35);
}

.wiki-user-text {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.wiki-user-name {
    overflow: hidden;
    color: var(--wiki-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-user-role {
    color: var(--wiki-text-muted);
    font-size: 12px;
}

.wiki-user-role.is-admin {
    color: var(--wiki-admin);
}

.wiki-shell .wiki-nav-secondary a {
    min-height: 32px;
    padding: 5px 10px;
    color: var(--wiki-text-muted);
    font-size: 13px;
}

/* =========================================================
   Obsahová část
   ========================================================= */
.wiki-main {
    --wiki-text-scale: 0.93;
    min-width: 0;
    padding: 48px clamp(20px, 5vw, 72px) 64px;
    font-size: calc(15px * var(--wiki-text-scale));
    animation: wiki-fade-in 280ms ease both;
}

@keyframes wiki-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.wiki-shell .wiki-container {
    max-width: var(--wiki-width-read);
    margin: 0 auto;
}

.wiki-shell .wiki-container-wide {
    max-width: var(--wiki-width-wide);
    margin: 0 auto;
}

/* Hlavička stránky */
.wiki-shell .wiki-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.wiki-shell .wiki-head h1 {
    margin: 0;
    font-size: calc(clamp(28px, 2.2vw + 18px, 36px) * var(--wiki-text-scale));
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.wiki-shell .wiki-head-text {
    min-width: 0;
}

.wiki-shell .wiki-head-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

.wiki-shell .wiki-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    color: var(--wiki-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wiki-shell .wiki-eyebrow-admin {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--wiki-admin-bg);
    color: var(--wiki-admin);
    box-shadow: inset 0 0 0 1px var(--wiki-admin-border);
    letter-spacing: 0.06em;
}

.wiki-shell .wiki-lead {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--wiki-text-soft);
    font-size: calc(16px * var(--wiki-text-scale));
    line-height: 1.6;
}

.wiki-shell .wiki-lead code,
.wiki-shell .wiki-hint code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent-strong);
    font-size: 0.86em;
}

.wiki-shell .wiki-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    color: var(--wiki-text-muted);
    font-size: calc(13px * var(--wiki-text-scale));
}

.wiki-shell .wiki-muted {
    color: var(--wiki-text-muted);
}

.wiki-shell .wiki-hint {
    margin: 6px 0 0;
    color: var(--wiki-text-muted);
    font-size: calc(13px * var(--wiki-text-scale));
    line-height: 1.5;
}

/* Sekce a panely */
.wiki-shell .wiki-section {
    margin-top: 44px;
}

.wiki-shell .wiki-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.wiki-shell .wiki-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: calc(15px * var(--wiki-text-scale));
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.005em;
}

.wiki-shell .wiki-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent-strong);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

.wiki-shell .wiki-panel {
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius-lg);
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-xs);
    padding: clamp(18px, 3vw, 26px);
}

.wiki-shell .wiki-panel + .wiki-panel {
    margin-top: 16px;
}

.wiki-shell .wiki-panel-flush {
    padding: 0;
    overflow: hidden;
}

.wiki-shell .wiki-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.wiki-shell .wiki-panel-flush .wiki-panel-head {
    margin: 0;
    padding: 16px clamp(18px, 3vw, 26px);
    border-bottom: 1px solid var(--wiki-border);
}

.wiki-shell .wiki-panel-title {
    margin: 0;
    font-size: calc(15px * var(--wiki-text-scale));
    font-weight: 700;
    line-height: 1.4;
}

/* =========================================================
   Seznamy stránek
   ========================================================= */
.wiki-shell .wiki-list {
    margin: 0;
    padding: 4px;
    list-style: none;
    border: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius-lg);
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-xs);
}

.wiki-shell .wiki-list li + li {
    border-top: 1px solid var(--wiki-border);
}

.wiki-shell .wiki-list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--wiki-text);
}

.wiki-shell .wiki-list-link:hover {
    color: var(--wiki-text);
    background: var(--wiki-surface-muted);
}

.wiki-shell .wiki-list-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: var(--wiki-radius-sm);
    background: var(--wiki-surface-muted);
    color: var(--wiki-text-muted);
    font-size: calc(13px * var(--wiki-text-scale));
    box-shadow: inset 0 0 0 1px var(--wiki-border);
    transition: color var(--wiki-ease), background-color var(--wiki-ease);
}

.wiki-shell .wiki-list-link:hover .wiki-list-icon {
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent);
}

.wiki-shell .wiki-list-icon.is-star {
    color: var(--wiki-gold);
}

.wiki-shell .wiki-list-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    line-height: 1.35;
}

.wiki-shell .wiki-list-meta {
    flex: 0 0 auto;
    color: var(--wiki-text-muted);
    font-size: calc(13px * var(--wiki-text-scale));
    white-space: nowrap;
}

.wiki-shell .wiki-list-chevron {
    flex: 0 0 auto;
    color: var(--wiki-border-strong);
    font-size: 12px;
    transition: color var(--wiki-ease), transform var(--wiki-ease);
}

.wiki-shell .wiki-list-link:hover .wiki-list-chevron {
    color: var(--wiki-accent);
    transform: translateX(2px);
}

/* Prázdný stav */
.wiki-shell .wiki-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 44px 24px;
    border: 1px dashed var(--wiki-border-strong);
    border-radius: var(--wiki-radius-lg);
    color: var(--wiki-text-soft);
    text-align: center;
}

.wiki-shell .wiki-empty p {
    margin: 0;
}

.wiki-shell .wiki-empty strong {
    color: var(--wiki-text);
}

.wiki-shell .wiki-empty-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent);
    font-size: calc(18px * var(--wiki-text-scale));
}

/* =========================================================
   Tlačítka
   ========================================================= */
.wiki-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: calc(14px * var(--wiki-text-scale));
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    background-image: none;
    box-shadow: none;
    transform: none;
    transition: color var(--wiki-ease), background-color var(--wiki-ease), border-color var(--wiki-ease), box-shadow var(--wiki-ease);
}

.wiki-shell .btn i {
    font-size: calc(13px * var(--wiki-text-scale));
}

.wiki-shell .btn-sm {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 9px;
    font-size: calc(13px * var(--wiki-text-scale));
}

.wiki-shell .btn:focus {
    box-shadow: none;
}

.wiki-shell .btn:focus-visible {
    outline: none;
    box-shadow: var(--wiki-ring);
}

.wiki-shell .btn:disabled,
.wiki-shell .btn.disabled {
    opacity: 0.55;
}

/* Hlavní akce – tmavé tlačítko */
.wiki-shell .btn-primary,
.wiki-shell .btn-primary:focus {
    color: #fff;
    background-color: var(--wiki-text);
    border-color: var(--wiki-text);
    box-shadow: var(--wiki-shadow-xs);
}

.wiki-shell .btn-primary:hover,
.wiki-shell .btn-primary:active {
    color: #fff;
    background-color: var(--wiki-accent-strong);
    border-color: var(--wiki-accent-strong);
    box-shadow: 0 6px 16px -8px rgba(90, 62, 24, 0.6);
}

.wiki-shell .btn-primary:focus-visible {
    box-shadow: var(--wiki-ring);
}

/* Vedlejší akce – světlé tlačítko s rámečkem */
.wiki-shell .btn-outline-secondary,
.wiki-shell .btn-outline-secondary:focus {
    color: var(--wiki-text);
    background-color: var(--wiki-surface);
    border-color: var(--wiki-border-strong);
    box-shadow: var(--wiki-shadow-xs);
}

.wiki-shell .btn-outline-secondary:hover,
.wiki-shell .btn-outline-secondary:active {
    color: var(--wiki-text);
    background-color: var(--wiki-surface-muted);
    border-color: var(--wiki-border-hover);
}

.wiki-shell .btn-outline-secondary:focus-visible {
    box-shadow: var(--wiki-ring);
}

/* Textové tlačítko */
.wiki-shell .btn-link {
    color: var(--wiki-text-soft);
    background: transparent;
    text-decoration: none;
}

.wiki-shell .btn-link:hover {
    color: var(--wiki-text);
    background: var(--wiki-hover);
}

/* Nebezpečné akce */
.wiki-shell .btn-outline-danger,
.wiki-shell .btn-outline-danger:focus {
    color: var(--wiki-danger);
    background-color: var(--wiki-surface);
    border-color: var(--wiki-danger-border);
}

.wiki-shell .btn-outline-danger:hover,
.wiki-shell .btn-outline-danger:active {
    color: var(--wiki-danger-ink);
    background-color: var(--wiki-danger-bg);
    border-color: var(--wiki-danger-border);
}

.wiki-shell .btn-danger,
.wiki-shell .btn-danger:focus {
    color: #fff;
    background-color: var(--wiki-danger);
    border-color: var(--wiki-danger);
}

.wiki-shell .btn-danger:hover,
.wiki-shell .btn-danger:active {
    color: #fff;
    background-color: var(--wiki-danger-ink);
    border-color: var(--wiki-danger-ink);
}

.wiki-shell .btn-outline-danger:focus-visible,
.wiki-shell .btn-danger:focus-visible {
    box-shadow: var(--wiki-ring-danger);
}

/* Akce jen pro správce */
.wiki-shell .wiki-btn-admin,
.wiki-shell .wiki-btn-admin:focus {
    color: var(--wiki-admin);
    background-color: var(--wiki-admin-bg);
    border-color: var(--wiki-admin-border);
}

.wiki-shell .wiki-btn-admin:hover,
.wiki-shell .wiki-btn-admin:active {
    color: var(--wiki-admin);
    background-color: var(--wiki-admin-bg-strong);
    border-color: var(--wiki-admin-bg-strong);
}

/* Čtvercové tlačítko jen s ikonou */
.wiki-shell .wiki-btn-icon {
    width: 34px;
    min-height: 34px;
    padding: 0;
}

/* =========================================================
   Formuláře
   ========================================================= */
.wiki-shell .form-label {
    margin-bottom: 6px;
    color: var(--wiki-text);
    font-size: calc(13px * var(--wiki-text-scale));
    font-weight: 600;
}

.wiki-shell .form-control,
.wiki-shell .form-select {
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--wiki-border-strong);
    border-radius: 10px;
    background-color: var(--wiki-surface);
    color: var(--wiki-text);
    font-size: calc(15px * var(--wiki-text-scale));
    line-height: 1.45;
    box-shadow: var(--wiki-shadow-xs);
    transition: border-color var(--wiki-ease), box-shadow var(--wiki-ease);
}

.wiki-shell .form-control::placeholder {
    color: var(--wiki-text-muted);
    opacity: 1;
}

.wiki-shell .form-control:hover,
.wiki-shell .form-select:hover {
    border-color: var(--wiki-border-hover);
}

.wiki-shell .form-control:focus,
.wiki-shell .form-select:focus {
    border-color: var(--wiki-accent-soft);
    outline: none;
    box-shadow: var(--wiki-ring);
}

.wiki-shell .form-control.invalid,
.wiki-shell .form-select.invalid {
    border-color: var(--wiki-danger-border);
}

.wiki-shell .form-control.invalid:focus,
.wiki-shell .form-select.invalid:focus {
    border-color: var(--wiki-danger);
    box-shadow: var(--wiki-ring-danger);
}

/* Místo pro šipku výběru */
.wiki-shell .form-select {
    padding-right: 38px;
}

.wiki-shell .input-group > .form-control {
    box-shadow: none;
}

.wiki-shell .input-group-text {
    border: 1px solid var(--wiki-border-strong);
    border-radius: 10px;
    background: var(--wiki-surface-muted);
    color: var(--wiki-text-muted);
    font-size: calc(14px * var(--wiki-text-scale));
}

.wiki-shell .input-group:focus-within {
    border-radius: 10px;
    box-shadow: var(--wiki-ring);
}

.wiki-shell .input-group:focus-within .input-group-text,
.wiki-shell .input-group:focus-within .form-control {
    border-color: var(--wiki-accent-soft);
}

.wiki-shell .input-group .form-control:focus {
    box-shadow: none;
}

/* Pole s ikonou vlevo */
.wiki-shell .wiki-field-icon {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.wiki-shell .wiki-field-icon > i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: var(--wiki-text-muted);
    font-size: calc(14px * var(--wiki-text-scale));
    pointer-events: none;
    transform: translateY(-50%);
}

.wiki-shell .wiki-field-icon .form-control {
    padding-left: 40px;
}

.wiki-shell .validation-message {
    margin-top: 6px;
    color: var(--wiki-danger-ink);
    font-size: calc(13px * var(--wiki-text-scale));
}

.wiki-shell .validation-errors {
    margin: 0 0 18px;
    padding: 12px 16px 12px 34px;
    border: 1px solid var(--wiki-danger-border);
    border-radius: var(--wiki-radius);
    background: var(--wiki-danger-bg);
}

.wiki-shell .validation-errors .validation-message {
    margin: 0;
}

/* =========================================================
   Hlášky
   ========================================================= */
.wiki-shell .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--wiki-radius);
    font-size: calc(14px * var(--wiki-text-scale));
    line-height: 1.5;
}

.wiki-shell .alert > i {
    flex: 0 0 auto;
    margin-top: 3px;
}

/* Potvrzení je klidné a neutrální, aby se nepletlo s varováním */
.wiki-shell .alert-success {
    color: var(--wiki-text);
    background: var(--wiki-surface);
    border-color: var(--wiki-border);
    box-shadow: var(--wiki-shadow-sm);
}

.wiki-shell .alert-success > i {
    color: var(--wiki-accent);
}

.wiki-shell .alert-warning {
    color: var(--wiki-warning-ink);
    background: var(--wiki-warning-bg);
    border-color: var(--wiki-warning-border);
}

.wiki-shell .alert-warning > i {
    color: var(--wiki-gold-dark);
}

.wiki-shell .alert-danger {
    color: var(--wiki-danger-ink);
    background: var(--wiki-danger-bg);
    border-color: var(--wiki-danger-border);
}

/* =========================================================
   Tabulky, odznaky a akce formulářů ve správě
   ========================================================= */
.wiki-shell .wiki-table-wrap {
    overflow-x: auto;
}

.wiki-shell .wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: calc(14px * var(--wiki-text-scale));
}

.wiki-shell .wiki-table th {
    padding: 10px 16px;
    border-bottom: 1px solid var(--wiki-border);
    background: var(--wiki-surface-muted);
    color: var(--wiki-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.wiki-shell .wiki-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--wiki-border);
    color: var(--wiki-text-soft);
    vertical-align: middle;
    white-space: nowrap;
}

.wiki-shell .wiki-table td.wiki-table-wrap-text {
    min-width: 240px;
    white-space: normal;
}

/* Tabulka s více textovými sloupci se vejde na šířku stránky, text se zalamuje bez minimální šířky */
.wiki-shell .wiki-table-fit td.wiki-table-wrap-text {
    min-width: 0;
}

.wiki-shell .wiki-table tbody tr:first-child td {
    border-top: 0;
}

.wiki-shell .wiki-table tbody tr {
    transition: background-color var(--wiki-ease);
}

.wiki-shell .wiki-table tbody tr:hover {
    background: var(--wiki-surface-muted);
}

.wiki-shell .wiki-table th:first-child,
.wiki-shell .wiki-table td:first-child {
    padding-left: clamp(18px, 3vw, 26px);
}

.wiki-shell .wiki-table th:last-child,
.wiki-shell .wiki-table td:last-child {
    padding-right: clamp(18px, 3vw, 26px);
}

.wiki-shell .wiki-table code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--wiki-surface-muted);
    color: var(--wiki-text);
    font-size: calc(13px * var(--wiki-text-scale));
    letter-spacing: 0.06em;
    box-shadow: inset 0 0 0 1px var(--wiki-border);
}

.wiki-shell .wiki-table-title {
    color: var(--wiki-text);
    font-weight: 600;
}

.wiki-shell a.wiki-table-title:hover {
    color: var(--wiki-accent);
}

.wiki-shell .wiki-table-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiki-shell .wiki-table-identity {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.wiki-shell .wiki-table-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.wiki-shell .wiki-table-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wiki-shell .wiki-table-actions {
    text-align: right;
}

.wiki-shell .wiki-table-actions .btn + .btn {
    margin-left: 4px;
}

.wiki-shell .wiki-form-confirm {
    margin-right: 6px;
    color: var(--wiki-danger-ink);
    font-size: calc(13px * var(--wiki-text-scale));
    font-weight: 600;
}

.wiki-shell .wiki-panel-empty {
    margin: 0;
    padding: 22px clamp(18px, 3vw, 26px);
    color: var(--wiki-text-muted);
    font-size: calc(14px * var(--wiki-text-scale));
}

.wiki-shell .wiki-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--wiki-surface-muted);
    color: var(--wiki-text-soft);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    box-shadow: inset 0 0 0 1px var(--wiki-border);
}

.wiki-shell .wiki-badge i {
    font-size: 9px;
}

.wiki-shell .wiki-badge-admin {
    background: var(--wiki-admin-bg);
    color: var(--wiki-admin);
    box-shadow: inset 0 0 0 1px var(--wiki-admin-border);
}

.wiki-shell .wiki-badge-self {
    background: var(--wiki-accent-bg);
    color: var(--wiki-accent-strong);
    box-shadow: none;
}

/* Spodní lišta formuláře: mazání vlevo, uložení vpravo */
.wiki-shell .wiki-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.wiki-shell .wiki-form-actions-side,
.wiki-shell .wiki-form-actions-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wiki-shell .wiki-form-actions-main {
    margin-left: auto;
}

.wiki-shell .wiki-form-delete {
    color: var(--wiki-danger);
}

.wiki-shell .wiki-form-delete:hover {
    background: var(--wiki-danger-bg);
    color: var(--wiki-danger-ink);
}

.wiki-shell .wiki-form-delete:disabled {
    color: var(--wiki-text-muted);
}

/* Hláška po pádu spojení s Blazorem, zobrazí ji blazor.web.js */
.wiki-shell #blazor-error-ui {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1100;
    display: none;
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px;
    border: 1px solid var(--wiki-danger-border);
    border-radius: var(--wiki-radius);
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-md);
    color: var(--wiki-danger-ink);
    font-size: 14px;
    line-height: 1.5;
}

.wiki-shell #blazor-error-ui i {
    margin-right: 8px;
}

.wiki-shell #blazor-error-ui .reload {
    margin-left: 8px;
    color: var(--wiki-danger-ink);
    font-weight: 700;
    text-decoration: underline;
}

/* =========================================================
   Editor hromadných zpráv (Quill ve WikiMessageEditor)
   Prvky vytváří Quill v JS, proto styly nejsou ve scoped CSS.
   ========================================================= */
.wiki-shell .wiki-rich-editor {
    position: relative;
    border: 1px solid var(--wiki-border-strong);
    border-radius: var(--wiki-radius);
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-xs);
    transition: border-color var(--wiki-ease), box-shadow var(--wiki-ease);
}

.wiki-shell .wiki-rich-editor:hover {
    border-color: var(--wiki-border-hover);
}

.wiki-shell .wiki-rich-editor:focus-within {
    border-color: var(--wiki-accent-soft);
    box-shadow: var(--wiki-ring);
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 0;
    border-bottom: 1px solid var(--wiki-border);
    border-radius: var(--wiki-radius) var(--wiki-radius) 0 0;
    background: var(--wiki-surface-muted);
    font-family: inherit;
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow .ql-formats {
    display: flex;
    gap: 2px;
    margin: 0;
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow button {
    float: none;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: var(--wiki-radius-sm);
    transition: background-color var(--wiki-ease), box-shadow var(--wiki-ease);
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow button:hover {
    background: var(--wiki-hover);
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow button.ql-active {
    background: var(--wiki-accent-bg);
}

.wiki-shell .wiki-rich-editor .ql-toolbar.ql-snow button:focus-visible {
    outline: none;
    box-shadow: var(--wiki-ring);
}

.wiki-shell .wiki-rich-editor .ql-toolbar .ql-stroke {
    stroke: var(--wiki-text-soft);
}

.wiki-shell .wiki-rich-editor .ql-toolbar .ql-fill {
    fill: var(--wiki-text-soft);
}

.wiki-shell .wiki-rich-editor .ql-toolbar button:hover .ql-stroke,
.wiki-shell .wiki-rich-editor .ql-toolbar button:focus .ql-stroke,
.wiki-shell .wiki-rich-editor .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--wiki-accent-strong);
}

.wiki-shell .wiki-rich-editor .ql-toolbar button:hover .ql-fill,
.wiki-shell .wiki-rich-editor .ql-toolbar button:focus .ql-fill,
.wiki-shell .wiki-rich-editor .ql-toolbar button.ql-active .ql-fill {
    fill: var(--wiki-accent-strong);
}

.wiki-shell .wiki-rich-editor .ql-container.ql-snow {
    border: 0;
    font-family: inherit;
    font-size: calc(15px * var(--wiki-text-scale));
}

.wiki-shell .wiki-rich-editor .ql-editor {
    min-height: 280px;
    padding: 16px 20px;
    color: var(--wiki-text);
    line-height: 1.65;
}

/* Fokus ukazuje rámeček celého editoru, globální outline ze site.css by ho zdvojil */
.wiki-shell .wiki-rich-editor .ql-editor:focus-visible {
    outline: none;
}

.wiki-shell .wiki-rich-editor .ql-editor strong {
    font-weight: 700;
}

.wiki-shell .wiki-rich-editor .ql-editor a {
    color: var(--wiki-em);
    text-decoration: underline;
}

.wiki-shell .wiki-rich-editor .ql-editor.ql-blank::before {
    right: 20px;
    left: 20px;
    color: var(--wiki-text-muted);
    font-style: normal;
}

/* Bublina odkazu, texty přeložené do češtiny */
.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip {
    z-index: 5;
    padding: 6px 12px;
    border: 1px solid var(--wiki-border-strong);
    border-radius: 10px;
    background: var(--wiki-surface);
    box-shadow: var(--wiki-shadow-md);
    color: var(--wiki-text);
    font-size: 13px;
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip::before {
    content: "Odkaz:";
    color: var(--wiki-text-soft);
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip[data-mode=link]::before {
    content: "Adresa odkazu:";
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip a {
    color: var(--wiki-em);
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip a.ql-action::after {
    border-right-color: var(--wiki-border-strong);
    content: "Upravit";
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip a.ql-remove::before {
    content: "Odebrat";
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
    content: "Uložit";
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip input[type=text] {
    width: min(300px, 55vw);
    height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--wiki-border-strong);
    border-radius: var(--wiki-radius-sm);
    color: var(--wiki-text);
    font-size: 13px;
}

.wiki-shell .wiki-rich-editor .ql-snow .ql-tooltip input[type=text]:focus {
    border-color: var(--wiki-accent-soft);
    outline: none;
    box-shadow: var(--wiki-ring);
}

/* =========================================================
   Mobil
   ========================================================= */
@media (max-width: 767.98px) {
    .wiki-shell {
        display: block;
    }

    .wiki-sidebar {
        position: sticky;
        z-index: 20;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 14px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--wiki-border);
        background: rgba(247, 244, 238, 0.94);
        backdrop-filter: saturate(1.4) blur(10px);
    }

    .wiki-shell .wiki-brand {
        padding: 2px;
    }

    .wiki-brand-sub,
    .wiki-user,
    .wiki-nav-label > span:not(.wiki-nav-badge),
    .wiki-nav-group:not(.wiki-nav-admin) .wiki-nav-label,
    .wiki-nav-secondary span {
        display: none;
    }

    .wiki-nav-groups {
        order: 3;
        display: flex;
        gap: 8px;
        width: calc(100% + 28px);
        margin: 0 -14px;
        padding: 2px 14px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .wiki-nav-groups::-webkit-scrollbar {
        display: none;
    }

    .wiki-nav-group {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
    }

    .wiki-nav {
        display: flex;
        gap: 4px;
    }

    .wiki-shell .wiki-nav a {
        min-height: 34px;
        padding: 6px 11px;
        font-size: 13px;
        white-space: nowrap;
    }

    .wiki-nav-admin {
        padding: 3px;
        border-radius: 11px;
    }

    .wiki-nav-admin .wiki-nav-label {
        margin: 0;
        padding: 0 4px 0 8px;
    }

    .wiki-nav-badge {
        display: none;
    }

    .wiki-sidebar-footer {
        display: flex;
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
    }

    .wiki-nav-secondary {
        display: flex;
    }

    .wiki-shell .wiki-nav-secondary a {
        justify-content: center;
        width: 36px;
        min-height: 36px;
        padding: 0;
    }

    .wiki-main {
        padding: 28px 18px 48px;
    }

    .wiki-shell .wiki-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .wiki-shell .wiki-list-link {
        flex-wrap: wrap;
        row-gap: 2px;
    }

    .wiki-shell .wiki-list-meta {
        order: 4;
        width: 100%;
        padding-left: 42px;
    }

    .wiki-shell .wiki-list-chevron {
        display: none;
    }

    /* Řádky tabulek ve správě se skládají do karet */
    .wiki-shell .wiki-table thead {
        display: none;
    }

    .wiki-shell .wiki-table,
    .wiki-shell .wiki-table tbody,
    .wiki-shell .wiki-table tr {
        display: block;
        width: 100%;
    }

    .wiki-shell .wiki-table tr {
        padding: 14px 18px;
        border-top: 1px solid var(--wiki-border);
    }

    .wiki-shell .wiki-table tbody tr:first-child {
        border-top: 0;
    }

    .wiki-shell .wiki-table td:nth-child(n) {
        display: block;
        min-width: 0;
        padding: 2px 0;
        border: 0;
        font-size: calc(13px * var(--wiki-text-scale));
        white-space: normal;
    }

    .wiki-shell .wiki-table-avatar td:nth-child(n) {
        padding-left: 42px;
    }

    .wiki-shell .wiki-table td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--wiki-text-muted);
    }

    .wiki-shell .wiki-table td:first-child:nth-child(n) {
        padding-left: 0;
        margin-bottom: 4px;
        font-size: calc(14px * var(--wiki-text-scale));
    }

    .wiki-shell .wiki-table td.wiki-table-actions:nth-child(n) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        padding-top: 10px;
        text-align: left;
    }

    .wiki-shell .wiki-table-actions .btn + .btn {
        margin-left: 0;
    }

    .wiki-shell .wiki-form-actions-main {
        width: 100%;
    }

    .wiki-shell .wiki-form-actions-main .btn {
        flex: 1 1 0;
    }
}
