/*
 * UX layer for the library (マイページ), person detail and community pages.
 * Loaded after common.css / library.css / home.css. Every rule is scoped to a
 * page-level selector so shared components on other pages are unaffected.
 */

/* ---------- Shared skeleton shimmer ---------- */
@keyframes ux-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.library-page .ux-shimmer,
.library-page .library-skeleton-media,
.library-page .library-skeleton-lines > span,
.library-page.library-auth-pending .library-stats:empty,
body[data-page="community"] .community-feed > .inline-loading::before,
body[data-page="community"] .community-feed > .inline-loading::after,
body[data-page="community"] .community-feed > .inline-loading > span {
    background: linear-gradient(100deg, #1a2534 30%, #26364a 50%, #1a2534 70%) 0 0 / 240% 100%;
    animation: ux-shimmer 1.4s ease-in-out infinite;
}

/* =====================================================================
 * マイページ
 * ===================================================================== */

/* Tab bar: underline tabs, scroll-snap, fade edges */
.library-page .library-tabs-wrap { position: relative; margin-bottom: 26px; }
.library-page .library-tabs-wrap::before,
.library-page .library-tabs-wrap::after { position: absolute; top: 0; bottom: 1px; z-index: 2; width: 36px; content: ""; opacity: 0; pointer-events: none; transition: opacity .2s; }
.library-page .library-tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--app-bg) 20%, transparent); }
.library-page .library-tabs-wrap::after { right: 0; background: linear-gradient(270deg, var(--app-bg) 20%, transparent); }
.library-page .library-tabs-wrap.is-scrollable-start::before,
.library-page .library-tabs-wrap.is-scrollable-end::after { opacity: 1; }
.library-page .library-tabs { gap: 2px; margin: 0; padding: 0; border-bottom: 1px solid var(--app-border); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 36px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.library-page .library-tabs::-webkit-scrollbar { display: none; }
.library-page .library-tab { position: relative; gap: 7px; min-height: 48px; padding: 10px 14px 12px; border: 0; border-radius: 6px 6px 0 0; color: var(--app-muted); background: transparent; box-shadow: none; font-size: 13px; font-weight: 600; scroll-snap-align: start; transition: color .15s, background-color .15s; }
.library-page .library-tab::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; content: ""; background: var(--club-terra); transform: scaleX(0); transition: transform .2s ease; }
.library-page .library-tab:hover { color: var(--app-accent); background: var(--club-sage); }
.library-page .library-tab.active { color: var(--app-accent); background: transparent; box-shadow: none; }
.library-page .library-tab.active::after { transform: scaleX(1); }
.library-page .library-tab:focus { outline: 0; }
.library-page .library-tab:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -3px; }
.library-page .library-tab span { min-width: 20px; padding: 1px 6px; border-radius: 999px; color: var(--app-muted); background: var(--club-sage); font-size: 10px; font-weight: 700; line-height: 1.6; text-align: center; }
.library-page .library-tab span:empty { display: none; }
.library-page .library-tab.active span { color: var(--app-surface); background: var(--app-accent); }

/* Stats placeholder while the session is being restored */
.library-page.library-auth-pending .library-stats:empty { min-height: 74px; margin: 16px 0 12px; padding: 0; border-radius: 4px; }
.library-page .library-stat { border-radius: 4px; transition: background-color .15s; }
.library-page .library-stat:hover { background: var(--club-sage); }
.library-page .library-stat:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }

/* Toolbar: heading + compact segmented sort control */
.library-page .library-toolbar-heading { margin-bottom: 12px; }
.library-page .library-toolbar-controls { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 18px; }
.library-page .library-sort-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.library-page .library-sort-label .bi { font-size: 12px; }
.library-page .library-sort-options { flex-wrap: wrap; gap: 8px; max-width: 100%; }
.library-page .library-segmented { display: inline-flex; max-width: 100%; padding: 3px; border: 1px solid var(--app-border); border-radius: 8px; background: #1a2534; overflow-x: auto; scrollbar-width: none; }
.library-page .library-segmented::-webkit-scrollbar { display: none; }
.library-page .library-segment { flex-shrink: 0; min-height: 44px; padding: 0 13px; border: 0; border-radius: 6px; color: var(--app-muted); background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .15s, background-color .15s, box-shadow .15s; }
.library-page .library-segment:hover { color: var(--app-accent); }
.library-page .library-segment.is-active { color: var(--app-accent); background: var(--app-surface); box-shadow: 0 1px 2px #00000026, 0 0 0 1px #ffffff0b; }
.library-page .library-segment:focus { outline: 0; }
.library-page .library-segment:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.library-page .library-sort-single { color: var(--app-muted); font-size: 12px; }
.library-page .library-filter-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.library-page .library-filter-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.library-page .library-filter-chip span { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 13px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-muted); background: var(--app-surface); font-size: 12px; font-weight: 600; }
.library-page .library-filter-chip .bi { display: none; }
.library-page .library-filter-chip input:checked + span { border-color: var(--app-accent); color: var(--app-surface); background: var(--app-accent); }
.library-page .library-filter-chip input:checked + span .bi { display: inline; }
.library-page .library-filter-chip input:focus-visible + span { outline: 2px solid var(--app-accent); outline-offset: 2px; }

/* Empty / error states */
.library-page .library-empty { min-height: 300px; }
.library-page .library-empty-actions { gap: 12px 20px; }
.library-page .library-empty-actions .btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding-inline: 20px; }
.library-page .library-empty-actions > a.btn-primary { color: var(--app-bg); }
.library-page .library-empty-actions > a:not(.btn) { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--app-accent); font-weight: 600; }

/* Signed-out welcome */
.library-page.library-signed-out .library-personal-tools,
.library-page.library-signed-out .library-tabs-wrap,
.library-page.library-signed-out #mypageToolbar,
.library-page.library-signed-out #analysisSection { display: none !important; }
.library-page.library-signed-out .library-intro { grid-template-columns: 1fr; margin-bottom: 20px; padding-bottom: 0; }
.library-page .library-welcome-panel { min-height: 0; padding: 44px 32px 40px; border: 1px solid var(--app-border); outline: 1px solid var(--app-border); outline-offset: -6px; background: radial-gradient(circle at 85% 0%, #283b422e 0, transparent 45%), var(--app-surface); }
.library-page .library-welcome-panel .club-eyebrow { margin-bottom: 8px; }
.library-page .library-welcome-panel h2 { margin-bottom: 10px; font-family: var(--club-display); font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.library-page .library-welcome-panel > p:not(.club-eyebrow) { max-width: 470px; margin-bottom: 26px; }
.library-page .library-welcome-art { position: relative; width: 168px; height: 104px; margin: 0 auto 22px; }
.library-page .library-welcome-frame { position: absolute; top: 8px; display: grid; place-items: center; width: 62px; height: 88px; border: 4px solid var(--app-surface); border-radius: 3px; color: #fffdf7cc; box-shadow: 0 0 0 1px var(--app-border), 3px 6px 14px #00000026; font-size: 22px; }
.library-page .library-welcome-frame.frame-1 { left: 4px; background: linear-gradient(150deg, #33505c, #234f3e); transform: rotate(-10deg); }
.library-page .library-welcome-frame.frame-2 { top: 0; left: 53px; z-index: 1; background: linear-gradient(150deg, #234f3e, #183b2d); color: var(--app-bg); transform: rotate(-1deg); }
.library-page .library-welcome-frame.frame-3 { right: 4px; background: linear-gradient(150deg, #a2573e, #6b2737); transform: rotate(9deg); }
.library-page .library-welcome-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 900px; margin: 0 0 28px; padding: 0; list-style: none; text-align: left; }
.library-page .library-welcome-features li { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px 14px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); }
.library-page .library-welcome-feature-icon { display: grid; flex-shrink: 0; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--app-accent); background: var(--club-sage); font-size: 16px; }
.library-page .library-welcome-features li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.library-page .library-welcome-features strong { color: var(--app-ink); font-size: 13px; line-height: 1.5; }
.library-page .library-welcome-features small { color: var(--app-muted); font-size: 11px; line-height: 1.5; }
.library-page .library-login-cta { min-height: 48px !important; padding-inline: 26px !important; font-size: 14px !important; font-weight: 700; }

/* Loading skeleton */
.library-page .library-skeleton { display: grid; gap: 16px; width: 100%; padding: 0 15px; }
.library-page .library-skeleton-card { display: flex; align-items: center; gap: 18px; padding: 14px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); }
.library-page .library-skeleton-media { flex-shrink: 0; width: 200px; aspect-ratio: 16 / 9; border-radius: 4px; }
.library-page .library-skeleton-lines { display: grid; flex: 1; gap: 10px; }
.library-page .library-skeleton-lines > span { height: 12px; border-radius: 3px; }
.library-page .library-skeleton-lines > span:first-child { width: 60%; height: 16px; }
.library-page .library-skeleton-lines > span:last-child { width: 35%; }

@media (max-width: 991px) {
    .library-page .library-welcome-features { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
}
@media (max-width: 575px) {
    .library-page .library-tabs-wrap { margin-inline: -16px; margin-bottom: 20px; }
    .library-page .library-tabs { padding-inline: 10px; scroll-padding-inline: 28px; }
    .library-page .library-tabs-wrap::before, .library-page .library-tabs-wrap::after { width: 28px; }
    .library-page .library-tab { min-height: 46px; padding: 9px 10px 11px; font-size: 12px; }
    .library-page .library-tab::after { right: 8px; left: 8px; }
    .library-page .library-toolbar-controls { flex-direction: row; align-items: center; }
    .library-page .library-segment { min-height: 44px; padding-inline: 11px; }
    .library-page .library-empty { min-height: 0; padding: 32px 18px; }
    .library-page .library-empty-actions { flex-direction: column; width: 100%; gap: 6px; }
    .library-page .library-empty-actions .btn { justify-content: center; width: 100%; max-width: 320px; }
    .library-page.library-signed-out .library-intro h1 { margin-bottom: 0; font-size: 26px; }
    .library-page .library-welcome-panel { padding: 22px 14px 20px; }
    .library-page .library-welcome-art { margin: -8px auto 4px; transform: scale(.78); }
    .library-page .library-welcome-panel > p:not(.club-eyebrow) { margin-bottom: 18px; font-size: 13px; line-height: 1.8; }
    .library-page .library-welcome-features { gap: 8px; margin-bottom: 18px; }
    .library-page .library-welcome-features li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 2px 8px; padding: 10px; }
    .library-page .library-welcome-features li > span:last-child { display: contents; }
    .library-page .library-welcome-feature-icon { width: 28px; height: 28px; font-size: 13px; }
    .library-page .library-welcome-features small { grid-column: 1 / -1; font-size: 10.5px; }
    .library-page .library-skeleton-card { flex-direction: column; align-items: stretch; }
    .library-page .library-skeleton-media { width: 100%; }
}

/* =====================================================================
 * Person detail
 * ===================================================================== */
.person-page #personDetail > .person-detail-header { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: end; gap: 36px; margin: 8px 0 32px; }
.person-page #personDetail > .person-detail-header > .col-md-4,
.person-page #personDetail > .person-detail-header > .col-md-8 { width: auto; max-width: none; margin: 0; padding-inline: 0; }
.person-page .person-portrait { padding: 6px; border: 1px solid var(--app-border); border-radius: 4px; background: var(--app-surface); box-shadow: 3px 5px 0 #00000020; }
.person-page .person-portrait .person-detail-img,
.person-page .person-portrait .person-detail-placeholder { width: 100%; max-width: none; border-radius: 2px; }
.person-page .person-portrait .person-detail-placeholder { font-size: 3.5rem; }
.person-page .person-detail-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding-bottom: 6px; }
.person-page .person-detail-department { margin: 0 0 6px; color: var(--club-terra); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.person-page #personDetail h1 { margin: 0; color: var(--app-ink); font-family: var(--club-display); font-size: clamp(28px, 3.4vw, 44px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; overflow-wrap: anywhere; }
.person-page .person-original-name { margin: 6px 0 0; color: var(--app-muted); font-family: var(--club-display); font-size: 15px; font-style: italic; overflow-wrap: anywhere; }
.person-page .person-detail-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.person-page .person-detail-facts li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-muted); background: var(--app-surface); font-size: 12px; font-weight: 600; }
.person-page .person-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.person-page .person-detail-favorite { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: 44px; padding: 0 18px 0 15px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-ink); background: var(--app-surface); font-size: 13px; font-weight: 700; transition: background-color .15s, border-color .15s, color .15s; }
.person-page .person-detail-favorite i { color: var(--club-terra); font-size: 17px; line-height: 1; }
.person-page .person-detail-favorite:hover:not(:disabled) { border-color: var(--app-accent); background: var(--club-sage); }
.person-page .person-detail-favorite.btn-active { border-color: var(--app-accent); color: var(--app-accent); background: var(--club-sage); }
.person-page .person-detail-favorite.btn-active i { animation: person-heart-pop .35s ease; }
.person-page .person-detail-favorite:disabled { opacity: .55; cursor: progress; }
.person-page .person-detail-favorite:focus { outline: 0; }
.person-page .person-detail-favorite:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
@keyframes person-heart-pop { 0% { transform: scale(1); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }
.person-page .person-fan-rank { display: inline-flex; align-items: center; min-height: 32px; margin: 0; padding: 4px 12px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-accent); background: var(--club-sage); font-size: 12px; font-weight: 700; }
.person-page .person-fan-rank:empty { display: none; }

/* Biography with read-more */
.person-page #personBiography { margin: 0 0 32px; padding: 20px 22px; border: 1px solid var(--app-border); border-radius: 6px; background: var(--app-surface); }
.person-page #personBiography h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.person-page #personBiography > p:not(.person-biography-text) { margin: 0 0 10px; color: var(--app-muted); font-size: 11px; }
.person-page .person-biography-text { display: -webkit-box; max-width: 72ch; margin: 0; overflow: hidden; color: var(--app-ink); font-size: 14px; line-height: 1.9; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.person-page #personBiography.is-expanded .person-biography-text { display: block; overflow: visible; }
.person-page .person-biography-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-top: 4px; padding: 0; border: 0; color: var(--app-accent); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.person-page .person-biography-toggle i { transition: transform .2s; }
.person-page #personBiography.is-expanded .person-biography-toggle i { transform: rotate(180deg); }
.person-page .person-biography-toggle:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }

/* Filmography */
.person-page .person-works { margin-top: 8px !important; }
.person-page .person-works-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--app-border); }
.person-page .person-works-toolbar h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 22px; font-weight: 700; }
.person-page .person-works-count { color: var(--app-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.person-page .person-works-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.person-page .person-segmented { display: inline-flex; padding: 3px; border: 1px solid var(--app-border); border-radius: 8px; background: #1a2534; }
.person-page .person-segmented .btn,
.person-page .person-segmented .btn.btn-primary,
.person-page .person-segmented .btn.btn-outline-primary { min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 6px; color: var(--app-muted); background: transparent; box-shadow: none; font-size: 12px; font-weight: 600; }
.person-page .person-segmented .btn.is-active { color: var(--app-accent); background: var(--app-surface); box-shadow: 0 1px 2px #00000026, 0 0 0 1px #ffffff0b; }
.person-page .person-segmented .btn:focus { box-shadow: none; }
.person-page .person-segmented .btn:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.person-page .person-filter-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.person-page .person-filter-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.person-page .person-filter-chip span { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 13px; border: 1px solid var(--app-border); border-radius: 999px; color: var(--app-muted); background: var(--app-surface); font-size: 12px; font-weight: 600; }
.person-page .person-filter-chip .bi { display: none; }
.person-page .person-filter-chip input:checked + span { border-color: var(--app-accent); color: var(--app-surface); background: var(--app-accent); }
.person-page .person-filter-chip input:checked + span .bi { display: inline; }
.person-page .person-filter-chip input:focus-visible + span { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.person-page #personMovies { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 28px 20px; margin: 0; }
.person-page #personMovies > .movie-grid-cell { width: auto; max-width: none; min-width: 0; margin: 0; padding: 0; flex: none; }
.person-page .person-works-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; border: 1px dashed var(--app-border); border-radius: 6px; color: var(--app-muted); background: var(--app-surface); text-align: center; }
.person-page .person-works-empty i { font-size: 24px; color: var(--app-accent); }
.person-page .person-works-empty p { margin: 0; font-size: 13px; }

@media (max-width: 600px) {
    .person-page #personDetail > .person-detail-header { grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 22px; }
    .person-page .person-portrait { padding: 4px; }
    .person-page #personDetail h1 { font-size: 1.5rem; }
    .person-page .person-original-name { margin-top: 2px; font-size: 13px; }
    .person-page .person-detail-facts { margin-top: 8px; }
    .person-page .person-detail-facts li { padding: 2px 8px; font-size: 11px; }
    .person-page .person-detail-actions { gap: 8px; margin-top: 12px; }
    .person-page .person-detail-favorite { height: 40px; padding: 0 14px 0 12px; font-size: 12px; }
    .person-page #personBiography { margin-bottom: 26px; padding: 16px; }
    .person-page .person-biography-text { font-size: 13px; }
    .person-page .person-works-toolbar { margin-bottom: 16px; }
    .person-page .person-works-toolbar h2 { font-size: 20px; }
    .person-page #personMovies { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
}

/* =====================================================================
 * Community
 * ===================================================================== */
body[data-page="community"] .community-controls { align-items: center !important; gap: 12px; margin-bottom: 22px; }
body[data-page="community"] .community-tabs { gap: 0; margin: 0; padding: 3px; border: 1px solid var(--app-border); border-radius: 9px; background: #1a2534; }
body[data-page="community"] .community-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 7px; color: var(--app-muted); font-size: 13px; font-weight: 600; transition: color .15s, background-color .15s, box-shadow .15s; }
body[data-page="community"] .community-tabs button::after { display: none; }
body[data-page="community"] .community-tabs button:hover { color: var(--app-accent); }
body[data-page="community"] .community-tabs button[aria-selected='true'] { color: var(--app-accent); background: var(--app-surface); box-shadow: 0 1px 2px #00000026, 0 0 0 1px #ffffff0b; font-weight: 700; }
body[data-page="community"] .community-tabs button:focus { outline: 0; }
body[data-page="community"] .community-tabs button:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 1px; }
body[data-page="community"] .community-controls .home-section-toolbar select { min-height: 40px; border-radius: 8px; font-size: 12px; }

/* Feed cards */
body[data-page="community"] .community-feed .movie-list-card { grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: 14px; row-gap: 4px; min-height: 0; padding: 18px; border-radius: 6px; background: var(--app-surface); color: var(--app-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
body[data-page="community"] .community-feed .movie-list-card:hover { border-color: var(--app-accent); background: var(--app-surface); box-shadow: 0 6px 16px #00000026; transform: translateY(-1px); }
body[data-page="community"] .community-feed .movie-list-card:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
body[data-page="community"] .community-feed .feed-card-poster { width: 56px; height: 84px; overflow: hidden; border: 3px solid var(--app-surface); border-radius: 3px; box-shadow: 0 0 0 1px var(--app-border); background: var(--club-sage); }
body[data-page="community"] .community-feed .feed-card-poster img { width: 100%; height: 100%; object-fit: cover; }
body[data-page="community"] .community-feed .list-card-topline { display: flex; align-items: center; gap: 8px; align-self: end; }
body[data-page="community"] .community-feed h3 { align-self: start; font-size: 15px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
body[data-page="community"] .community-feed .movie-list-card p { margin: 12px 0 10px; color: var(--app-ink); font-size: 14px; line-height: 1.85; -webkit-line-clamp: 4; }
body[data-page="community"] .community-feed .movie-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-top: 10px; border-top: 1px dashed var(--app-border); color: var(--app-muted); font-size: 12px; }
body[data-page="community"] .community-feed .movie-list-meta span { display: inline-flex; align-items: center; gap: 4px; }
body[data-page="community"] .community-feed .movie-list-meta span:first-child { margin-right: auto; color: var(--app-ink); font-weight: 600; }
body[data-page="community"] .community-feed .ui-empty { min-height: 220px; padding: 32px 20px; border-color: var(--app-border); border-radius: 6px; background: var(--app-bg); }
body[data-page="community"] .community-feed .ui-empty > i { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; color: var(--app-accent); background: var(--club-sage); font-size: 22px; }
body[data-page="community"] .community-feed .ui-empty .btn { min-height: 40px; padding-inline: 18px; }

/* Loading skeleton: the shared inline loader becomes three placeholder cards */
body[data-page="community"] .community-feed > .inline-loading { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; min-height: 0; padding: 0; }
body[data-page="community"] .community-feed > .inline-loading::before,
body[data-page="community"] .community-feed > .inline-loading::after,
body[data-page="community"] .community-feed > .inline-loading > .modern-loader { display: block; width: auto; max-width: none; height: 190px; aspect-ratio: auto; margin: 0; border: 1px solid var(--app-border); border-radius: 6px; content: ""; filter: none; }
body[data-page="community"] .community-feed > .inline-loading > .modern-loader { order: 1; }
body[data-page="community"] .community-feed > .inline-loading::after { order: 2; }
body[data-page="community"] .community-feed > .inline-loading > .inline-loading-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 991px) {
    body[data-page="community"] .community-feed > .inline-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body[data-page="community"] .community-feed > .inline-loading::after { display: none; }
}
@media (max-width: 575px) {
    body[data-page="community"] .community-controls { flex-wrap: nowrap; gap: 8px; }
    body[data-page="community"] .community-tabs { flex: 1; min-width: 0; }
    body[data-page="community"] .community-tabs button { flex: 1 1 auto; gap: 5px; min-width: 0; padding: 0 8px; font-size: 12px; white-space: nowrap; }
    body[data-page="community"] .community-controls .home-section-toolbar { flex-shrink: 0; margin-left: 0; }
    body[data-page="community"] .community-controls .home-section-toolbar select { width: 96px; max-width: 96px; padding-inline: 8px 4px; }
    body[data-page="community"] .community-feed .movie-list-card { padding: 16px; }
    body[data-page="community"] .community-feed .movie-list-card p { font-size: 13.5px; }
    body[data-page="community"] .community-feed > .inline-loading { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    body[data-page="community"] .community-feed > .inline-loading::after { display: block; }
    body[data-page="community"] .community-feed > .inline-loading::before,
    body[data-page="community"] .community-feed > .inline-loading::after,
    body[data-page="community"] .community-feed > .inline-loading > .modern-loader { height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .library-page .library-skeleton-media,
    .library-page .library-skeleton-lines > span,
    .library-page.library-auth-pending .library-stats:empty,
    body[data-page="community"] .community-feed > .inline-loading::before,
    body[data-page="community"] .community-feed > .inline-loading::after,
    body[data-page="community"] .community-feed > .inline-loading > span { animation: none; }
    .library-page .library-tab::after { transition: none; }
}

/* ---------- Person page: crawlable language/browse links sit below the profile, as chips (matches film pages) ---------- */
body.person-page > .container { display: flex; flex-direction: column; }
body.person-page > .container > * { min-width: 0; }
body.person-page > .container > .mb-4 {
    order: 1;
    display: grid;
    gap: 10px;
    margin: 24px 0 8px !important;
    padding-top: 16px;
    border-top: 1px solid var(--app-border);
}
body.person-page > .container > .mb-4 nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 0; }
body.person-page > .container > .mb-4 nav::before {
    flex-basis: 100%;
    color: var(--app-muted);
    content: attr(aria-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
}
body.person-page > .container > .mb-4 a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-accent);
    background: var(--app-surface);
    font-size: 12px;
    text-decoration: none;
}
body.person-page > .container > .mb-4 a:hover { border-color: var(--app-accent); background: var(--club-sage); }
body.person-page > .container > .mb-4 a[aria-current="page"] { border-color: var(--app-accent); color: var(--app-bg); background: var(--app-accent); }

/* Community segmented tabs: keep labels from colliding on narrow phones. */
@media (max-width: 400px) {
    body[data-page="community"] .community-tabs button > .bi { display: none; }
}
@media (max-width: 359px) {
    body[data-page="community"] .community-controls { flex-wrap: wrap; }
    body[data-page="community"] .community-tabs { flex: 1 1 100%; }
    body[data-page="community"] .community-controls .home-section-toolbar { margin-left: auto; }
}

/* Inactive segments: --app-muted on the #1a2534 track is only ~4.2:1; darken for AA. */
.library-page .library-segment:not(.is-active),
.person-page .person-segmented .btn:not(.is-active),
body[data-page="community"] .community-tabs button[aria-selected='false'] { color: var(--app-muted); }
.library-page .library-segment:not(.is-active):hover,
.person-page .person-segmented .btn:not(.is-active):hover,
body[data-page="community"] .community-tabs button[aria-selected='false']:hover { color: var(--app-accent); }

/* A precise personal catalogue: useful numbers, clear navigation and
   restrained panels rather than decorative dashboard chrome. */
.library-page .library-intro { padding-block: 12px 28px; }
.library-page .library-intro h1 { color: var(--app-ink); font-weight: 650; letter-spacing: -.045em; }
.library-page .library-kicker { color: var(--precision-ice, var(--app-muted)); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.library-page .library-kicker::before { width: 18px; }
.library-page .library-record {
    padding: 18px 22px 14px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    outline: 0;
    background: var(--app-surface);
    box-shadow: inset 0 1px 0 #ffffff06;
}
.library-page .library-record-heading { padding-bottom: 14px; border-bottom-style: solid; color: var(--app-muted); }
.library-page .library-record-heading span { font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.library-page .library-record-heading i { border-color: var(--app-border); border-radius: 6px; color: var(--precision-ice, var(--app-muted)); transform: none; }
.library-page .library-stats { padding-block: 18px; }
.library-page .library-stat { min-height: 56px; border-radius: 6px; }
.library-page .library-stat strong { color: var(--app-ink); font-family: var(--precision-mono, ui-monospace, SFMono-Regular, Consolas, monospace); font-size: 27px; font-weight: 500; letter-spacing: -.05em; }
.library-page .library-stat span { font-size: 10px; font-weight: 500; letter-spacing: .025em; }
.library-page .library-stat:hover strong { color: var(--app-accent); }
.library-page .library-record-footer { padding-top: 12px; border-top-style: solid; color: var(--app-muted); letter-spacing: .12em; }
.library-page .library-tabs { gap: 3px; padding-bottom: 8px; }
.library-page .library-tab { min-height: 48px; border-radius: 8px; font-weight: 500; }
.library-page .library-tab.active { color: var(--app-accent); background: var(--app-surface); box-shadow: inset 0 0 0 1px var(--app-border); }
.library-page .library-tab::after { height: 2px; bottom: -9px; background: var(--app-accent); }
.library-page .library-tab span { border-radius: 5px; background: var(--precision-raised, var(--app-surface-strong)); font-variant-numeric: tabular-nums; }
.library-page .library-tab.active span { color: var(--app-accent); background: var(--club-sage); }
.library-page .library-toolbar-heading h2 { font-weight: 650; letter-spacing: -.035em; }
.library-page .library-result-count { font-size: 11px; font-variant-numeric: tabular-nums; }
.library-page .library-segmented,
.person-page .person-segmented { padding: 3px; border-radius: 8px; background: var(--app-surface); }
.library-page .library-segment,
.person-page .person-segmented .btn { min-height: 44px; border-radius: 5px; font-weight: 500; }
.library-page .library-segment.is-active,
.person-page .person-segmented .btn.is-active,
body[data-page="community"] .community-tabs button[aria-selected='true'] { color: var(--app-accent); background: var(--precision-raised, var(--app-surface-strong)); box-shadow: inset 0 0 0 1px #ffffff10; }
.library-page .library-filter-chip span { min-height: 44px; border-radius: 8px; font-weight: 500; }
.library-page .library-welcome-panel { padding-block: 44px; border-radius: 16px; outline: 0; background: var(--app-surface); box-shadow: inset 0 1px 0 #ffffff06; }
.library-page .library-welcome-panel h2 { color: var(--app-ink); font-weight: 650; }
.library-page .library-welcome-features li { border-radius: 10px; padding-block: 16px; background: var(--app-bg); }
.library-page .library-welcome-feature-icon { border: 1px solid var(--app-border); border-radius: 8px; color: var(--precision-ice, var(--app-muted)); background: var(--app-surface); }
.library-page .library-welcome-features strong { font-weight: 600; }
.library-page .library-welcome-frame { border-width: 2px; border-radius: 7px; box-shadow: 0 12px 24px #00000040; }
.library-page .library-welcome-frame.frame-1 { background: linear-gradient(150deg, #34495e, #1f3448); }
.library-page .library-welcome-frame.frame-2 { background: linear-gradient(150deg, #596b3f, #263c36); }
.library-page .library-welcome-frame.frame-3 { background: linear-gradient(150deg, #6f484e, #34344f); }
.library-page .library-skeleton-card { border-radius: 12px; }
.library-page .library-empty { border-style: solid; border-color: var(--app-border); border-radius: 12px; }
.library-page .library-empty-icon { border-color: var(--app-border); border-radius: 12px; outline: 0; color: var(--precision-ice, var(--app-muted)); background: var(--app-bg); transform: none; }
.library-page .analysis-section,
.library-page .analysis-card { border-color: var(--app-border); border-radius: 12px; background: var(--app-surface); }
.library-page .mypage-menu-button { min-height: 44px; border-radius: 8px; }
.library-page .mypage-menu-item { min-height: 44px; }
.person-page #personDetail > .person-detail-header { padding: 28px; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-surface); box-shadow: inset 0 1px 0 #ffffff06; }
.person-page .person-portrait { padding: 0; border: 1px solid #ffffff18; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 32px #00000036; }
.person-page .person-portrait .person-detail-img,
.person-page .person-portrait .person-detail-placeholder { border-radius: 9px; }
.person-page #personDetail h1 { font-size: clamp(30px, 4vw, 50px); font-weight: 650; line-height: 1.22; letter-spacing: -.045em; }
.person-page .person-original-name { font-style: normal; line-height: 1.65; letter-spacing: .025em; }
.person-page .person-detail-facts li { padding-block: 5px; font-variant-numeric: tabular-nums; }
.person-page .person-detail-favorite { min-height: 44px; border-radius: 8px; }
.person-page .person-detail-favorite.btn-active { color: var(--app-accent); }
.person-page .person-fan-rank { border-color: var(--app-border); font-variant-numeric: tabular-nums; }
.person-page #personBiography { border-radius: 12px; padding: 26px; border-color: var(--app-border); background: var(--app-surface); }
.person-page .person-works-toolbar h2 { color: var(--app-ink); font-weight: 650; letter-spacing: -.03em; }
.person-page .person-works-empty { border-radius: 12px; }
.person-page > .container > .mb-4 a { min-height: 44px; border-radius: 8px; }
.person-page > .container > .mb-4 a[aria-current="page"] { color: var(--app-bg); }
body[data-page="community"] .community-feed .movie-list-card { padding: 24px; border-radius: 12px; }
body[data-page="community"] .community-feed .movie-list-card:hover { box-shadow: inset 0 1px 0 #ffffff06; }
body[data-page="community"] .community-feed .feed-card-poster { border: 1px solid #ffffff12; border-radius: 7px; }
body[data-page="community"] .community-feed .ui-empty { border-radius: 12px; }
body[data-page="community"] .community-feed > .inline-loading::before,
body[data-page="community"] .community-feed > .inline-loading::after,
body[data-page="community"] .community-feed > .inline-loading > .modern-loader { border-radius: 12px; }
@media (max-width: 600px) {
    .library-page .library-intro { padding-top: 4px; }
    .library-page .library-record { padding: 16px; }
    .library-page .library-stat strong { font-size: 25px; }
    .library-page .library-welcome-panel { padding: 28px 16px; border-radius: 12px; }
    .library-page .library-welcome-features li { padding: 12px; }
    .person-page #personDetail > .person-detail-header { gap: 16px; padding: 18px; border-radius: 12px; }
    .person-page #personDetail h1 { font-size: clamp(23px, 6vw, 30px); }
    .person-page .person-detail-facts li { font-size: 11px; }
    .person-page #personBiography { padding: 20px; }
    body[data-page="community"] .community-feed .movie-list-card { padding: 18px; }
}
@media (max-width: 374px) {
    .person-page #personDetail > .person-detail-header { grid-template-columns: 82px minmax(0, 1fr); padding: 14px; gap: 12px; }
    .person-page .person-detail-favorite { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .person-page .person-detail-favorite.btn-active i { animation: none; }
    .person-page .person-detail-favorite,
    .person-page .person-biography-toggle i,
    body[data-page="community"] .community-feed .movie-list-card { transition: none; }
    body[data-page="community"] .community-feed .movie-list-card:hover { transform: none; }
}

/* Collection as an editorial object: oversized names and real counters, with
   artwork and strong baselines instead of another dashboard of small boxes. */
.library-page .library-intro { gap: 56px; min-height: 290px; padding-block: 28px 42px; border-bottom: 1px solid #ffffff1c; margin-bottom: 28px; }
.library-page .library-intro h1 { font-size: clamp(48px, 6.8vw, 98px); line-height: 1.08; font-weight: 800; letter-spacing: -.075em; }
.library-page .mypage-profile-summary { margin-top: 24px; }
.library-page .mypage-account-name { font-size: 13px; }
.library-page .library-personal-tools { gap: 20px; }
.library-page .library-record { width: 390px; padding: 20px 0 8px; border: 0; border-top: 1px solid var(--app-accent); border-radius: 0; background: transparent; box-shadow: none; }
.library-page .library-record-heading { padding-bottom: 16px; border: 0; }
.library-page .library-record-heading span { color: var(--app-accent); font-size: 11px; }
.library-page .library-record-heading i { border: 0; color: var(--app-accent); }
.library-page .library-stat { padding-inline: 12px; border-radius: 0; }
.library-page .library-stat strong { font-size: 54px; font-weight: 400; line-height: 1.1; letter-spacing: -.08em; }
.library-page .library-stat span { margin-top: 12px; font-size: 10px; }
.library-page .library-tabs { gap: 12px; padding-bottom: 14px; }
.library-page .library-tab { min-height: 54px; padding-inline: 12px; border-radius: 0; background: transparent; }
.library-page .library-tab.active { background: transparent; box-shadow: none; }
.library-page .library-tab::after { height: 3px; left: 12px; right: 12px; bottom: -15px; }
.library-page .library-tab span { border-radius: 3px; }
.library-page .library-toolbar-heading h2 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 750; letter-spacing: -.06em; }
.library-page .library-result-count { font-family: var(--precision-mono, monospace); }
.library-page .library-segmented { border-radius: 3px; }
.library-page .library-segment { border-radius: 2px; }
.library-page .library-welcome-panel { position: relative; overflow: hidden; padding: 56px 48px; border-radius: 3px; border-width: 1px 0; background: radial-gradient(ellipse at 90% 0%, #d7f56b14, transparent 64%), var(--app-surface); }
.library-page .library-welcome-panel h2 { font-size: clamp(28px, 4vw, 52px); font-weight: 750; line-height: 1.3; letter-spacing: -.06em; }
.library-page .library-empty { padding-block: 60px; border-radius: 3px; background: radial-gradient(ellipse at 50% 0%, #a5dce608, transparent 64%); }
.person-page #personDetail > .person-detail-header { position: relative; isolation: isolate; grid-template-columns: 280px minmax(0, 1fr); min-height: 440px; gap: 64px; padding: 34px 0 48px; border: 0; border-bottom: 1px solid #ffffff1c; border-radius: 0; background: radial-gradient(ellipse at 15% 40%, #a5dce610, transparent 62%); box-shadow: none; }
.person-page .person-portrait { border-radius: 3px; border-color: #ffffff38; box-shadow: 18px 24px 0 #ffffff03, 0 24px 70px #0006; }
.person-page .person-portrait .person-detail-img,
.person-page .person-portrait .person-detail-placeholder { border-radius: 2px; }
.person-page .person-detail-body { padding-bottom: 10px; }
.person-page .person-detail-department { color: var(--app-accent); margin-bottom: 20px; }
.person-page #personDetail h1 { max-width: 13ch; font-size: clamp(42px, 6.2vw, 88px); font-weight: 800; line-height: 1.08; letter-spacing: -.07em; }
.person-page .person-original-name { margin-top: 20px; font-size: 13px; letter-spacing: .12em; }
.person-page .person-detail-facts { margin-top: 24px; }
.person-page .person-detail-facts li { border-width: 0 0 1px; border-radius: 0; padding: 5px 0; margin-right: 16px; background: transparent; }
.person-page .person-detail-actions { margin-top: 26px; }
.person-page .person-detail-favorite { min-height: 50px; border-radius: 3px; }
.person-page #personBiography { padding: 32px 0; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.person-page #personBiography h2,
.person-page .person-works-toolbar h2 { font-size: 30px; font-weight: 750; letter-spacing: -.05em; }
.person-page .person-biography-text { max-width: 64ch; font-size: 16px; line-height: 2; }
body[data-page="community"] .community-page-intro { padding-block: 14px 36px; margin-bottom: 26px; border-bottom: 1px solid #ffffff1c; }
body[data-page="community"] .community-page-intro h2 { font-size: clamp(44px, 7vw, 96px); font-weight: 800; line-height: 1.08; letter-spacing: -.075em; }
body[data-page="community"] .community-invite { border-radius: 3px; border-width: 0 0 1px; padding: 18px 0 26px; background: transparent; }
body[data-page="community"] .community-tabs { border: 0; border-radius: 0; padding: 0; background: transparent; }
body[data-page="community"] .community-tabs button { min-height: 50px; padding-inline: 18px; border-radius: 0; }
body[data-page="community"] .community-tabs button[aria-selected="true"] { color: var(--app-accent); background: transparent; box-shadow: inset 0 -2px var(--app-accent); }
body[data-page="community"] .community-feed .movie-list-card { padding: 28px; border-radius: 3px; background: linear-gradient(140deg, #ffffff05, #ffffff01); }
body[data-page="community"] .community-feed .movie-list-card h3 { font-size: 21px; line-height: 1.45; letter-spacing: -.035em; }
@media (max-width: 900px) {
    .library-page .library-intro { gap: 28px; }
    .library-page .library-record { width: 330px; }
    .person-page #personDetail > .person-detail-header { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 600px) {
    .library-page .library-intro { min-height: 0; gap: 26px; padding-block: 10px 30px; }
    .library-page .library-intro h1 { font-size: clamp(42px, 12vw, 62px); }
    .library-page .mypage-profile-summary { margin-top: 16px; }
    .library-page .library-record { width: 100%; padding-top: 16px; }
    .library-page .library-stat strong { font-size: 42px; }
    .library-page .library-tab { padding-inline: 10px; min-height: 50px; }
    .library-page .library-tabs { gap: 4px; }
    .library-page .library-welcome-panel { padding: 30px 20px; }
    .library-page .library-toolbar-heading h2 { font-size: 28px; }
    .person-page #personDetail > .person-detail-header { min-height: 0; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 18px 0 30px; margin-bottom: 20px; }
    .person-page #personDetail h1 { font-size: clamp(30px, 8vw, 42px); line-height: 1.12; }
    .person-page .person-detail-department { margin-bottom: 12px; }
    .person-page .person-original-name { margin-top: 12px; font-size: 10px; letter-spacing: .05em; }
    .person-page .person-detail-facts { margin-top: 14px; gap: 6px; }
    .person-page .person-detail-facts li { margin-right: 6px; font-size: 10px; }
    .person-page .person-detail-actions { margin-top: 16px; }
    .person-page .person-detail-favorite { min-height: 44px; font-size: 12px; padding-inline: 12px; }
    .person-page #personBiography { padding-block: 24px; }
    .person-page #personBiography h2,
    .person-page .person-works-toolbar h2 { font-size: 25px; }
    .person-page .person-biography-text { font-size: 14px; }
    body[data-page="community"] .community-page-intro { padding-block: 12px 26px; }
    body[data-page="community"] .community-page-intro h2 { font-size: clamp(40px, 10vw, 62px); }
    body[data-page="community"] .community-tabs button { padding-inline: 12px; font-size: 12px; }
    body[data-page="community"] .community-feed .movie-list-card { padding: 22px; }
}
@media (max-width: 374px) { .person-page #personDetail > .person-detail-header { grid-template-columns: 100px minmax(0, 1fr); gap: 14px; } }

/* A compact journal: three primary destinations and filters within each. */
.library-page .library-intro {
    position: relative; gap: 24px; min-height: 0; padding-block: 8px 20px;
    margin-bottom: 16px;
}
.library-page .library-intro h1 { margin-bottom: 12px; font-size: 28px; line-height: 1.2; letter-spacing: -.04em; }
.library-page .mypage-profile-summary { gap: 10px; margin-top: 0; }
.library-page .mypage-profile-icon { width: 38px; height: 38px; }
.library-page .mypage-account-name { color: var(--app-ink); font-size: 14px; }
.library-page .library-personal-tools { gap: 8px; }
.library-page .library-record { width: auto; padding: 0; border: 0; outline: 0; }
.library-page .library-record-heading { display: none; }
.library-page .library-stats { display: flex; gap: 12px; min-height: 0; padding: 0; }
.library-page .library-stat { flex-direction: row; gap: 5px; min-height: 44px; padding-inline: 8px; }
.library-page .library-stat + .library-stat { border: 0; }
.library-page .library-stat strong { font-family: inherit; font-size: 22px; font-weight: 700; }
.library-page .library-stat span { font-size: 12px; }
.library-page.library-auth-pending .library-stats:empty { min-height: 44px; margin: 0; }
.library-page .library-tabs-wrap { margin: 0 0 14px; }
.library-page .library-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; overflow: visible; }
.library-page .library-tab { min-width: 0; min-height: 48px; gap: 6px; padding: 8px; font-size: 14px; }
.library-page .library-tab::after { right: 8px; bottom: -1px; left: 8px; }
.library-page .library-toolbar-heading { margin-bottom: 8px; }
.library-page .library-toolbar-heading h2 { font-size: 18px; letter-spacing: -.025em; }
.library-page .library-toolbar-heading .btn { min-height: 40px; padding: 6px 12px; font-size: 12px; }
.library-page .library-view-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.library-page .library-view-filter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 13px; border: 1px solid var(--app-border); border-radius: 24px; color: var(--app-muted); background: transparent; font-size: 12px; cursor: pointer; }
.library-page .library-view-filter span { font-size: 11px; font-variant-numeric: tabular-nums; }
.library-page .library-view-filter.is-active { border-color: var(--app-accent); color: var(--app-bg); background: var(--app-accent); }
.library-page .library-view-filter:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 3px; }
.library-page .library-toolbar-controls { gap: 6px 10px; padding-bottom: 6px; }
.library-page .library-segment { min-height: 40px; padding-inline: 10px; font-size: 11px; }
.library-page .library-skeleton { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; }
.library-page .library-skeleton-card { display: block; padding: 0; border-radius: 8px; overflow: hidden; }
.library-page .library-skeleton-media { display: block; width: 100%; aspect-ratio: 2 / 3; }
.library-page .library-skeleton-lines { display: none; }
@media (max-width: 600px) {
    .library-page .library-intro { grid-template-columns: 1fr; gap: 8px; padding-block: 0 12px; }
    .library-page .library-intro h1 { max-width: calc(100% - 100px); font-size: 24px; }
    .library-page .library-personal-tools { align-items: flex-start; }
    .library-page .library-personal-tools > .mypage-menu-wrapper { position: absolute; top: 0; right: 0; }
    .library-page .library-record { width: auto; padding: 0; }
    .library-page .library-stats { gap: 10px; }
    .library-page .library-stat { padding-left: 0; }
    .library-page .library-stat strong { font-size: 20px; }
    .library-page .library-tab { gap: 4px; font-size: 12px; }
    .library-page .library-tab i { display: none; }
    .library-page .library-tab span { min-width: 0; padding-inline: 4px; font-size: 10px; }
    .library-page .library-sort-label { display: none; }
    .library-page .library-sort-options { width: 100%; }
    .library-page .library-toolbar-controls { padding-bottom: 0; }
    .library-page .library-toolbar-heading h2 { font-size: 16px; }
}
