[x-cloak] {
    display: none !important;
}

/* --- Mobile-first PWA shell --- */
:root {
    --mobile-tab-height: 3.75rem;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

.app-shell {
    -webkit-tap-highlight-color: transparent;
}

.app-main {
    padding-bottom: calc(var(--mobile-tab-height) + var(--safe-bottom) + 0.5rem);
}

@media (min-width: 768px) {
    .app-main {
        padding-bottom: 0;
    }
}

.safe-top {
    padding-top: var(--safe-top);
}

.safe-bottom-footer {
    padding-bottom: var(--safe-bottom);
}

.site-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
}

@media (min-width: 768px) {
    .site-container {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1280px) {
    .site-container {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

.section-padding {
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Bottom tab bar (primary nav on phone) */
.mobile-tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(var(--mobile-tab-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-tab-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: var(--mobile-tab-height);
    padding: 0.35rem 0.5rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.15s;
}

.mobile-tab-bar__item--active {
    color: var(--color-black);
}

.mobile-tab-bar__item--active .mobile-tab-bar__icon {
    stroke: var(--color-black);
}

.mobile-tab-bar__icon {
    width: 1.375rem;
    height: 1.375rem;
    stroke: var(--color-text-muted);
}

.mobile-tab-bar__item--active .mobile-tab-bar__heart-path {
    fill: var(--color-black);
    stroke: var(--color-black);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-link:hover {
    color: #fff;
}

.tap-target {
    min-width: 44px;
    min-height: 44px;
}

.form-input-brand {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem; /* prevents iOS zoom on focus */
    border: 1.5px solid var(--color-border);
    border-radius: 2px;
    background: #fff;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s;
}

.form-input-brand:focus {
    border-color: var(--color-black);
}

.form-input-brand::placeholder {
    color: #9ca3af;
}

@media (min-width: 768px) {
    .form-input-brand {
        font-size: 0.9375rem;
        padding: 0.75rem 1rem;
    }
}

.btn-mobile-full {
    width: 100%;
}

@media (min-width: 768px) {
    .btn-mobile-full {
        width: auto;
    }
}

.section-header-mobile {
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .section-header-mobile {
        margin-bottom: 3rem;
    }
}

.video-grid-mobile {
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .video-grid-mobile {
        gap: 2rem;
    }
}

.back-link-mobile {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link-header {
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: opacity 0.2s;
}

.nav-link-header:hover {
    opacity: 0.7;
}

.nav-link-header--active {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.prose-brand {
    color: #444444;
    max-width: none;
    line-height: 1.7;
}

.prose-brand a {
    color: var(--color-black);
}

.prose-brand h2,
.prose-brand h3,
.prose-brand h4 {
    color: var(--color-black);
}

/* Search results loading */
.search-loading {
    margin-bottom: 2rem;
}

.search-loading__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.search-loading__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.search-loading__spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-black);
    border-radius: 50%;
    animation: tuf-spin 0.7s linear infinite;
}

.search-loading__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .search-loading__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .search-loading__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.search-loading__card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-loading__thumb {
    aspect-ratio: 3 / 2;
    background: var(--color-offwhite);
    animation: tuf-shimmer 1.4s ease-in-out infinite;
}

.search-loading__line {
    height: 0.875rem;
    width: 85%;
    background: var(--color-offwhite);
    animation: tuf-shimmer 1.4s ease-in-out infinite;
    animation-delay: 0.15s;
}

.search-loading__line--short {
    width: 35%;
    animation-delay: 0s;
}

.search-loading__card:nth-child(2) .search-loading__thumb,
.search-loading__card:nth-child(2) .search-loading__line {
    animation-delay: 0.2s;
}

.search-loading__card:nth-child(3) .search-loading__thumb,
.search-loading__card:nth-child(3) .search-loading__line {
    animation-delay: 0.35s;
}

@keyframes tuf-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tuf-shimmer {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

/* Favorite heart button */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-black);
    transition: color 0.2s, transform 0.15s;
}

.favorite-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.favorite-btn--overlay {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    z-index: 10;
    min-width: 44px;
    min-height: 44px;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.favorite-btn--overlay:hover {
    transform: scale(1.06);
}

.favorite-btn__heart {
    transition: fill 0.2s, stroke 0.2s;
}

.favorite-btn--active .favorite-btn__heart {
    fill: var(--color-black);
    stroke: var(--color-black);
}

.favorite-btn--active {
    color: var(--color-black);
}

.video-card__therapeutic {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.45;
}
