body:has(.macro-library) { min-height: 100svh; display: flex; flex-direction: column; }
.macro-library { margin-block: clamp(36px, 7vh, 74px) auto; padding-bottom: 56px; }
.library-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.library-heading { margin-bottom: 27px; }
.macro-library h1 { transform: none; font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -.04em; }
#library-search { display: flex; align-items: center; border-bottom: 1px solid #686960; }
#library-search:focus-within { border-color: var(--green); }
#library-search input, #library-search button, #library-sort, #library-more { color: inherit; background: transparent; font: inherit; border: 0; }
#library-search input { width: clamp(165px,23vw,270px); padding: 10px 0; }
#library-search input::placeholder { color: var(--muted); }
#library-search input:focus { outline: none; }
#library-search button, #library-more { padding: 10px 3px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.results-heading h2, #library-sort { font-weight: 400; font-size: .88rem; color: var(--muted); }
#library-sort { min-height: 40px; background: #242522; }
#library-list { list-style: none; margin: 0; padding: 0; }
#library-list li { border-top: 1px solid var(--rule); }
#library-list .level-link { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 11px 0; }
#library-list .level-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.replay-preview { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 16/9; border-radius: 4px; background: #30342e; color: #a8b2a6; font: 650 1.35rem "Inter Tight", system-ui, sans-serif; }
.replay-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#library-list .level-link strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.replay-downloads { color: var(--muted); font-size: .87rem; font-variant-numeric: tabular-nums; }
#library-more { color: var(--green); margin-top: 10px; }
#library-fallback a { text-decoration: underline; }
@media (max-width: 600px) {
  .library-heading { align-items: stretch; flex-direction: column; margin-bottom: 12px; }
  #library-search input { width: auto; min-width: 0; flex: 1; }
  #library-list .level-link { grid-template-columns: 76px minmax(0,1fr); gap: 2px 12px; }
  .replay-preview { grid-row: 1 / span 2; }
  .replay-downloads { grid-column: 2; }
}

#library-list button.level-link { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.level-link small { display: block; margin-top: 3px; font-size: .85rem; color: var(--muted); }
#recordings-panel { width: min(420px, calc(100% - 32px)); max-height: 75dvh; padding: 0; background: #2b2c28; color: inherit; border: 1px solid #505149; border-radius: 9px; }
#recordings-panel[open] { display: flex; flex-direction: column; }
#recordings-panel::backdrop { background: rgb(12 13 11 / .65); }
.recordings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 14px; }
.recordings-heading h2 { font: 750 1.55rem/1.15 "Inter Tight",system-ui,sans-serif; overflow-wrap: anywhere; }
.recordings-heading p { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.recordings-heading button { padding: 7px 10px; background: transparent; color: inherit; border: 1px solid var(--rule); border-radius: 5px; font: inherit; cursor: pointer; }
#recordings-list { overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0 20px 10px; list-style: none; }
#recordings-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
#recordings-list a:hover { color: var(--green); }
#recordings-list small { flex-shrink: 0; color: var(--muted); }
#thumbnail-tools, #thumbnail-status { margin: 0 20px 12px; }
#thumbnail-status { color: var(--muted); font-size: .86rem; }
#thumbnail-status:empty { display: none; }
#choose-thumbnail { color: inherit; background: transparent; border: 1px solid var(--rule); border-radius: 5px; padding: 7px 10px; font: inherit; font-size: .87rem; cursor: pointer; }
