.light-theme #container-main.legacy-library-main,
.light-theme #container-main.legacy-library-main > .content { background: #fff; }
.legacy-library {
    --library-text: #333;
    --library-link: #1763a0;
    --library-border: #bfbfbf;
    --library-rule: #e2e2e2;
    --library-panel: #ededed;
    --library-selected: #c9c9c9;
    --library-field: #fff;
    color: var(--library-text);
    font: 14px/1.35 Arial, sans-serif;
}
.dark-theme .legacy-library {
    --library-text: #eee;
    --library-link: #8bc6f4;
    --library-border: #666;
    --library-rule: #4a4b4d;
    --library-panel: #343638;
    --library-selected: #545658;
    --library-field: #252729;
}
.legacy-library :is(input, select, button) { font: inherit; }
.legacy-library :is(input:not([type=hidden], [type=checkbox]), select, button) {
    box-sizing: border-box;
    min-width: 0;
    min-height: 28px;
    padding: 3px 6px;
    border: 1px solid var(--library-border);
    background: var(--library-field);
    color: var(--library-text);
}
.legacy-library select { appearance: auto; }
.legacy-library button { background: var(--library-panel); cursor: pointer; }
.legacy-library a { color: var(--library-link); }
.legacy-library .creator-workspace-tabs a { color: inherit; }
.library-layout {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
    grid-template-areas: "sidebar search" "sidebar results";
    grid-template-rows: max-content 1fr;
    gap: 16px 20px;
    margin: 18px 0;
}
.library-sidebar { grid-area: sidebar; }
.library-results { grid-area: results; }
.library-sidebar { padding-inline-end: 15px; border-inline-end: 1px solid var(--library-rule); }
.library-categories {
    display: grid;
    border: 1px solid var(--library-border);
    background: var(--library-panel);
}
.library-categories a { display: flex; align-items: center; min-height: 32px; padding: 4px 8px; color: var(--library-text); }
.library-categories a:is(:hover, [aria-current]) { background: var(--library-selected); text-decoration: none; }
.library-filters { margin-top: 20px; }
.library-filters > summary { display: none; }
.library-filters h2 { margin: 0 0 14px; padding: 0; color: inherit; font: 22px/1.2 Arial, sans-serif; }
.library-filters :is(h3, summary) { margin: 0 0 6px; padding: 0; color: inherit; font: 600 14px/1.2 Arial, sans-serif; }
.library-filters a[aria-current] { color: var(--library-text); font-weight: 600; }
.library-genres { margin-bottom: 16px; }
.library-genres summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.library-genres summary::-webkit-details-marker { display: none; }
.library-genres summary::after { content: ""; width: 7px; height: 7px; margin-inline-end: 4px; border-inline-end: 1px solid; border-block-end: 1px solid; transform: rotate(45deg); }
.library-genres[open] summary::after { transform: rotate(225deg); }
.library-genres > a { display: inline-block; margin-bottom: 3px; }
.library-genres form > button { margin-top: 5px; }
.library-genre-options { display: grid; }
.library-genre-options label { display: flex; align-items: center; gap: 5px; min-height: 20px; margin: 0; color: inherit; cursor: pointer; }
.library-genre-options input { margin: 0; }
.library-creator-input { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 4px; margin-top: 5px; }
.library-search {
    grid-area: search;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px max-content;
    gap: 5px;
    width: min(100%, 510px);
    margin-inline-start: auto;
}
.library-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.library-heading h1 { margin: 0 0 6px; padding: 0; color: var(--library-text); font: 700 14px/1.3 Arial, sans-serif; overflow-wrap: anywhere; }
.library-heading h1 span { color: var(--library-link); }
.library-heading p { margin: 0; color: var(--library-text); font: inherit; font-size: 12px; }
.library-sort { display: flex; align-items: center; gap: 4px; }
.library-sort label { margin: 0; }
.library-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 20px 14px; margin: 0 0 15px; }
.library-card { min-width: 0; }
.library-card-image {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid var(--library-rule);
    background: var(--library-field);
    overflow: hidden;
}
.library-card-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.library-card-name { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.library-card-price { display: block; font-size: 12px; }
.library-empty { padding-block: 18px; color: var(--library-text); font: inherit; }
.library-detail { font-family: HCo Gotham SSm, Arial, sans-serif; padding-block-start: 24px; }
.library-asset {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    grid-template-areas: "preview heading" "preview details";
    grid-template-rows: max-content 1fr;
    column-gap: 12px;
    overflow-wrap: anywhere;
}
.library-asset-preview { grid-area: preview; }
.library-asset-details { grid-area: details; }
.library-preview-frame { position: relative; }
.library-detail .library-card-image { border: 0; border-radius: 4px; background: var(--library-field); }
.library-detail button:is(.library-audio-play, .library-favorite) { padding: 0; background: transparent; color: inherit; }
.library-detail button.library-audio-play {
    position: absolute;
    inset: auto 8px 8px auto;
    width: 36px;
    height: 36px;
    min-height: 0;
    display: grid;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 100%;
    background: var(--library-field);
}
.library-detail .library-recommendations button.library-audio-play { inset: auto 4px 4px auto; width: 26px; height: 26px; }
.library-audio-play span { border: 6px solid transparent; border-right: 0; border-left: 9px solid; margin-left: 2px; }
.library-audio-play[aria-pressed=true] span { width: 8px; height: 11px; border: 0; border-inline: 3px solid; margin: 0; }
.library-detail :is(button, a).library-favorite { display: inline-flex; gap: 5px; align-items: center; border: 0; color: inherit; }
.library-item-heading { grid-area: heading; display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 12px; border-bottom: 1px solid var(--library-border); }
.library-item-heading h1 { margin: 0 0 5px; padding: 0; color: inherit; font-size: clamp(24px, 3.2vw, 34px); }
.library-item-heading p { margin: 0; color: inherit; font: inherit; }
.library-item-byline, .library-owned { display: flex; align-items: center; gap: 8px; }
.library-item-byline { flex-wrap: wrap; }
.library-owned .label-checkmark { display: grid; padding: 3px; border-radius: 50%; background: #02b757; }
.library-owned .icon-checkmark-white-bold { width: 12px; height: 12px; background-size: 24px auto; background-position: 0 -516px; }
.library-item-heading .library-copy-status:not(:empty) { margin-top: 6px; font-size: 13px; }
.library-item-menu { position: relative; flex: none; }
.library-item-menu summary { list-style: none; padding: 8px; cursor: pointer; }
.library-item-menu summary::-webkit-details-marker { display: none; }
.library-item-menu > div { position: absolute; z-index: 2; inset-inline-end: 0; width: max-content; min-width: 144px; max-width: calc(100vw - 32px); border: 1px solid var(--library-rule); border-radius: 4px; box-shadow: 0 2px 6px #0002; background: var(--library-field); }
.library-item-menu > div > :is(button, a) { display: block; width: 100%; padding: 9px 12px; border: 0; background: transparent; color: inherit; text-align: start; white-space: normal; }
.library-item-menu > div > :is(button, a):hover { background: var(--library-panel); text-decoration: none; }
.library-get { display: flex; justify-content: flex-end; align-items: center; margin: 10px 0 12px; }
.library-get :is(a, button).btn-growth-md { display: block; min-width: 160px; min-height: 40px; padding: 9px 18px; border: 1px solid transparent; border-radius: 8px; background: #00b06f; color: #fff; text-align: center; font-weight: 600; }
.library-get :is(a, button).btn-growth-md:hover { background: #008f5a; text-decoration: none; }
.library-get-owned { justify-content: space-between; gap: 12px; }
.library-inventory-link { min-width: 120px; text-align: center; }
.library-asset dl { display: grid; grid-template-columns: minmax(74px, 21%) minmax(0, 1fr); gap: 11px 8px; margin: 0; }
.library-asset dt { font-weight: 600; }
.library-asset dd { margin: 0; }
.library-asset-description { white-space: pre-wrap; line-height: 1.5; }
.library-detail .library-asset-description > div { line-height: inherit; }
.library-asset-description[data-collapsed] { max-height: var(--library-description-height); overflow: hidden; }
.library-detail .library-asset button.library-description-toggle { padding: 0; border: 0; background: none; color: inherit; font-weight: 600; }
.library-description-toggle[hidden] { display: none; }
#library-get-confirm { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
#library-get-confirm .modal-message { overflow-wrap: anywhere; }
.library-recommendations { margin-top: 14px; padding: 12px 14px 16px; background: var(--library-panel); }
.library-recommendations h2 { margin: 0 0 12px; padding: 0; color: inherit; font-size: 18px; }
.library-recommendation-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.library-recommendation-grid .library-card-image { background: var(--library-selected); }
.library-recommendation-grid .library-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; font-weight: 600; }
.library-card-author { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.library-status:empty { margin: 0; }
.library-detail .library-comments { margin: 18px 0 0; scroll-margin-top: 100px; }
.library-comments h2 { margin: 0 0 8px; padding: 0; color: inherit; font-size: 18px; }
.library-comments > .section-content { padding: 12px; background: var(--library-field); }
.library-comments .comment-form .form-horizontal { gap: 8px; align-items: flex-start; }
.library-comments .comment-form .form-group { flex: 1 1 0; min-width: 0; margin: 0; }
.library-comments .comment-form .rbx-comment-input { min-width: 0; height: 36px; border-radius: 6px; border: 1px solid var(--library-border); }
.library-comments .comment-form .btn-control-md { min-height: 36px; margin: 0; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--library-border); background: transparent; color: inherit; }
.library-comments .comment-form .btn-control-md:hover { background: var(--library-panel); }
.library-comments .comment-form [role=alert] { margin: 6px 0 0; }
.library-comment-list { margin: 12px 0 0; padding: 0; list-style: none; }
.library-comment-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; border-top: 1px solid var(--library-rule); padding: 12px 0; }
.library-comment-avatar { display: block; width: 48px; height: 48px; border-radius: 50%; background: var(--library-panel); }
.library-comment-content { overflow-wrap: anywhere; }
.library-comment-content a { font-weight: 600; }
.library-comment-content p { margin: 2px 0 0; color: inherit; white-space: pre-wrap; font: inherit; }
.library-comment-controls { display: flex; flex-wrap: wrap; align-content: start; max-width: 88px; }
.library-detail .library-comment-controls :is(a, button) { display: grid; place-items: center; min-height: 32px; width: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; }
.library-detail .library-comment-controls :is(a, button):hover { background: var(--library-panel); }
.library-no-comments { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--library-rule); color: inherit; font: inherit; }
#library-get-confirm .modal-btns { display: flex; justify-content: center; gap: 10px; }
#library-get-confirm .modal-message { overflow-wrap: anywhere; }
#assetsItems .library-card-image { width: 100%; height: 100%; border: 0; }
.library-configure > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.library-configure > header h1 { margin: 0; padding: 0; font-size: clamp(24px, 3.2vw, 34px); }
.library-configure > header a { flex: none; color: inherit; font-weight: 600; }
.library-configure-overview { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 12px; }
.library-configure-overview .library-preview-frame { align-self: start; }
.library-configure .input-field { width: 100%; margin: 0; padding: 8px 12px; border: 1px solid var(--library-border); border-radius: 8px; background: var(--library-field); color: inherit; font: inherit; }
.library-configure :is(input, select).input-field { min-height: 38px; }
.library-configure dt label { margin: 0; }
.library-configure dt:has(label) { align-self: center; }
.library-configure textarea.input-field { min-height: 100px; resize: vertical; }
.library-configure output { display: block; margin-top: 3px; text-align: end; font-size: 11px; }
.library-configure label { margin-bottom: 4px; color: inherit; }
.library-configure dl { display: grid; grid-template-columns: minmax(65px, 32%) minmax(0, 1fr); gap: 10px; padding-top: 12px; border-top: 1px solid var(--library-border); }
.library-configure dd { min-width: 0; margin: 0; }
.library-configure .library-configure-heading { display: block; margin: 18px 0 10px; padding: 0; color: inherit; font-size: 20px; font-weight: 700; }
.library-configure .library-configure-notice { margin: 0 0 12px; padding: 8px 12px; border-inline-start: 4px solid #00a264; background: var(--library-panel); color: inherit; }
.library-configure .library-configure-notice[role=alert] { border-inline-start-color: #e9414f; }
.library-configure .library-configure-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px; background: var(--library-panel); cursor: pointer; }
.library-configure input.library-configure-switch {
    appearance: none;
    display: grid;
    align-items: center;
    box-sizing: border-box;
    width: 42px;
    min-height: 24px;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 20px;
    background: #656668;
    cursor: pointer;
}
.library-configure-switch::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.library-configure input.library-configure-switch:checked { justify-items: end; background: #00b06f; }
.library-configure-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.library-configure-actions button.btn-control-md { min-height: 36px; padding: 8px 16px; border-radius: 8px; background: transparent; }
.library-configure-actions button.btn-control-md:hover { background: var(--library-panel); }
.library-configure-archive { margin-top: 20px; }
.library-configure-archive fieldset { min-width: 0; padding: 10px 12px 12px; border: 1px solid var(--library-border); }
.library-configure-archive legend { width: auto; margin: 0; padding: 0 5px; border: 0; color: inherit; font: inherit; }
.library-configure-archive p { margin: 0 0 8px; color: inherit; font: inherit; }
.library-configure-archive button.btn-control-md { min-height: 36px; border-radius: 6px; padding: 6px 12px; }
@media (min-width: 768px) and (max-width: 991px) {
    .library-asset { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
    .library-configure-overview { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}
@media (min-width: 992px) {
    .legacy-library-main .legacy-library { max-width: none; padding-inline: 0; }
    .library-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}
@media (max-width: 767px) {
    .library-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "search" "sidebar" "results"; gap: 15px; }
    .library-sidebar { padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--library-rule); }
    .library-categories, .library-filters h2 { display: none; }
    .library-filters { margin-top: 0; }
    .library-filters > summary { display: list-item; min-height: 44px; margin: 0; padding: 12px 8px; cursor: pointer; }
    .library-genres { margin-bottom: 8px; }
    .library-genres summary { min-height: 44px; margin-bottom: 0; }
    .library-genre-options { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 0 8px; }
    .library-genre-options label { min-height: 44px; }
    .library-creator-input { max-width: 360px; }
    .library-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .legacy-library :is(.library-categories a, input:not([type=hidden], [type=checkbox]), select, button) { min-height: 44px; }
    .legacy-library input:not([type=hidden], [type=checkbox]) { font-size: 16px; }
    .library-asset { grid-template-columns: minmax(0, 1fr); grid-template-areas: "heading" "preview" "details"; row-gap: 12px; }
    .library-asset-preview { width: min(100%, 420px); margin-inline: auto; }
    .library-detail button.library-audio-play { width: 44px; height: 44px; }
    .library-detail .library-recommendations button.library-audio-play { width: 44px; height: 44px; }
    .library-item-menu summary { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
    .library-item-menu > div > :is(button, a) { min-height: 44px; }
    .library-get form, .library-get :is(a, button).btn-growth-md { width: 100%; }
    .library-get-owned { flex-direction: column; align-items: stretch; }
    .library-inventory-link { min-height: 44px; }
    .library-recommendation-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(100px, 25%); overflow-x: auto; }
    .library-comments .comment-form .form-horizontal { display: grid; gap: 8px; }
    .library-comments .comment-form :is(.rbx-comment-input, .btn-control-md) { min-height: 44px; }
    .library-comment-list li { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; }
    .library-comment-avatar { width: 36px; height: 36px; }
    .library-comment-controls { flex-direction: column; }
    .library-detail .library-comment-controls :is(a, button) { width: 44px; min-height: 44px; }
    .library-configure > header { align-items: flex-start; }
    .library-configure > header a { padding-block: 4px; }
    .library-configure-overview { grid-template-columns: minmax(0, 1fr); }
    .library-configure-overview .library-preview-frame { width: min(100%, 300px); margin-inline: auto; }
    .library-configure .input-field { font-size: 16px; }
    .library-configure input.library-configure-switch { min-height: 24px; }
    .library-configure-actions button.btn-control-md { width: 100%; min-height: 44px; }
    .library-configure-archive button.btn-control-md { min-height: 44px; }
}
@media (max-width: 419px) {
    .library-search { grid-template-columns: minmax(0, 1fr) max-content; }
    .library-search input:not([type=hidden]) { grid-column: 1 / -1; }
    .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
