/* FRAME UX pass: shared layout and primitives.
   Keep select elements native for reliable browser/keyboard behavior, but unify their visual styling. */
:root{--frame-step-1:4px;--frame-step-2:8px;--frame-step-3:12px;--frame-step-4:16px;--frame-step-5:24px;--frame-step-6:32px;
--frame-radius-sm:8px;--frame-radius-md:12px;--frame-radius-lg:16px;
--frame-secondary-readable:color-mix(in srgb,var(--text) 78%,var(--bg) 22%)}
.shell{grid-template-columns:208px minmax(0,1fr)}
.sidebar{padding:20px 12px 16px;gap:18px;overflow-y:auto;scrollbar-width:thin}
.frame-side-header{display:flex;align-items:center;justify-content:space-between;gap:4px}
.frame-side-header .logo{font-size:23px;padding:0 7px}
.frame-collapse,.frame-mobile-menu-button{display:flex;align-items:center;justify-content:center;min-width:36px;min-height:36px;border:1px solid var(--line);background:var(--surface2);border-radius:10px;color:var(--muted)}
.frame-collapse:hover,.frame-mobile-menu-button:hover{color:var(--text);border-color:var(--accent)}
.sidebar>div:nth-child(2){flex:1;display:flex;flex-direction:column;gap:16px}
.frame-nav-groups{display:flex;flex-direction:column;gap:19px}
.frame-nav-label{font-size:12px;letter-spacing:1px;font-weight:800;text-transform:uppercase;color:var(--frame-secondary-readable);margin:0 0 7px;padding:0 11px}
.sidebar .nav{gap:3px}
.sidebar .nav button,.frame-nav-bottom button{width:100%;font-size:13px;min-height:40px;padding:9px 11px;border-radius:11px;gap:12px;display:flex;align-items:center;text-align:left;background:transparent;border:0;color:var(--frame-secondary-readable);font-weight:700}
.sidebar .nav button b,.frame-nav-bottom button b,.mobile-nav b{width:19px;height:19px;display:flex;align-items:center;justify-content:center;flex:none;font-weight:normal}
.sidebar .nav button.active,.frame-nav-bottom button.active{background:var(--surface3);color:var(--text)}
.sidebar .nav button.active b,.frame-nav-bottom button.active b{color:var(--accent)}
.sidebar .nav button:hover,.frame-nav-bottom button:hover{background:var(--hover);color:var(--text)}
.frame-nav-bottom{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
.frame-nav-bottom button{cursor:pointer}
.shell:has(.sidebar.is-collapsed){grid-template-columns:66px minmax(0,1fr)}
.sidebar.is-collapsed{padding:16px 9px}
.sidebar.is-collapsed .frame-side-header .logo{font-size:0;width:0;overflow:hidden;padding:0}
.sidebar.is-collapsed .frame-side-header{justify-content:center}
.sidebar.is-collapsed .frame-nav-label,.sidebar.is-collapsed .nav button span,.sidebar.is-collapsed .frame-nav-bottom button span{display:none}
.sidebar.is-collapsed .frame-nav-groups{gap:16px}
.sidebar.is-collapsed .nav button,.sidebar.is-collapsed .frame-nav-bottom button{width:46px;height:42px;justify-content:center;padding:7px;margin:0 auto}
.sidebar.is-collapsed .nav button b,.sidebar.is-collapsed .frame-nav-bottom button b{width:20px}
.sidebar.is-collapsed .frame-collapse{min-width:40px}
.frame-mobile-menu-button{display:none}
.frame-source-footer{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;color:var(--frame-secondary-readable);border-top:1px solid var(--line);padding:17px 24px 22px;font-size:12px;line-height:1.5}
.frame-source-footer button{border:0;background:none;color:var(--text);text-decoration:underline;text-underline-offset:3px;font-size:12px;cursor:pointer}
.page-head{align-items:center;margin:0 0 19px;gap:16px}
.page-head h1{font-size:clamp(25px,2.6vw,34px);letter-spacing:-1.1px;margin:0 0 4px;line-height:1.14}
.page-head p{font-size:13px;max-width:590px;line-height:1.5;color:var(--frame-secondary-readable)}
.page-head-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;flex-shrink:0}
.content{padding-top:22px}
.topbar{height:66px}
.topbar .frame-theme-toggle{width:39px;min-width:39px;display:inline-flex;align-items:center;justify-content:center}
.poster-card .pc-name{white-space:normal;overflow:visible;text-overflow:clip;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-clamp:2;min-height:2.75em;line-height:1.4;overflow-wrap:anywhere;font-size:13px}
.poster-card .pc-meta{font-size:12px;white-space:normal}
.poster .mark:not(.saved){opacity:0;pointer-events:none}
.poster-card:hover .poster .mark,.poster-card:focus-within .poster .mark,.poster-card:focus-visible .poster .mark,.rec:hover .poster .mark,.rec:focus-within .poster .mark{opacity:1;pointer-events:auto}
.poster .mark.saved{opacity:1;pointer-events:auto}
.frame-poster-status,.frame-poster-rating{position:absolute;bottom:6px;left:6px;padding:5px 7px;background:#0c151be3;border-radius:7px;border:1px solid #ffffff24;color:#fff;font-size:12px;font-weight:750;z-index:2;pointer-events:none}
.frame-poster-rating{left:auto;right:6px;bottom:6px}
.poster-card:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:13px}
.statrow{gap:10px;margin-top:14px}
.stat{padding:12px 14px;min-height:76px;border-radius:var(--frame-radius-lg)}
.stat strong{font-size:21px;line-height:1.18}
.stat span{font-size:12px;line-height:1.35;color:var(--frame-secondary-readable);margin-top:5px}
.stat.frame-stat-button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;cursor:pointer;color:var(--text);width:100%}
.stat.frame-stat-button:hover{border-color:var(--accent);background:var(--surface2)}
.stat.frame-stat-button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.stat .frame-stat-cta{font-size:12px;color:var(--frame-secondary-readable)}
button:disabled,[aria-disabled=true]{cursor:not-allowed!important;opacity:.45;filter:none!important}
select,.form-input,select.form-input,.library-sort select,.library-filter-field select,.tracker-row select{
 appearance:none;-webkit-appearance:none;
 background-color:var(--surface2);color:var(--text);border:1px solid var(--line);
 border-radius:var(--frame-radius-md);padding:10px 33px 10px 12px;min-height:39px;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ba6a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 background-position:right 11px center;background-repeat:no-repeat;background-size:15px;
 font-family:inherit;font-size:13px;
}
input.form-input,textarea.form-input,textarea.form-area,input[type=file].form-input,input[type=number].form-input,input[type=url].form-input,input[type=search].form-input{background-image:none;padding-right:12px}
select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.frame-nav-label,.caption,.eyebrow,.mini,.tag,.field label,.library-filter-field span,.fs-label,.fs-help,.catalog-help,.frame-source-footer,.rec-meta,.rec-anchor,.rec-results-tools label{font-size:max(12px,1em);line-height:1.45}
.field label,.library-filter-field span,.fs-label{font-size:12px}
.mini,.tag,.catalog-help,.fs-help,.rec-meta,.rec-anchor{font-size:12px;color:var(--frame-secondary-readable)}
.eyebrow{color:var(--frame-secondary-readable)}
.panel p,.page-head p,.rec .rec-summary,.catalog-preview-body p{color:var(--frame-secondary-readable)}
.frame-mobile-overlay{display:none}
@media(max-width:800px){
 .sidebar{display:none}
 .shell,.shell:has(.sidebar.is-collapsed){grid-template-columns:minmax(0,1fr)}
 .frame-mobile-menu-button{display:flex}
 .frame-mobile-overlay{display:block;position:fixed;inset:0;z-index:1400;background:#000b}
 .frame-mobile-drawer{position:absolute;inset:0 auto 0 0;width:min(310px,88vw);background:var(--surface);border-right:1px solid var(--line);padding:25px 18px;display:flex;flex-direction:column;gap:20px;overflow-y:auto}
 .frame-mobile-drawer h2{font-size:19px;margin:0}
 .frame-mobile-drawer .frame-nav-groups{gap:24px}
 .frame-mobile-drawer .frame-nav-bottom{margin-top:auto}
 .frame-mobile-drawer .nav{display:flex;flex-direction:column;gap:3px}
 .frame-mobile-drawer .nav button,.frame-mobile-drawer .frame-nav-bottom button{display:flex;align-items:center;gap:12px;text-align:left;padding:10px 12px;min-height:43px;border:0;background:transparent;color:var(--text);border-radius:10px;width:100%}
 .frame-mobile-drawer .nav button.active,.frame-mobile-drawer .frame-nav-bottom button.active{background:var(--surface3);color:var(--accent)}
 .frame-mobile-drawer .nav button b,.frame-mobile-drawer .frame-nav-bottom button b{width:22px;display:flex}
 .frame-mobile-drawer .frame-nav-label{display:block}
 .page-head{align-items:flex-start;flex-wrap:wrap}
 .page-head-actions{margin-left:auto}
 .content{padding-top:17px}
 .mobile-nav b svg{width:19px;height:19px}
}
@media(max-width:520px){
 .page-head h1{font-size:27px}
 .page-head-actions{width:100%;justify-content:flex-start}
 .statrow{grid-template-columns:repeat(2,minmax(0,1fr))}
 .topbar{padding:0 11px}
 .frame-mobile-menu-button{min-width:34px;min-height:36px}
 .topbar .searchbar{min-width:0;flex:1 1 0;width:0}
 .mobile-nav span{font-size:10px}
}

/* Shared poster quick actions and aligned carousel arrows */
.frame-rail-controls{display:flex;gap:6px;align-items:center}
.frame-rail-controls button{min-width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:var(--surface2);color:var(--text);font-size:23px;line-height:1}
.frame-rail-controls button:hover{border-color:var(--accent)}
.frame-rail-controls button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.frame-card-quick{display:flex;gap:5px;align-items:center;margin-top:8px;opacity:0;pointer-events:none;transition:opacity .15s}
.poster-card:hover .frame-card-quick,.poster-card:focus-within .frame-card-quick,.poster-card:focus-visible .frame-card-quick{opacity:1;pointer-events:auto}
.frame-card-quick button{flex:1;min-height:33px;background:var(--surface2);border:1px solid var(--line);border-radius:9px;color:var(--text);font-size:15px;font-weight:800}
.frame-card-quick button:hover,.frame-card-quick button:focus-visible{background:var(--surface3);border-color:var(--accent)}
@media(max-width:800px){.frame-card-quick{opacity:1;pointer-events:auto}}
@media(prefers-reduced-motion:reduce){.frame-card-quick{transition:none}}

/* Home: utility-first and compact editorial hero */
.content:has(.frame-continue-section) .frame-continue-section{margin-top:4px}
.frame-continue-rail{padding-bottom:13px}
.frame-continue-card{display:flex;flex-direction:column;flex:0 0 152px;min-width:0}
.frame-continue-card .poster-card{flex:0 0 auto}
.frame-continue-progress{padding:6px 1px 0;display:flex;flex-direction:column;gap:7px}
.frame-continue-progress>span{font-size:12px;color:var(--frame-secondary-readable);font-weight:700}
.frame-progress-track{height:4px;width:100%;overflow:hidden;background:var(--surface3);border-radius:99px}
.frame-progress-track i{display:block;height:100%;background:var(--accent);border-radius:inherit}
.frame-progress-empty{opacity:.5}
.frame-home-empty{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:13px 16px}
.frame-home-empty span{color:var(--frame-secondary-readable);font-size:13px}
.frame-home-stats{margin-bottom:15px}
.frame-home-stats+.hero{min-height:215px}
.hero{min-height:230px;grid-template-columns:minmax(0,1.5fr) minmax(180px,.65fr);border-radius:var(--frame-radius-lg)}
.hero-content{min-height:230px;padding:21px clamp(18px,2.5vw,35px)}
.hero-visual{min-height:220px;padding:13px 17px}
.hero-visual-image{max-height:207px;max-width:142px;object-fit:contain}
.hero-atmosphere{inset:0;filter:blur(4px) saturate(.9);opacity:.55;background-position:center 35%}
.hero::after{background:linear-gradient(90deg,var(--surface) 0%,color-mix(in srgb,var(--surface) 93%,transparent) 42%,color-mix(in srgb,var(--surface) 35%,transparent) 100%)}
.hero h1{font-size:clamp(23px,2.4vw,34px);letter-spacing:-.8px;margin:7px 0}
.hero p{font-size:13px;line-height:1.5;max-height:4.5em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.hero-kicker{font-size:12px;letter-spacing:.5px;color:var(--frame-secondary-readable);text-transform:uppercase}
.hero-actions{margin-top:9px}
@media(max-width:600px){
 .hero{grid-template-columns:minmax(0,1fr) 115px;min-height:220px}
 .hero-content{min-height:220px;padding:16px}
 .hero-visual{min-height:190px;padding:10px}
 .hero-visual-image{width:100%;max-width:100px;max-height:155px}
 .hero h1{font-size:22px}
 .hero p{font-size:12px;-webkit-line-clamp:3}
 .hero-actions{gap:6px}
 .hero-actions button{padding:8px 9px;font-size:11px}
}

/* Library: refined sort, collection groups and zero-count facets */
.library-views .library-view .count{font-size:12px}
.library-views .library-view:has(.count:last-child){min-height:37px}
.library-view:has(.count:last-child){transition:opacity .15s}
.library-view[aria-pressed=false]:has(.count){color:var(--frame-secondary-readable)}
.library-toolbar .library-sort{align-items:center}
.library-sort>span{display:none}
.library-toolbar input[type=search]{font-size:13px}
.frame-collection-toggle{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--frame-secondary-readable);margin:14px 0 12px;cursor:pointer}
.frame-collection-toggle input{width:16px;height:16px;accent-color:var(--accent)}
.frame-library-group{margin-bottom:28px}
.frame-library-group h2{font-size:18px;line-height:1.35;margin:0 0 12px}
.frame-library-group h2 span{color:var(--frame-secondary-readable);font-size:12px;font-weight:600}
.frame-library-group .catalog-grid{margin:0}
/* Watch tracker: use the available horizontal space for useful progress data. */
.frame-tracker-stats{margin-bottom:18px}
.frame-tracker-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0 18px}
.frame-tracker-toolbar input{flex:1;min-width:200px;border:1px solid var(--line);border-radius:12px;background:var(--surface2);padding:11px 14px;color:var(--text);font-size:13px;min-height:42px}
.frame-tracker-toolbar select{min-width:175px}
.frame-tracker-clear{border:1px solid var(--line);border-radius:10px;background:var(--surface2);color:var(--text);padding:9px 12px;font-size:12px;margin:0 0 15px}
.frame-tracker-groups{display:flex;flex-direction:column;gap:15px;max-width:1200px}
.frame-tracker-group{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.frame-tracker-group-head{width:100%;display:flex;align-items:center;justify-content:space-between;border:0;background:var(--surface2);color:var(--text);padding:16px 19px;text-align:left}
.frame-tracker-group-head h2{font-size:17px;margin:0;font-weight:850}
.frame-tracker-group-head h2 span{font-size:12px;color:var(--frame-secondary-readable);margin-left:7px}
.frame-tracker-group-head>span{font-size:22px;color:var(--frame-secondary-readable)}
.frame-tracker-group-head:hover,.frame-tracker-group-head:focus-visible{background:var(--surface3)}
.frame-tracker-row{display:grid;grid-template-columns:70px minmax(190px,1fr) minmax(250px,330px);gap:17px;align-items:center;border-top:1px solid var(--line);padding:14px 18px;min-width:0}
.frame-tracker-open{display:block;width:70px;padding:0;border:0;background:transparent;border-radius:10px}
.frame-tracker-open img,.frame-tracker-no-poster{display:block;width:70px;height:105px;object-fit:cover;border-radius:9px;background:var(--surface2)}
.frame-tracker-no-poster{font-size:12px;padding:12px 4px;color:var(--frame-secondary-readable)}
.frame-tracker-main{display:flex;flex-direction:column;gap:8px;align-items:flex-start;min-width:0}
.frame-tracker-title{padding:0;border:0;background:transparent;text-align:left;font-size:15px;font-weight:850;color:var(--text);line-height:1.35}
.frame-tracker-title:hover{color:var(--accent)}
.frame-tracker-progress{font-size:13px;color:var(--text)}
.frame-tracker-details{color:var(--frame-secondary-readable);font-size:12px;line-height:1.4}
.frame-tracker-main .frame-progress-track{max-width:360px}
.frame-tracker-controls{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:12px;align-items:end}
.frame-tracker-controls label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--frame-secondary-readable)}
.frame-tracker-controls select{width:100%;font-size:12px;min-height:38px}
.frame-tracker-rating span{font-weight:850;color:var(--text)}
.frame-tracker-rating input{width:100%;min-height:38px;accent-color:var(--accent)}
.frame-tracker-none{color:var(--frame-secondary-readable);font-size:13px;padding:20px;margin:0}
@media(max-width:900px){
 .frame-tracker-row{grid-template-columns:70px minmax(0,1fr);gap:12px 15px}
 .frame-tracker-controls{grid-column:2;max-width:410px}
}
@media(max-width:540px){
 .frame-tracker-toolbar{display:grid;grid-template-columns:1fr 1fr}
 .frame-tracker-toolbar input{grid-column:1/-1;width:100%;min-width:0}
 .frame-tracker-toolbar select{width:100%;min-width:0;font-size:12px}
 .frame-tracker-row{grid-template-columns:58px minmax(0,1fr);gap:8px 11px;padding:13px}
 .frame-tracker-open,.frame-tracker-open img,.frame-tracker-no-poster{width:58px}
 .frame-tracker-open img,.frame-tracker-no-poster{height:87px}
 .frame-tracker-controls{grid-column:1/-1}
 .frame-tracker-group-head{padding:14px}
}
/* Rating interaction consistently styled, with keyboard-accessible range controls */
.frame-tracker-controls input[type=range]:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* Clear empty-view states, readable metadata and accessible source links. */
.library-view.is-empty:not([aria-pressed=true]){opacity:.51}
.library-view.is-empty:hover,.library-view.is-empty:focus-visible{opacity:1}
.frame-source-footer a{font-size:12px;color:var(--frame-secondary-readable);text-underline-offset:2px}
.frame-source-footer a:hover{color:var(--text)}
.content small,.content .catalog-help,.content .rec-meta,.content .rec .rec-fit,.content .rec .rec-reasons-label,.content .rec .rec-anchor,
.catalog-finder small,.catalog-finder .catalog-help,.fs-panel small,.fs-panel .fs-help,
.frame-tracker-details{font-size:12px;line-height:1.45}
.content .rec .rec-summary{font-size:13px;line-height:1.5}

/* Quick actions overlay the card artwork instead of adding unused whitespace. */
.poster-card .frame-card-quick{position:absolute;z-index:5;top:37%;left:7px;right:7px;margin:0;padding:5px;gap:5px;
 border:1px solid #ffffff27;border-radius:11px;background:#0b1217dd;box-shadow:0 5px 20px #0006;backdrop-filter:blur(6px)}
.poster-card .frame-card-quick button{min-height:34px;background:#27312e;color:#f6f8f7;border-color:#ffffff25}
.poster-card .frame-card-quick button:hover{background:#3a4d45;border-color:#a8cab5}
@media(max-width:800px){.poster-card .frame-card-quick{top:34%;}}
