/* Layout matching skeletons for browse, statistics, survey and guestbook pages. */
#opac-content-skeleton.theme-page-skeleton {
    --catalog-skeleton-accent: #b8c1c9;
    --catalog-skeleton-soft: #e7ebee;
    box-sizing: border-box;
    padding: 104px 20px 76px;
    overflow: hidden;
    background: #f4f7fa;
}

#opac-content-skeleton.theme-page-skeleton,
#opac-content-skeleton.theme-page-skeleton * { box-sizing: border-box; }

body[data-theme="rain"] #opac-content-skeleton.theme-page-skeleton,
body[data-theme="finexy"] #opac-content-skeleton.theme-page-skeleton {
    --catalog-skeleton-accent: #b8c1c9;
    --catalog-skeleton-soft: #e7ebee;
}

body[data-theme="zavier"] #opac-content-skeleton.theme-page-skeleton {
    --catalog-skeleton-accent: #b8c1c9;
    --catalog-skeleton-soft: #e7ebee;
    padding: 2rem;
    background: #f4f6f7;
}

.theme-skeleton-shell { width: 100%; max-width: 1180px; margin: 0 auto; }
.theme-skeleton--guest-location .theme-skeleton-shell { max-width: 720px; }
.theme-skeleton--survey-list .theme-skeleton-shell { max-width: 1380px; }
.theme-skeleton--guestbook-member .theme-skeleton-shell,
.theme-skeleton--guestbook-public .theme-skeleton-shell,
.theme-skeleton--guestbook-group .theme-skeleton-shell { max-width: 1100px; padding-inline: 20px; }
body[data-theme="rain"] .theme-skeleton-shell,
body[data-theme="finexy"] .theme-skeleton-shell { max-width: none; padding-inline: 30px; }
body[data-theme="zavier"] .theme-skeleton-shell { max-width: 1380px; padding-inline: 0; }

.theme-skeleton-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    margin-bottom: 16px;
    padding: 16px 20px;
    border: 1px solid #e0e8ef;
    border-radius: 18px;
    border-top: 3px solid var(--catalog-skeleton-accent, #2463d7);
    background: #fff;
}
.theme-skeleton-heading > span { display: grid; flex: 1; gap: 9px; }
.theme-skeleton-icon { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; background: var(--catalog-skeleton-soft, #eaf1ff); }
.theme-skeleton-title { width: min(340px, 55%); height: 22px; }
.theme-skeleton-subtitle { width: min(460px, 72%); height: 13px; }
.theme-skeleton-stat { width: 96px; height: 30px; border-radius: 999px; }
.theme-skeleton-print { width: 42px; height: 42px; border-radius: 12px; }
.theme-skeleton-panel { min-width: 0; padding: 20px; border: 1px solid #e0e8ef; border-radius: 16px; background: #fff; }
.theme-skeleton-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.theme-skeleton-kpis > .theme-skeleton-panel { display: flex; align-items: center; gap: 13px; min-height: 98px; }
.theme-skeleton-kpis > .theme-skeleton-panel > span { display: grid; flex: 1; gap: 9px; }
.theme-skeleton-kpis > .theme-skeleton-panel > span i:first-child { width: 58%; height: 12px; }
.theme-skeleton-kpis > .theme-skeleton-panel > span i:last-child { width: 78%; height: 20px; }
.theme-skeleton-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.theme-skeleton-toolbar > i { width: 140px; height: 18px; }
.theme-skeleton-toolbar > i:first-child { width: min(260px, 55%); }
.theme-skeleton-columns { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.theme-skeleton-sidebar { display: grid; gap: 14px; min-height: 360px; align-content: start; }
.theme-skeleton-sidebar i { height: 16px; }
.theme-skeleton-sidebar i:first-child { width: 65%; height: 21px; margin-bottom: 4px; }
.theme-skeleton-results { min-height: 390px; }
.theme-skeleton-results > .theme-skeleton-toolbar { margin: 0 0 18px; }
.theme-skeleton-book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.theme-skeleton-book-grid article { display: flex; min-width: 0; min-height: 146px; gap: 11px; padding: 11px; border: 1px solid #e7edf2; border-radius: 12px; background: #fbfcfd; }
.theme-skeleton-book-grid article > i { flex: 0 0 66px; width: 66px; height: 100px; border-radius: 8px; background: var(--catalog-skeleton-soft, #eaf1ff); }
.theme-skeleton-book-grid article > span { display: grid; flex: 1; align-content: start; gap: 9px; padding-top: 4px; }
.theme-skeleton-book-grid article > span i { height: 12px; }
.theme-skeleton-book-grid article > span i:first-child { width: 90%; height: 16px; }
.theme-skeleton-book-grid article > span i:last-child { width: 58%; }

.theme-skeleton-form-card { max-width: 920px; margin-inline: auto; }
.theme-skeleton-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #e4eaf0; }
.theme-skeleton-section-title i:first-child { width: 44px; height: 44px; border-radius: 13px; }
.theme-skeleton-section-title i:last-child { width: min(300px, 55%); height: 21px; }
.theme-skeleton-label { width: 34%; height: 14px; margin-bottom: 9px; }
.theme-skeleton-input { width: 100%; height: 44px; margin-bottom: 18px; border: 1px solid #e0e8ef; border-radius: 10px; }
.theme-skeleton-help { width: 72%; height: 12px; margin: -8px 0 20px; }
.theme-skeleton-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.theme-skeleton-form-grid > div { min-width: 0; }
.theme-skeleton-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.theme-skeleton-actions i { width: 132px; height: 42px; border-radius: 10px; }
.theme-skeleton-actions i:last-child { width: 106px; }
.theme-skeleton-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; padding: 8px; border: 1px solid #e0e8ef; border-radius: 14px; background: #fff; }
.theme-skeleton-tabs i { height: 44px; border-radius: 10px; }
.theme-skeleton-stat-nav { display: flex; gap: 9px; margin-bottom: 16px; padding: 7px; overflow: hidden; border: 1px solid #e0e8ef; border-radius: 14px; background: #fff; }
.theme-skeleton-stat-nav i { flex: 1 0 130px; height: 44px; border-radius: 10px; }
.theme-skeleton-filter { margin-bottom: 16px; }
.theme-skeleton-filter > div { display: flex; align-items: end; gap: 14px; }
.theme-skeleton-filter > div > span { display: grid; flex: 0 1 220px; gap: 8px; }
.theme-skeleton-filter > div > span i:first-child { width: 42%; height: 12px; }
.theme-skeleton-filter > div > span i:last-child { height: 42px; border: 1px solid #e0e8ef; }
.theme-skeleton-filter-button { width: 112px; height: 42px; }
.theme-skeleton-presets { width: min(480px, 60%); height: 14px; margin-top: 17px; }
.theme-skeleton-number { width: 70%; height: 25px !important; }
.theme-skeleton-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.theme-skeleton-chart-grid > section { min-height: 265px; }
.theme-skeleton-chart { display: flex; align-items: end; justify-content: space-around; gap: 8%; height: 175px; padding: 16px 10px 0; border-bottom: 1px solid #e0e8ef; background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #edf1f5 43px, transparent 44px); }
.theme-skeleton-chart i { width: 10%; height: 55%; border-radius: 7px 7px 0 0; background: var(--catalog-skeleton-soft, #eaf1ff); }
.theme-skeleton-chart i:nth-child(2) { height: 78%; }
.theme-skeleton-chart i:nth-child(3) { height: 43%; }
.theme-skeleton-chart i:nth-child(4) { height: 88%; }
.theme-skeleton-chart i:nth-child(5) { height: 65%; }
.theme-skeleton-survey article { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 14px 4px; border-bottom: 1px solid #edf1f5; }
.theme-skeleton-survey article:last-child { border-bottom: 0; }
.theme-skeleton-survey article > span { display: grid; flex: 1; gap: 9px; }
.theme-skeleton-survey article > span i:first-child { width: 66%; height: 16px; }
.theme-skeleton-survey article > span i:nth-child(2) { width: 92%; height: 12px; }
.theme-skeleton-survey article > span i:last-child { width: 34%; height: 11px; }
.theme-skeleton-arrow { width: 30px; height: 30px; border-radius: 50%; }
.theme-skeleton-guest-card { max-width: 1100px; margin-inline: auto; }
.theme-skeleton--guestbook-member,
.theme-skeleton--guestbook-public,
.theme-skeleton--guestbook-group { padding-inline: 0 !important; }
.theme-skeleton-guest-card .theme-skeleton-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-skeleton-table { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid #e0e8ef; border-radius: 10px; background: #e0e8ef; }
.theme-skeleton-table i { height: 40px; background: #fff; }
.theme-skeleton-table i:first-child { grid-column: 1 / -1; height: 44px; background: var(--catalog-skeleton-soft, #eaf1ff); }

@media (max-width: 991.98px) {
    .theme-skeleton-columns { grid-template-columns: 1fr; }
    .theme-skeleton-sidebar { display: none; }
    .theme-skeleton-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .theme-skeleton-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    #opac-content-skeleton.theme-page-skeleton { padding: 76px 5px calc(92px + env(safe-area-inset-bottom)); }
    body[data-theme="zavier"] #opac-content-skeleton.theme-page-skeleton { padding: 1.1rem 0 calc(6.5rem + env(safe-area-inset-bottom)); }
    body[data-theme="rain"] #opac-content-skeleton.theme-page-skeleton,
    body[data-theme="finexy"] #opac-content-skeleton.theme-page-skeleton { padding-top: 76px; }
    .theme-skeleton-shell,
    body[data-theme="rain"] .theme-skeleton-shell,
    body[data-theme="finexy"] .theme-skeleton-shell { padding-inline: 5px; }
    body[data-theme="zavier"] .theme-skeleton-shell { padding-inline: 0; }
    .theme-skeleton--guest-location { padding: 76px 12px calc(92px + env(safe-area-inset-bottom)) !important; }
    .theme-skeleton--guestbook-member,
    .theme-skeleton--guestbook-public,
    .theme-skeleton--guestbook-group { padding: 80px 0 calc(100px + env(safe-area-inset-bottom)) !important; }
    body[data-theme="rain"] .theme-skeleton--guestbook-member .theme-skeleton-shell,
    body[data-theme="rain"] .theme-skeleton--guestbook-public .theme-skeleton-shell,
    body[data-theme="rain"] .theme-skeleton--guestbook-group .theme-skeleton-shell,
    body[data-theme="finexy"] .theme-skeleton--guestbook-member .theme-skeleton-shell,
    body[data-theme="finexy"] .theme-skeleton--guestbook-public .theme-skeleton-shell,
    body[data-theme="finexy"] .theme-skeleton--guestbook-group .theme-skeleton-shell { padding-inline: 14px; }
    .theme-skeleton--guestbook-member .theme-skeleton-shell,
    .theme-skeleton--guestbook-public .theme-skeleton-shell,
    .theme-skeleton--guestbook-group .theme-skeleton-shell { padding-inline: 14px; }
    body[data-theme="zavier"] .theme-skeleton--guestbook-member,
    body[data-theme="zavier"] .theme-skeleton--guestbook-public,
    body[data-theme="zavier"] .theme-skeleton--guestbook-group,
    body[data-theme="zavier"] .theme-skeleton--guest-location { padding: 1.1rem 12px calc(6.5rem + env(safe-area-inset-bottom)) !important; }
    .theme-skeleton-heading { min-height: 68px; gap: 9px; margin-bottom: 12px; padding: 12px; border-radius: 14px; }
    .theme-skeleton-icon { flex-basis: 40px; width: 40px; height: 40px; }
    .theme-skeleton-title { width: 72%; height: 19px; }
    .theme-skeleton-subtitle { width: 88%; height: 11px; }
    .theme-skeleton-stat { display: none; }
    .theme-skeleton-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
    .theme-skeleton-kpis > .theme-skeleton-panel { min-height: 78px; gap: 9px; padding: 11px; }
    .theme-skeleton-kpis > .theme-skeleton-panel > .theme-skeleton-icon { flex-basis: 34px; width: 34px; height: 34px; }
    .theme-skeleton-panel { padding: 14px; border-radius: 14px; }
    .theme-skeleton-columns { display: block; }
    .theme-skeleton-book-grid { grid-template-columns: 1fr; gap: 9px; }
    .theme-skeleton-book-grid article { min-height: 112px; padding: 9px; }
    .theme-skeleton-book-grid article > i { flex-basis: 60px; width: 60px; height: 90px; }
    .theme-skeleton-form-card, .theme-skeleton-guest-card { max-width: none; }
    .theme-skeleton-form-grid, .theme-skeleton-guest-card .theme-skeleton-form-grid { grid-template-columns: 1fr; }
    .theme-skeleton-section-title { margin-bottom: 16px; padding-bottom: 12px; }
    .theme-skeleton-section-title i:first-child { flex-basis: 38px; width: 38px; height: 38px; }
    .theme-skeleton-input { height: 42px; margin-bottom: 15px; }
    .theme-skeleton-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; padding: 6px; }
    .theme-skeleton-tabs i { height: 39px; }
    .theme-skeleton-tabs i:last-child { display: none; }
    .theme-skeleton-stat-nav { gap: 6px; margin: 0 -5px 12px; padding: 6px; border-radius: 0; }
    .theme-skeleton-stat-nav i { flex-basis: 112px; height: 40px; }
    .theme-skeleton-filter { padding: 12px; margin-bottom: 12px; }
    .theme-skeleton-filter > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .theme-skeleton-filter > div > span { min-width: 0; }
    .theme-skeleton-filter-button { width: 100%; grid-column: 1 / -1; }
    .theme-skeleton-presets { width: 90%; }
    .theme-skeleton-chart-grid { gap: 12px; }
    .theme-skeleton-chart-grid > section { min-height: 220px; }
    .theme-skeleton-chart { height: 145px; }
    .theme-skeleton-survey article { min-height: 82px; gap: 10px; }
    .theme-skeleton-survey article > span i:first-child { width: 82%; }
    .theme-skeleton-actions { justify-content: stretch; }
    .theme-skeleton-actions i { flex: 1; }
    .theme-skeleton-table { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .theme-skeleton-table i:nth-child(n+5) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #opac-content-skeleton.theme-page-skeleton .catalog-skeleton-block { animation: none; }
}

/* Circulation mirrors the full-width trend, category chart and ten-title list. */
.theme-skeleton-circulation-trend { margin-bottom: 20px; }
.theme-skeleton--statistics-circulation .theme-skeleton-chart-grid { align-items: stretch; }
.theme-skeleton-circulation-trend .theme-skeleton-chart { height: 300px; }
.theme-skeleton-circulation-ranking > div:not(.theme-skeleton-toolbar) { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.theme-skeleton-circulation-ranking > div:not(.theme-skeleton-toolbar) > i { flex: 0 0 40px; height: 60px; }
.theme-skeleton-circulation-ranking span { display: grid; flex: 1; gap: 10px; }
.theme-skeleton-circulation-ranking span i:first-child { width: 90%; height: 16px; }
.theme-skeleton-circulation-ranking span i:last-child { width: 55%; height: 12px; }
.theme-skeleton-circulation-notes { display: grid; gap: 14px; margin-top: 20px; }
.theme-skeleton-circulation-notes > i { height: 14px; }
@media (max-width: 600px) {
    .theme-skeleton--statistics-circulation .theme-skeleton-filter > div { flex-direction: column; align-items: stretch; }
    .theme-skeleton--statistics-circulation .theme-skeleton-filter > div > span { flex-basis: auto; }
}

.theme-skeleton-circulation-left, .theme-skeleton-circulation-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.theme-skeleton-circulation-left > :last-child, .theme-skeleton-circulation-right > :last-child { flex: 1; }
.theme-skeleton-circulation-right .theme-skeleton-circulation-notes { margin-top: 0; }
