.library-view { min-width: 0; }
.library-segment-probe { position:fixed; left:0; top:0; width:0; height:0; visibility:hidden; pointer-events:none; transform:scale(0); overflow:hidden; contain:strict; }
.library-segment-probe[data-axis=horizontal] { padding-left:env(viewport-segment-right 0 0,0px); padding-right:env(viewport-segment-left 1 0,0px); }
.library-segment-probe[data-axis=vertical] { padding-top:env(viewport-segment-bottom 0 0,0px); padding-bottom:env(viewport-segment-top 0 1,0px); }
.library-view[data-segments=horizontal] .library-heading,
.library-view[data-segments=horizontal] .library-toolbar,
.library-view[data-segments=horizontal] .library-feedback { width:var(--library-first-segment-width); max-width:var(--library-first-segment-width); margin-left:var(--library-toolbar-offset,0px); }
.library-view[data-segments=horizontal] .library-toolbar { grid-template-columns:minmax(0,1fr); }
.library-view[data-segments=horizontal] .library-search,
.library-view[data-segments=horizontal] .library-fav-filter { grid-column:auto; }
.library-view[data-segments=vertical] { position:fixed; top:var(--library-segment-top); bottom:max(var(--library-segment-bottom),env(safe-area-inset-bottom)); left:max(18px,env(safe-area-inset-left)); right:max(18px,env(safe-area-inset-right)); overflow:auto; overscroll-behavior:contain; padding-right:4px; scroll-padding-top:12px; }
@media(min-width:600px) { .library-view[data-segments=vertical] { left:calc(104px + env(safe-area-inset-left)); right:max(28px,env(safe-area-inset-right)); } }
.library-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.library-heading h1 { margin:0 0 8px; }
.library-summary { margin:0; font-size:12px; }
.library-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto 44px; align-items:center; gap:8px; padding:10px; margin-bottom:16px; }
.library-toolbar label { display:flex; flex-direction:column; gap:7px; min-width:0; }
.library-label { font-size:11px; font-weight:500; }
.library-search { grid-column:auto; }
.library-search > .library-label { display:none; }
.library-filter-toggle { display:flex; align-items:center; justify-content:center; gap:5px; min-height:44px; padding:8px; font-size:12px; }
.library-filter-count { display:inline-grid; place-items:center; min-width:19px; height:19px; border-radius:50%; background:var(--fg); color:var(--bg); font:600 10px/1 monospace; }
.library-filter-count[hidden],.library-filter-options[hidden] { display:none; }
.library-filter-options { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-top:6px; }
.library-filter-options label:last-child { grid-column:1 / -1; }
.library-filter-toggle > *, .library-fav-filter > * { pointer-events:none; }
.library-search-control { position:relative; display:flex; align-items:center; }
.library-search-control > svg { width:18px; height:18px; position:absolute; left:12px; pointer-events:none; }
.library-toolbar .field { width:100%; min-width:0; box-sizing:border-box; height:44px; margin-bottom:0; display:block; }
.library-search-control > input { padding-left:38px; }
.library-fav-filter { grid-column:auto; display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:10px; gap:8px; }
.library-fav-filter > span { display:none; }
.library-fav-filter svg { width:18px; height:18px; }
.library-fav-filter[aria-pressed=true] { border-color:currentColor; }
.library-fav-filter[aria-pressed=true] svg, .library-favorite[aria-pressed=true] svg { fill:currentColor; }
.library-feedback:not(:empty) { padding:12px 0 20px; font-size:13px; }
.library-feedback .button { margin-left:8px; }
.library-window { overflow-anchor:none; }
.library-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:14px; row-gap:14px; padding-bottom:14px; }
.library-grid:empty { padding-bottom:0; }
.library-card { min-width:0; height:var(--library-card-height); overflow:hidden; display:flex; flex-direction:column; border-radius:23px; contain:layout style; }
.library-open { display:flex; flex-direction:column; flex:1; width:100%; min-width:0; padding:0; border:0; border-radius:0; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; }
.library-thumb { position:relative; display:block; width:100%; aspect-ratio:16/9; background:#090b0e; overflow:hidden; color:#ececec; }
.library-thumb img { position:relative; width:100%; height:100%; object-fit:cover; display:block; z-index:1; }
.library-thumb-fallback { position:absolute; inset:0; display:grid; place-items:center; }
.library-thumb-fallback svg { width:27px; height:27px; }
.library-duration { position:absolute; right:8px; bottom:7px; z-index:2; padding:3px 5px; border-radius:4px; background:#000c; color:#fff; font-size:11px; }
.library-title { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; font-size:12px; font-weight:600; line-height:17px; margin:11px 11px 0; height:34px; }
.library-game { display:block; max-width:calc(100% - 22px); text-overflow:ellipsis; white-space:nowrap; overflow:hidden; margin:3px 11px 0; font-size:10px; line-height:15px; }
.library-card-footer { display:flex; justify-content:space-between; align-items:center; min-height:44px; padding-left:11px; gap:3px; }
.library-date { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.library-card-footer .icon-button { flex:0 0 44px; min-width:44px; min-height:44px; padding:11px; border:0; background:transparent; }
.library-favorite svg { width:19px; height:19px; }
.library-placeholder { height:var(--library-card-height); display:grid; place-items:center; font-size:12px; border-radius:23px; }
.library-footer { font-size:11px; text-align:center; min-height:24px; margin:10px 0 20px; }
.library-new { animation:library-arrive 310ms cubic-bezier(.16,1,.3,1) both; }
@keyframes library-arrive { from { opacity:0; transform:translateY(-12px) scale(.98); } to { opacity:1; transform:none; } }
@media (min-width:600px) {
  .library-toolbar { grid-template-columns:minmax(130px,2fr) repeat(2,minmax(90px,1fr)); }
  .library-search { grid-column:auto; order:1; }
  .library-search > .library-label { display:block; }
  .library-filter-toggle { display:none; }
  .library-filter-options:not([hidden]) { display:contents; }
  .library-filter-options label { order:2; }
  .library-filter-options label:last-child { grid-column:auto; }
  .library-fav-filter > span { display:inline; }
  .library-fav-filter { grid-column:auto; align-self:end; min-height:44px; order:3; }
  .library-title { font-size:13px; }
  .library-game { font-size:11px; }
  .library-date { font-size:10px; }
}
@media (min-width:980px) {
  .library-toolbar { grid-template-columns:minmax(160px,2fr) minmax(120px,1.2fr) repeat(2,minmax(100px,1fr)) auto; }
}
@media (prefers-reduced-motion:reduce) { .library-new { animation:none; } }
html[data-reduced-motion=true] .library-new, html[data-motion=reduce] .library-new { animation:none; }
