html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: pan-y manipulation;
}

body {
    background: #ffffff;
    min-width: 320px;
}

#app {
    background: #f9fafb;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(env(safe-area-inset-top) + 0.62rem) 0.82rem 0.72rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    z-index: 30;
}

.header-inline {
    display: block;
    width: 100%;
    min-width: 0;
}

.header-inline-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.58rem;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.app-brand {
    gap: 0.55rem;
    min-width: 0;
    width: 100%;
    flex: none;
}

.app-brand-logo-image {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.72rem;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.app-brand-title {
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.header-inline-divider {
    display: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.34rem;
    align-items: center;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.14rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.breadcrumb::-webkit-scrollbar {
    display: none;
}

.breadcrumb-buttons {
    row-gap: 0;
}

.breadcrumb-chip {
    min-height: 2.7rem;
    padding: 0.72rem 0.96rem;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.10);
    flex: 0 0 auto;
}

.breadcrumb-chip.is-current {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.breadcrumb-separator {
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.admin-badge {
    display: none !important;
}

.app-footer {
    display: none !important;
}

#main-view {
    padding: calc(env(safe-area-inset-top) + 8.8rem) 0.78rem 1rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    border-radius: 999px;
}

.btn.outline {
    padding-inline: 0.9rem;
}

.view-header {
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.view-header h1 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.view-header.view-header-actions {
    justify-content: flex-end;
}

.card-grid {
    gap: 0.75rem;
}

.card {
    border-radius: 0.9rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    min-height: 8rem;
    transform: none !important;
}

.card:hover {
    transform: none !important;
}

.card-cover {
    padding-top: var(--card-aspect, 70%);
}

.card-cover-media {
    object-fit: cover;
}

.card-body {
    padding: 0.6rem 0.7rem 0.7rem;
}

.card-body h2 {
    font-size: 0.9rem;
    line-height: 1.2;
}

.card-body p {
    display: none;
}

.card-admin-controls button {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.75rem;
}

.modal-dialog {
    margin: 0.75rem;
    padding: 1.15rem 1.1rem 1rem;
    border-radius: 0.9rem;
}

.modal-dialog h2 {
    font-size: 1rem;
}

.form-grid {
    gap: 0.6rem;
}

.form-row label {
    font-size: 0.8rem;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0 0 0.85rem 0;
    width: 100%;
    align-items: stretch;
}

.filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.72rem;
    border: 1px solid #dbe4ef;
    border-radius: 0.95rem;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.filter-group-label {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    margin: 0;
}

.filter-select {
    width: 100%;
    min-width: 0;
    font-size: 0.88rem;
    padding: 0.68rem 2.1rem 0.68rem 0.82rem;
    border-radius: 0.82rem;
    border: 1px solid #d8e1eb;
    background-position: right 0.75rem center;
    background-size: 0.75rem 0.75rem;
}

.filter-group .filter-select + .filter-group-label {
    margin-top: 0.15rem;
    padding-top: 0.35rem;
    border-top: 1px dashed #dbe4ef;
}

.filter-reset-btn {
    width: 100%;
    margin-left: 0;
    min-height: 2.8rem;
    font-size: 0.86rem;
    justify-content: center;
}

.lightbox-content {
    padding: 0;
}

.lightbox-close {
    right: 0.7rem;
    top: 0.6rem;
    font-size: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.lightbox-nav {
    font-size: 2.5rem;
    width: 4rem;
    height: 4rem;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.lightbox-prev {
    left: 0.45rem;
}

.lightbox-next {
    right: 0.45rem;
}

.toast {
    bottom: 1rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
}

.gallery-card.video .card-cover::after {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .app-header {
        padding: calc(env(safe-area-inset-top) + 0.6rem) 0.8rem 0.7rem;
    }

    #main-view {
        padding: calc(env(safe-area-inset-top) + 8.6rem) 0.76rem 0.95rem;
    }

    .lightbox-close {
        width: 3.7rem;
        height: 3.7rem;
        font-size: 2.1rem;
    }

    .lightbox-nav {
        width: 4.2rem;
        height: 4.2rem;
        font-size: 2.65rem;
    }
}

@media (max-width: 480px) {
    .app-brand-title {
        font-size: 0.93rem;
    }

    .breadcrumb-chip {
        min-height: 2.64rem;
        font-size: 0.79rem;
        padding: 0.68rem 0.9rem;
    }

    #main-view {
        padding: calc(env(safe-area-inset-top) + 8.35rem) 0.72rem 0.88rem;
    }

    .filter-group {
        padding: 0.66rem;
    }

    .filter-select {
        font-size: 0.86rem;
    }

    .lightbox-close {
        right: 0.45rem;
        top: 0.45rem;
        width: 3.8rem;
        height: 3.8rem;
    }

    .lightbox-nav {
        width: 4.35rem;
        height: 4.35rem;
        font-size: 2.8rem;
    }

    .lightbox-prev {
        left: 0.2rem;
    }

    .lightbox-next {
        right: 0.2rem;
    }
}