/* Global page-load skeleton (all pages except wizard) */
#hh-page-skeleton {
    display: none;
}

html.hh-page-loading #hh-page-skeleton {
    display: block;
    width: 100%;
}

html.hh-page-loading #hh-page-content {
    display: none;
}

html.hh-page-loading[data-hh-layout="listings"] #hh-page-content,
html.hh-page-loading[data-hh-layout="detail"] #property-detail-content {
    display: none;
}

html.hh-page-loading[data-hh-layout="listings"] #hh-page-skeleton,
html.hh-page-loading[data-hh-layout="detail"] #hh-page-skeleton {
    display: none;
}

.hh-page-skeleton--auth,
.hh-page-skeleton--dashboard,
.hh-page-skeleton--profile,
.hh-page-skeleton--form,
.hh-page-skeleton--mobilier {
    display: none;
}

html.hh-page-loading body[data-hh-skeleton="auth"] .hh-page-skeleton--auth,
html.hh-page-loading body[data-hh-skeleton="dashboard"] .hh-page-skeleton--dashboard,
html.hh-page-loading body[data-hh-skeleton="profile"] .hh-page-skeleton--profile,
html.hh-page-loading body[data-hh-skeleton="form"] .hh-page-skeleton--form,
html.hh-page-loading body[data-hh-skeleton="mobilier"] .hh-page-skeleton--mobilier {
    display: block;
}

/* Auth / form card skeleton */
.hh-skeleton-block--auth-card {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
    padding: 2rem 1.75rem;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #ddd;
    box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.hh-skeleton-block--auth-title {
    height: 26px;
    width: 62%;
}

.hh-skeleton-block--auth-subtitle {
    height: 14px;
    width: 78%;
    margin-bottom: 4px;
}

.hh-skeleton-block--auth-field {
    height: 44px;
    border-radius: 10px;
}

.hh-skeleton-block--auth-btn {
    height: 44px;
    border-radius: 10px;
    margin-top: 4px;
}

.hh-skeleton-block--auth-btn-secondary {
    width: 100%;
}

.hh-skeleton-block--auth-divider {
    height: 1px;
    width: 100%;
    border-radius: 0;
    margin: 4px 0;
}

/* Dashboard skeleton (account, agency, staff) */
.hh-page-skeleton--dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 960px;
    margin-inline: auto;
    padding: 0 1rem 2rem;
    box-sizing: border-box;
}

.hh-skeleton-block--dash-back {
    height: 18px;
    width: 140px;
}

.hh-page-skeleton__dash-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hh-skeleton-block--dash-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hh-page-skeleton__dash-header-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hh-skeleton-block--dash-title {
    height: 24px;
    width: min(70%, 280px);
}

.hh-skeleton-block--dash-subtitle {
    height: 14px;
    width: min(90%, 360px);
}

.hh-page-skeleton__dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hh-skeleton-block--dash-tab {
    height: 36px;
    width: 96px;
    border-radius: 999px;
}

.hh-page-skeleton__dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.hh-skeleton-block--dash-stat {
    height: 72px;
    border-radius: 12px;
}

.hh-skeleton-block--dash-toolbar {
    height: 44px;
    border-radius: 10px;
}

.hh-page-skeleton__dash-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hh-skeleton-block--dash-row {
    height: 76px;
    border-radius: 12px;
}

/* Agency public profile */
.hh-page-skeleton--profile {
    max-width: 1100px;
    margin-inline: auto;
    padding: 0 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hh-page-skeleton__profile-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.hh-skeleton-block--profile-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hh-page-skeleton__profile-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}

.hh-skeleton-block--profile-name {
    height: 28px;
    width: min(60%, 320px);
}

.hh-skeleton-block--profile-location {
    height: 16px;
    width: min(50%, 240px);
}

.hh-skeleton-block--profile-bio {
    height: 48px;
    width: 100%;
    border-radius: 10px;
}

.hh-page-skeleton__profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hh-skeleton-block--profile-card {
    height: 220px;
    border-radius: 10px;
}

/* Mobilier preview */
.hh-page-skeleton--mobilier {
    max-width: 1200px;
    margin-inline: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hh-skeleton-block--mobilier-banner {
    height: 52px;
    border-radius: 10px;
}

.hh-skeleton-block--mobilier-title {
    height: 32px;
    width: min(50%, 320px);
}

.hh-page-skeleton__mobilier-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hh-skeleton-block--mobilier-chip {
    height: 34px;
    width: 88px;
    border-radius: 999px;
}

/* Dashboard layouts with site header */
body.hh-dashboard-layout #hh-page-skeleton {
    margin-top: calc(var(--header-h, 88px) + 12px);
}

body.hh-dashboard-layout.st-body #hh-page-skeleton,
body.st-body #hh-page-skeleton {
    margin-top: 12px;
}

body.ap-profile-page #hh-page-skeleton {
    margin-top: calc(var(--header-h, 88px) + 8px);
}

@media (max-width: 900px) {
    .hh-page-skeleton__dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hh-page-skeleton__profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .hh-page-skeleton__profile-grid {
        grid-template-columns: 1fr;
    }

    .hh-page-skeleton__profile-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hh-page-skeleton__profile-meta {
        align-items: center;
        width: 100%;
    }

    .hh-skeleton-block--profile-name,
    .hh-skeleton-block--profile-location {
        margin-inline: auto;
    }
}
