/* ==========================================================================
   Manch — Category, Creator profile, Watch history and Watch later.

   Four pages that share a header, a grid and a set of quiet controls, so they
   share one sheet. Everything is scoped under .library; app.css owns short
   generic names and reaches every page.
   ========================================================================== */

.library {
    /* Five across, the same rhythm as Home. */
    --cols: 5;
    --thumb-radius: 8px;

    max-width: 1240px;
    margin-inline: auto;
}
@media (max-width: 1180px) { .library { --cols: 4; } }
@media (max-width: 900px)  { .library { --cols: 3; } }
@media (max-width: 720px)  { .library { --cols: 2; } }

.library .nums { font-variant-numeric: tabular-nums; }
.library .dot { opacity: 0.45; margin-inline: 0.35rem; }

.library .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- page header ---------------------------------------------------------- */

.library .libhead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: clamp(1rem, 2.4vw, 2rem);
    flex-wrap: wrap;
    margin-bottom: clamp(1.25rem, 2.4vw, 2rem);
}
.library .libhead h1 {
    font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.1;
}

/* The line under a page title speaks in the same small upper-case voice as
   the card credits and the section labels. */
.library .libhead__text p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
}
.library .libhead__text p .dot { margin-inline: 0; }
.library .libhead__tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* --- quiet controls ------------------------------------------------------- */

.library .btn-quiet {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 38px;
    padding-inline: 1rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.library .btn-quiet:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.library .btn-quiet[aria-disabled] { opacity: 0.55; cursor: default; }
.library .btn-quiet--danger:hover { border-color: rgba(239, 78, 19, 0.6); color: #ffb08a; background: rgba(239, 78, 19, 0.1); }

.library .libsearch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 38px;
    padding-inline: 0.875rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
    transition: border-color 0.18s var(--ease);
}
.library .libsearch:focus-within { border-color: rgba(244, 104, 15, 0.5); }
.library .libsearch svg { width: 15px; height: 15px; stroke: var(--ink-3); fill: none; stroke-width: 1.9; flex: none; }
.library .libsearch input {
    width: clamp(140px, 20vw, 220px);
    background: none; border: 0; outline: none;
    font-size: 0.8125rem; color: var(--ink);
}
.library .libsearch input::placeholder { color: var(--ink-4); }

/* --- shared grid ---------------------------------------------------------- */

.library .libgrid {
    display: grid;
    /* Five across with a 12px gutter, exactly as Home lays its shelves out —
       the card is the same component, so the grid around it should match. */
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

/* The home card is reused whole; only the hover treatment differs here. */
.library .hcard { display: block; min-width: 0; }
.library .hcard__thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--thumb-radius); overflow: hidden; background: #0a0f14; }
.library .hcard__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.library .hcard:hover .hcard__thumb img { transform: scale(1.05); }
.library .hcard__thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); pointer-events: none; }
.library .hcard__time { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 5px; background: rgba(6, 9, 12, 0.85); font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #f2f3f4; }
.library .hcard__badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 5px; background: rgba(6, 9, 12, 0.78); backdrop-filter: blur(5px); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd9b8; }
.library .hcard__foot { display: flex; align-items: flex-start; gap: 0.75rem; padding-top: 0.75rem; }
.library .hcard__face { flex: none; }
.library .hcard__face img, .library .hcard__face > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; font-size: 0.75rem; font-weight: 700; color: #fff; }
.library .hcard__text { min-width: 0; flex: 1; }
.library .hcard__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.011em; color: var(--ink); }
.library .hcard__by, .library .hcard__meta { display: block; margin-top: 0.3125rem; font-size: 0.8125rem; color: var(--ink-3); }
.library .hcard__meta { margin-top: 0.125rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.library .hcard__meta .dot { margin-inline: 0; }
.library .hcard__more { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-3); opacity: 0; transition: opacity 0.18s var(--ease), background 0.18s var(--ease); }
.library .hcard:hover .hcard__more { opacity: 1; }
.library .hcard__more svg { width: 15px; height: 15px; fill: currentColor; }

/* --- chips (shared with the home rail) ------------------------------------ */

.library .hchip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
    height: 34px;
    padding: 0 0.9375rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--raised);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.14s var(--ease);
}
.library .hchip:hover { background: #161f26; border-color: rgba(244, 104, 15, 0.4); color: var(--ink); }
.library .hchip:active { transform: scale(0.97); }
.library .hchip[aria-current] { background: var(--accent-2); border-color: var(--accent-2); color: #0b0705; font-weight: 700; }
.library .hchip__count { font-size: 0.6875rem; font-variant-numeric: tabular-nums; opacity: 0.65; }

/* --- empty state ---------------------------------------------------------- */

.library .libempty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: clamp(3rem, 8vw, 5.5rem) 1.5rem;
    border: 1px dashed var(--line-2);
    border-radius: 16px;
}
.library .libempty__icon {
    display: grid;
    place-items: center;
    width: 58px; height: 58px;
    margin-bottom: 0.375rem;
    border-radius: 50%;
    background: var(--raised);
    color: var(--accent);
}
.library .libempty__icon svg { width: 26px; height: 26px; }
.library .libempty h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.library .libempty p { max-width: 44ch; font-size: 0.9375rem; color: var(--ink-3); line-height: 1.6; }
.library .libempty .btn-accent { margin-top: 0.75rem; }

/* --- watch later: a remove button on each card ---------------------------- */

.library .libitem { position: relative; }
.library .libitem__remove { position: absolute; right: 8px; top: 8px; z-index: 3; }
.library .libitem__remove button {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(6, 9, 12, 0.8);
    backdrop-filter: blur(6px);
    color: #eceef0;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}
.library .libitem:hover .libitem__remove button,
.library .libitem__remove button:focus-visible { opacity: 1; transform: none; }
.library .libitem__remove button:hover { background: var(--accent-2); color: #0b0705; }
.library .libitem__remove svg { width: 15px; height: 15px; }

/* --- history: a day of rows ----------------------------------------------- */

.library .libday { margin-top: clamp(1.5rem, 2.8vw, 2.25rem); }
.library .libday:first-of-type { margin-top: 0; }
.library .libday__label {
    position: sticky;
    top: var(--bar);
    z-index: 20;
    padding: 0.625rem 0;
    margin-bottom: 0.375rem;
    background: linear-gradient(var(--page) 70%, transparent);
    /* A day is a section label, in the same voice as every other one. */
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
}
.library .libday__list { display: flex; flex-direction: column; }

.library .librow {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem;
    margin-inline: -0.625rem;
    border-radius: 12px;
    transition: background 0.18s var(--ease);
}
.library .librow:hover { background: rgba(255, 255, 255, 0.035); }

.library .librow__main { display: flex; gap: clamp(0.75rem, 1.6vw, 1.125rem); flex: 1; min-width: 0; }

.library .librow__thumb {
    position: relative;
    flex: none;
    width: clamp(150px, 18vw, 232px);
    aspect-ratio: 16 / 9;
    border-radius: var(--thumb-radius);
    overflow: hidden;
    background: #0a0f14;
}
.library .librow__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.library .librow:hover .librow__thumb img { transform: scale(1.05); }
.library .librow__time {
    position: absolute;
    right: 6px; bottom: 6px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(6, 9, 12, 0.85);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.library .librow__text { min-width: 0; padding-top: 0.125rem; }
.library .librow__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.014em;
    color: var(--ink);
}
/* Credits under a row read the same as credits under a card. */
.library .librow__by, .library .librow__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
}
.library .librow__by { color: var(--ink-3); }
.library .librow__meta .dot { margin-inline: 0; }
.library .librow__meta { margin-top: 0.125rem; }
.library .librow__blurb {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-4);
}

.library .librow__acts { display: flex; align-items: center; gap: 0.25rem; flex: none; opacity: 0; transition: opacity 0.18s var(--ease); }
.library .librow:hover .librow__acts,
.library .librow__acts:focus-within { opacity: 1; }
.library .librow__act {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.library .librow__act:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.library .librow__act svg { width: 17px; height: 17px; }
.library .librow__act .i-saved { display: none; }
.library .librow__act[aria-pressed="true"] { color: var(--accent); }
.library .librow__act[aria-pressed="true"] .i-save { display: none; }
.library .librow__act[aria-pressed="true"] .i-saved { display: block; }

/* --- categories index ----------------------------------------------------- */

.library .catgrid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: clamp(1rem, 1.8vw, 1.5rem);
}

.library .cat {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--card);
    transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.library .cat:hover { transform: translateY(-4px); border-color: rgba(244, 104, 15, 0.4); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }

.library .cat__art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.library .cat__art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.library .cat:hover .cat__art img { transform: scale(1.06); }

/* Each category is washed in its own accent, so the grid reads as a set of
   places rather than a set of screenshots. */
.library .cat__wash {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 7, 10, 0.1), rgba(4, 7, 10, 0.82)),
        linear-gradient(140deg, color-mix(in srgb, var(--tint) 55%, transparent), transparent 62%);
}
.library .cat__icon {
    position: absolute;
    left: 14px; bottom: 12px;
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(8, 11, 14, 0.6);
    backdrop-filter: blur(6px);
}
.library .cat__icon svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 1.7; }

.library .cat__body { display: block; padding: 0.9375rem 1.0625rem 1.125rem; }
.library .cat__name { display: block; font-size: 1rem; font-weight: 700; letter-spacing: -0.018em; color: var(--ink); }
.library .cat__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-3);
}
.library .cat__meta { display: block; margin-top: 0.625rem; font-size: 0.75rem; color: var(--ink-4); }

/* --- one category: banner ------------------------------------------------- */

.library .catbanner {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(200px, 24vw, 300px);
    padding: clamp(1.25rem, 3vw, 2.25rem);
    border-radius: 16px;
    overflow: hidden;
    background: var(--card);
    margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
}
.library .catbanner__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.library .catbanner__wash {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(4, 7, 10, 0.94) 8%, rgba(4, 7, 10, 0.5) 62%, rgba(4, 7, 10, 0.2)),
        linear-gradient(0deg, color-mix(in srgb, var(--tint) 38%, transparent), transparent 70%);
}
.library .catbanner__inner { position: relative; z-index: 2; max-width: 56ch; }

.library .catbanner__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: color 0.18s var(--ease), gap 0.18s var(--ease);
}
.library .catbanner__back svg { width: 14px; height: 14px; }
.library .catbanner__back:hover { color: var(--accent); gap: 0.55rem; }

.library .catbanner__name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
}
.library .catbanner__icon {
    display: grid;
    place-items: center;
    width: clamp(34px, 3vw, 44px);
    aspect-ratio: 1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}
.library .catbanner__icon svg { width: 55%; height: 55%; stroke: #fff; fill: none; stroke-width: 1.7; }

.library .catbanner__desc { margin-top: 0.875rem; font-size: clamp(0.9375rem, 1.2vw, 1.0625rem); line-height: 1.55; color: var(--ink-2); }
.library .catbanner__stats { margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-3); }

/* --- one category: filters ------------------------------------------------ */

.library .catfilters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
}
.library .catfilters__chips { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.library .catfilters__chips::-webkit-scrollbar { display: none; }
.library .catfilters__selects { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }

.library .select-wrap { position: relative; display: inline-flex; }
.library .select-wrap::after {
    content: "";
    position: absolute;
    right: 0.8125rem; top: 50%;
    width: 6px; height: 6px;
    border-right: 1.6px solid var(--ink-3);
    border-bottom: 1.6px solid var(--ink-3);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}
.library .select {
    appearance: none;
    height: 38px;
    padding: 0 2.25rem 0 0.9375rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--raised);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.library .select:hover { border-color: rgba(244, 104, 15, 0.4); color: var(--ink); }
.library .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.library .catmore { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: clamp(1.5rem, 3vw, 2.25rem); border-top: 1px solid var(--line); }
.library .catmore h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.875rem; }
.library .catmore__chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --- error page ----------------------------------------------------------- */

.library .errpage { max-width: 44rem; margin-inline: auto; }
.library .errpage__code {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
}
.library .errpage h1 {
    margin-top: 0.25rem;
    font-size: clamp(1.375rem, 1.05rem + 1.1vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.library .errpage__acts { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; justify-content: center; margin-top: 1.25rem; }

/* --- creators index ------------------------------------------------------- */

.library .crewgrid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: clamp(1rem, 1.8vw, 1.5rem);
}

.library .crewcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: clamp(1.25rem, 2.4vw, 1.75rem) 1.125rem clamp(1rem, 2vw, 1.375rem);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    text-align: center;
    transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.library .crewcard:hover {
    transform: translateY(-4px);
    border-color: rgba(244, 104, 15, 0.4);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.library .crewcard__face { margin-bottom: 0.5rem; }
.library .crewcard__face img,
.library .crewcard__face > span {
    width: 76px; height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    font-size: 1.375rem;
    font-weight: 800;
    color: #fff;
}

.library .crewcard__name {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.library .crewcard__badge {
    padding: 2px 7px;
    border: 1px solid rgba(244, 104, 15, 0.45);
    border-radius: 999px;
    background: var(--active);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd9b8;
}
.library .crewcard__handle { font-size: 0.8125rem; color: var(--ink-4); }
.library .crewcard__bio {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-3);
}
.library .crewcard__stats { margin-top: 0.625rem; font-size: 0.75rem; color: var(--ink-4); }
.library .crewcard__stats .dot { margin-inline: 0.3rem; }

.library .crewcard__go {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    transition: gap 0.18s var(--ease);
}
.library .crewcard__go svg { width: 14px; height: 14px; }
.library .crewcard:hover .crewcard__go { gap: 0.6rem; }
/* --- creator profile ------------------------------------------------------ */

.library.profile { --banner-h: clamp(140px, 17vw, 230px); }

.library .pbanner {
    position: relative;
    height: var(--banner-h);
    border-radius: 16px;
    overflow: hidden;
    background: var(--card);
}
.library .pbanner__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.library .pbanner__wash {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 7, 10, 0.35), rgba(5, 9, 12, 0.96));
}

.library .pid {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: clamp(1rem, 2.4vw, 1.75rem);
    /* Lifts the avatar over the banner, the way a profile card sits. */
    margin: calc(clamp(2.5rem, 5vw, 4rem) * -1) 0 0 clamp(0.5rem, 2vw, 2rem);
    padding-right: clamp(0.5rem, 2vw, 2rem);
    flex-wrap: wrap;
}

.library .pid__face { flex: none; }
.library .pid__face img, .library .pid__face > span {
    width: clamp(84px, 9vw, 120px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--page);
    font-size: clamp(1.5rem, 2.4vw, 2.25rem);
    font-weight: 800;
    color: #fff;
}

.library .pid__text { flex: 1; min-width: 260px; padding-top: clamp(2.25rem, 4vw, 3.25rem); }
.library .pid__name {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    font-size: clamp(1.375rem, 1.05rem + 1.1vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.library .pid__badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--active);
    border: 1px solid rgba(244, 104, 15, 0.45);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd9b8;
}
.library .pid__meta { margin-top: 0.5rem; font-size: 0.875rem; color: var(--ink-3); }
.library .pid__bio { margin-top: 0.75rem; max-width: 62ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.library .pid__genres { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.library .pid__acts { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding-top: clamp(2.25rem, 4vw, 3.25rem); margin-left: auto; }

.library .pfollow {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding-inline: 1.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent-2);
    font-size: 0.875rem;
    font-weight: 700;
    color: #0b0705;
    cursor: pointer;
    transition: filter 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), transform 0.14s var(--ease);
}
.library .pfollow:hover { filter: brightness(1.08); }
.library .pfollow:active { transform: scale(0.98); }
.library .pfollow.is-on,
.library .pfollow[aria-pressed="true"] {
    background: var(--raised);
    border: 1px solid var(--line-2);
    color: var(--ink);
}
.library .pfollow.is-on:hover { background: #182027; filter: none; }

/* --- profile tabs --------------------------------------------------------- */

.library .ptabs {
    display: flex;
    gap: clamp(1rem, 2.4vw, 2.25rem);
    margin-top: clamp(1.5rem, 2.8vw, 2.25rem);
    margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.library .ptabs::-webkit-scrollbar { display: none; }
.library .ptab {
    position: relative;
    flex: none;
    padding: 0 0 0.875rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink-3);
    white-space: nowrap;
    transition: color 0.18s var(--ease);
}
.library .ptab:hover { color: var(--ink); }
.library .ptab.is-on { color: var(--accent); font-weight: 600; }
.library .ptab.is-on::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    animation: ptab-in 0.3s var(--ease);
}
@keyframes ptab-in { from { transform: scaleX(0) } to { transform: scaleX(1) } }

.library .pabout { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.library .factsheet {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 0.625rem 1.5rem;
    max-width: 60ch;
    font-size: 0.9375rem;
}
.library .factsheet dt { color: var(--ink-3); }
.library .factsheet dd { margin: 0; color: var(--ink); }
.library .pabout__bio { max-width: 68ch; font-size: 0.9375rem; line-height: 1.7; color: var(--ink-2); }

/* --- phone ---------------------------------------------------------------- */

@media (max-width: 720px) {
    .library { --cols: 1; }
    .library .crewgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .library .crewcard__bio { display: none; }

    .library .libhead { align-items: flex-start; }
    .library .libhead__tools { width: 100%; }
    .library .libsearch { flex: 1; }
    .library .libsearch input { width: 100%; }

    .library .librow { flex-direction: row; gap: 0.625rem; }
    .library .librow__main { flex-direction: row; gap: 0.75rem; }
    .library .librow__thumb { width: 132px; border-radius: 8px; }
    .library .librow__title { font-size: 0.875rem; }
    .library .librow__blurb { display: none; }
    .library .librow__acts { opacity: 1; flex-direction: column; }

    .library .catgrid { grid-template-columns: minmax(0, 1fr); }
    .library .catfilters__selects { width: 100%; margin-left: 0; }
    .library .select { flex: 1; }

    .library .libitem__remove button { opacity: 1; transform: none; }

    .library .pid { margin-left: 0; }
    .library .pid__text, .library .pid__acts { padding-top: 0.75rem; }
    .library .pid__acts { margin-left: 0; width: 100%; }
    .library .pfollow { flex: 1; justify-content: center; }
    .library .factsheet { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
    .library .factsheet dt { margin-top: 0.625rem; font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .library .cat:hover,
    .library .hcard:hover .hcard__thumb img,
    .library .librow:hover .librow__thumb img { transform: none !important; }
    .library .ptab.is-on::after { animation: none !important; }
}
