:root {
    --wiki-brand: #b53659;
    --wiki-text: #14121f;
    --wiki-muted: #787087;
    --wiki-page-background: var(--za-app-page-background, linear-gradient(100deg, #f4f2fd 18.7%, #ebe6fc 93.1%));
    --wiki-header-content-height: 60px;
    --wiki-safe-area-top: env(safe-area-inset-top, 0px);
}

html,
body {
    min-height: 100%;
}

#navbar {
    height: calc(var(--wiki-header-content-height) + var(--wiki-safe-area-top)) !important;
    min-height: calc(var(--wiki-header-content-height) + var(--wiki-safe-area-top)) !important;
    padding-top: var(--wiki-safe-area-top);
    padding-bottom: 0;
}

.wiki-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 77px 188px;
    gap: 8px;
    width: 100%;
    height: var(--wiki-header-content-height);
    margin: 0 auto;
    padding: 8px 14px 8px 18px;
    align-items: center;
}

.wiki-header__title {
    margin: 0;
    color: var(--wiki-brand);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.wiki-filter__category,
.wiki-filter__search {
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.78);
}

.wiki-filter__category {
    position: relative;
    overflow: hidden;
}

.wiki-filter__category select {
    width: 100%;
    height: 100%;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0 26px 0 11px;
    color: var(--wiki-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 17px;
    outline: none;
}

.wiki-filter__category i {
    position: absolute;
    top: 50%;
    right: 8px;
    color: var(--wiki-muted);
    font-size: 15px;
    pointer-events: none;
    transform: translateY(-50%);
}

.wiki-filter__search {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    padding: 0 11px;
}

.wiki-filter__search button {
    display: grid;
    width: 15px;
    height: 30px;
    flex: 0 0 15px;
    place-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--wiki-muted);
}

.wiki-filter__search button i {
    font-size: 15px;
}

.wiki-filter__search input {
    width: 100%;
    min-width: 0;
    height: 30px;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--wiki-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 17px;
    outline: none;
}

.wiki-filter__search input::placeholder {
    color: var(--wiki-muted);
    opacity: 1;
}

.wiki-filter__search input::-webkit-search-cancel-button {
    width: 12px;
    height: 12px;
}

.wiki-page {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    background: transparent !important;
    padding: calc(var(--wiki-header-content-height) + var(--wiki-safe-area-top) + 8px) 7px calc(max(14px, env(safe-area-inset-bottom)) + 68px);
}

.wiki-status {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--wiki-muted);
    font-size: 10px;
    text-align: center;
}

.wiki-status--error {
    color: var(--wiki-brand);
}

.wiki-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 6px;
}

.wiki-card {
    display: grid;
    grid-template-rows: auto 17px 26px;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #fff;
    padding: 5px 5px 10px;
    box-shadow: 0 8px 16px rgba(89, 46, 115, 0.07);
    color: inherit;
    text-align: left;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.wiki-card:active {
    transform: scale(0.98);
}

.wiki-card:focus-visible {
    outline: 2px solid var(--wiki-brand);
    outline-offset: 2px;
}

.wiki-card__media {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 0.3px solid rgba(178, 178, 178, 0.8);
    border-radius: 11px;
    background: linear-gradient(145deg, #f1edf7, #e7e1f2);
    color: var(--wiki-brand);
}

.wiki-card__image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wiki-card__fallback {
    position: absolute;
    font-size: 24px;
}

.wiki-card__title {
    display: block;
    min-width: 0;
    overflow: hidden;
    align-self: end;
    color: var(--wiki-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-card__summary {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    color: var(--wiki-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 13px;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.wiki-detail__body {
    color: #3f3940;
    font-size: 14px;
    line-height: 1.8;
    padding: 72px 20px max(28px, env(safe-area-inset-bottom));
    overflow-wrap: anywhere;
}

.wiki-detail__body img,
.wiki-detail__body video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 12px;
}

.wiki-detail__body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.wiki-detail__body th,
.wiki-detail__body td {
    border: 1px solid #ddd5d9;
    padding: 6px 8px;
}

.wiki-detail__body pre {
    overflow-x: auto;
    border-radius: 10px;
    background: #f5f2f3;
    padding: 12px;
}

.wiki-detail__body blockquote {
    margin: 14px 0;
    border-left: 4px solid var(--wiki-brand);
    background: #f8f2f4;
    padding: 10px 12px;
}

.wiki-detail__loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    color: var(--wiki-brand);
}

@media (min-width: 576px) {
    .wiki-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .wiki-list {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .wiki-list {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}

@media (max-width: 374px) {
    .wiki-header {
        grid-template-columns: minmax(78px, 1fr) 70px minmax(0, 1fr);
        gap: 5px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .wiki-page {
        padding-right: 5px;
        padding-left: 5px;
    }

    .wiki-list {
        gap: 5px;
    }

    .wiki-card {
        padding: 4px 4px 9px;
    }
}