/* Step 5 visual collection editor. Scoped to Set Up Collection only. */
.collection-editor-shell{overflow:hidden}
.collection-category-list{display:grid;gap:10px}
.collection-category-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:78px;
  padding:12px 13px 12px 15px;
  border:1px solid var(--line-soft);
  border-radius:17px;
  background:rgba(255,255,255,.018);
  transition:border-color .18s ease,background .18s ease,opacity .18s ease;
}
.collection-category-row.selected{
  border-color:rgba(129,140,248,.34);
  background:linear-gradient(135deg,rgba(99,102,241,.075),rgba(139,92,246,.035));
}
.collection-category-toggle{
  min-width:0;
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:center;
  gap:13px;
  cursor:pointer;
}
.collection-category-toggle input{position:absolute;opacity:0;pointer-events:none}
.collection-category-copy{min-width:0;display:grid;gap:4px}
.collection-category-copy b{font-size:16px;line-height:1.25;color:#f2f2f4}
.collection-category-copy small{font-size:13px;line-height:1.4;color:var(--muted)}
.collection-edit-button{
  min-width:72px;
  min-height:38px;
  padding:0 16px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.055);
  color:#f5f5f7;
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.collection-edit-button:hover:not(:disabled){background:rgba(255,255,255,.09)}
.collection-edit-button:disabled{opacity:.32;cursor:default}

.folder-editor-toolbar{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  margin-bottom:20px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line-soft);
}
.folder-editor-count{min-width:0;display:grid;gap:4px}
.folder-editor-count b{font-size:16px;color:#f4f4f6}
.folder-editor-count span{font-size:13px;line-height:1.4;color:var(--muted)}
.folder-sort-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 16px;
  padding:14px 15px;
  border:1px solid var(--line-soft);
  border-radius:16px;
  background:rgba(255,255,255,.018);
}
.folder-sort-copy{min-width:0;display:grid;gap:3px}
.folder-sort-copy b{font-size:14px;color:#f2f2f4}
.folder-sort-copy span{font-size:12px;line-height:1.45;color:var(--muted)}
.folder-sort-select-wrap{flex:0 0 auto}
.folder-sort-select-wrap select{
  min-width:150px;
  min-height:40px;
  border:1px solid var(--line);
  border-radius:999px;
  background-color:rgba(8,9,12,.78);
  color:#f5f5f7;
  padding:0 38px 0 15px;
  font:inherit;
  font-size:12.5px;
  font-weight:700;
  outline:none;
  appearance:none;
  -webkit-appearance:none;
  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='%23a7a7ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 13px center;
}
.folder-edit-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:start;
  gap:14px;
}
.folder-edit-card-wrap{min-width:0;display:grid;gap:8px}
.folder-edit-card{
  width:100%;
  min-width:0;
  padding:0;
  overflow:hidden;
  text-align:left;
  border:1px solid rgba(255,255,255,.09);
  border-radius:16px;
  background:rgba(255,255,255,.02);
  color:inherit;
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,opacity .18s ease,box-shadow .18s ease;
}
.folder-edit-card:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.18)}
.folder-edit-card.selected{
  border-color:rgba(129,140,248,.62);
  box-shadow:0 0 0 1px rgba(129,140,248,.15);
}
.folder-edit-card.removed{opacity:.48;filter:saturate(.55)}
.folder-edit-card.removed:hover{opacity:.68}
.folder-edit-image{
  position:relative;
  display:block;
  aspect-ratio:16/9;
  overflow:hidden;
  background:rgba(255,255,255,.035);
}
.folder-edit-image[data-tile-shape="POSTER"]{aspect-ratio:2/3}
.folder-edit-image[data-tile-shape="SQUARE"]{aspect-ratio:1}
.folder-edit-art{width:100%;height:100%;display:block;object-fit:cover}
.folder-edit-image.art-missing::before,
.folder-art-fallback{
  content:"";
  position:absolute;
  inset:0;
  display:block;
  background:linear-gradient(135deg,rgba(99,102,241,.22),rgba(17,18,23,.75));
}
.folder-edit-shade{position:absolute;inset:0;background:linear-gradient(to top,rgba(4,5,8,.25),transparent 55%);pointer-events:none}
.folder-edit-card.removed .folder-edit-shade{background:rgba(5,6,8,.55)}
.folder-edit-state{
  position:absolute;
  top:9px;
  right:9px;
  width:27px;
  height:27px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.42);
  background:rgba(8,9,12,.78);
  color:#fff;
  font-size:15px;
  font-weight:900;
  box-shadow:0 4px 14px rgba(0,0,0,.25);
}
.folder-edit-card.selected .folder-edit-state{background:#f4f4f6;color:#15161a;border-color:#f4f4f6}
.folder-edit-meta{display:grid;gap:3px;padding:11px 12px 12px}
.folder-edit-meta b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.25;color:#f2f2f4}
.folder-edit-meta small{font-size:11.5px;color:var(--muted)}
.folder-edit-card.removed .folder-edit-meta small{color:#c0c1c7}
.folder-card-order{display:flex;justify-content:flex-end;gap:6px}
.folder-order-button{
  width:32px;height:32px;border-radius:999px;border:1px solid var(--line-soft);
  background:rgba(255,255,255,.035);color:#d9d9df;font:inherit;font-size:13px;font-weight:800;cursor:pointer;
}
.folder-order-button:hover:not(:disabled){background:rgba(255,255,255,.075)}
.folder-order-button:disabled{opacity:.25;cursor:default}
.folder-editor-actions{justify-content:flex-end;margin-top:18px}

body.light .collection-category-row{border-color:rgba(0,0,0,.08);background:rgba(255,255,255,.5)}
body.light .collection-category-row.selected{border-color:rgba(79,70,229,.25);background:linear-gradient(135deg,rgba(99,102,241,.07),rgba(139,92,246,.035))}
body.light .collection-category-copy b,body.light .folder-editor-count b,body.light .folder-edit-meta b,body.light .folder-sort-copy b{color:#202126}
body.light .collection-category-copy small,body.light .folder-editor-count span,body.light .folder-edit-meta small,body.light .folder-sort-copy span{color:#686b73}
body.light .collection-edit-button{border-color:rgba(0,0,0,.10);background:rgba(255,255,255,.7);color:#202126}
body.light .collection-edit-button:hover:not(:disabled){background:#fff}
body.light .folder-edit-card{border-color:rgba(0,0,0,.09);background:#fff}
body.light .folder-edit-card.selected{border-color:rgba(79,70,229,.48);box-shadow:0 0 0 1px rgba(79,70,229,.08)}
body.light .folder-edit-card.removed{opacity:.52}
body.light .folder-sort-toolbar{border-color:rgba(0,0,0,.08);background:rgba(255,255,255,.52)}
body.light .folder-sort-select-wrap select{border-color:rgba(0,0,0,.10);background-color:#fff;color:#202126}
body.light .folder-order-button{border-color:rgba(0,0,0,.10);background:#fff;color:#202126}

@media(max-width:1000px){
  .folder-edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .folder-editor-toolbar{grid-template-columns:auto minmax(0,1fr)}
  .folder-editor-toolbar>.action-group{grid-column:1/-1;justify-content:flex-end}
}
@media(max-width:700px){
  .collection-category-row{min-height:72px;padding:11px 11px 11px 13px}
  .collection-category-copy b{font-size:15px}
  .collection-category-copy small{font-size:12.5px}
  .collection-edit-button{min-width:64px;padding-inline:13px}
  .folder-editor-toolbar{grid-template-columns:1fr;align-items:start;gap:11px}
  .folder-editor-toolbar>.action-group{grid-column:auto;width:100%;display:grid;grid-template-columns:1fr 1fr}
  .folder-editor-toolbar>.action-group .ghost{width:100%}
  .folder-editor-back{justify-self:start}
  .folder-sort-toolbar{align-items:flex-start;flex-direction:column;gap:10px}
  .folder-sort-select-wrap,.folder-sort-select-wrap select{width:100%}
  .folder-edit-grid{gap:10px}
  .folder-edit-meta{padding:9px 10px 10px}
  .folder-edit-meta b{font-size:13px}
}
@media(max-width:430px){
  .folder-edit-grid{grid-template-columns:1fr}
}

.collection-category-row.selected .collection-section-check{
  background:#f5f5f7;
  border-color:#f5f5f7;
}
.collection-category-row.selected .collection-section-check::after{
  opacity:1;
  transform:rotate(-45deg) translateY(-1px) scale(1);
}
body.light .collection-category-row.selected .collection-section-check{
  background:#17181c;
  border-color:#17181c;
}
body.light .collection-category-row.selected .collection-section-check::after{
  border-color:#fff;
}


/* Existing setup — Smart Overlay Posters */
.existing-smart-overlay-editor{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:0 0 18px;
  padding:20px 22px;
  border:1px solid rgba(129,140,248,.22);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(99,102,241,.075),rgba(139,92,246,.035));
}
.existing-smart-overlay-copy-main{display:grid;gap:6px;min-width:0}
.existing-smart-overlay-copy-main h3{margin:0;font-size:18px;line-height:1.25}
.existing-smart-overlay-copy-main p{margin:0;max-width:680px;color:var(--muted);font-size:13px;line-height:1.5}
.existing-smart-overlay-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
/* Modal intentionally mirrors the Account edit-profile dialog. */
.smart-overlay-modal-root{position:fixed;inset:0;z-index:10000}
.smart-overlay-modal-backdrop{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(5,6,8,.48);
  backdrop-filter:blur(16px) saturate(.92);
  -webkit-backdrop-filter:blur(16px) saturate(.92);
}
.smart-overlay-modal{
  width:min(680px,100%);
  max-height:min(88vh,850px);
  overflow:auto;
  border:1px solid rgba(255,255,255,.13);
  border-radius:22px;
  background:rgba(22,22,24,.98);
  box-shadow:0 28px 90px rgba(0,0,0,.58);
  color:var(--text);
}
.smart-overlay-modal-head{
  min-height:78px;
  padding:20px 26px;
  border-bottom:1px solid var(--line-soft);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.smart-overlay-modal-head>div{display:grid;gap:4px}
.smart-overlay-modal-head h3{margin:0;font-size:22px;letter-spacing:-.025em}
.smart-overlay-modal-head p{margin:0;color:var(--muted);font-size:12.5px;line-height:1.45}
.smart-overlay-modal-x{
  width:42px;
  height:42px;
  padding:0;
  border:1px solid var(--line-soft);
  border-radius:50%;
  background:rgba(255,255,255,.025);
  color:var(--muted);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 42px;
}
.smart-overlay-modal-x::before{
  content:"×";
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:24px;
  font-weight:400;
  line-height:1;
  transform:translateY(-1px);
}
.smart-overlay-modal-x:hover{color:var(--text);background:rgba(255,255,255,.06)}
.smart-overlay-modal-body{padding:24px 26px}
.smart-overlay-modal-master{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:13px;
  padding:16px;
  border:1px solid var(--line-soft);
  border-radius:15px;
  background:rgba(255,255,255,.025);
  cursor:pointer;
}
.smart-overlay-modal-master input{width:20px;height:20px;margin:2px 0 0;accent-color:var(--accent)}
.smart-overlay-modal-master span{display:grid;gap:4px}
.smart-overlay-modal-master b{font-size:14px}
.smart-overlay-modal-master small{color:var(--muted);font-size:12px;line-height:1.45}
.smart-overlay-modal-controls{
  display:grid;
  gap:22px;
  margin-top:22px;
}
.smart-overlay-modal-controls[hidden],
.smart-overlay-modal-group[hidden]{display:none!important}
.smart-overlay-modal-group{display:grid;gap:11px}
.smart-overlay-modal-group-copy{display:grid;gap:3px}
.smart-overlay-modal-group-copy b{font-size:14px}
.smart-overlay-modal-group-copy span{color:var(--muted);font-size:12px;line-height:1.45}
.smart-overlay-modal-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.smart-overlay-modal-grid.trend-details{grid-template-columns:repeat(2,minmax(0,1fr))}
.smart-overlay-modal-choice{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:46px;
  padding:10px 11px;
  border:1px solid var(--line-soft);
  border-radius:12px;
  background:rgba(255,255,255,.022);
  cursor:pointer;
}
.smart-overlay-modal-choice:hover{border-color:rgba(129,140,248,.3);background:rgba(255,255,255,.04)}
.smart-overlay-modal-choice input{width:18px;height:18px;margin:0;accent-color:var(--accent);flex:0 0 18px}
.smart-overlay-modal-choice span{font-size:12px;font-weight:700;line-height:1.25}
.smart-overlay-modal-advanced{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding-top:4px;
}
.smart-overlay-modal-advanced>span{color:var(--muted);font-size:11.5px;line-height:1.45}
.smart-overlay-modal-status{min-height:18px;margin:14px 0 0;color:var(--muted);font-size:12px}
.smart-overlay-modal-footer{
  padding:18px 26px 24px;
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
}
.smart-overlay-modal-button{
  min-height:44px;
  padding:0 18px;
  border:1px solid var(--line-soft);
  border-radius:13px;
  background:rgba(255,255,255,.025);
  color:var(--text);
  font:inherit;
  font-weight:750;
  cursor:pointer;
}
.smart-overlay-modal-button.primary{
  background:#f4f4f6;
  color:#17171a;
  border-color:#f4f4f6;
}
html.smart-overlay-modal-open{overflow:hidden}

body.light .existing-smart-overlay-editor{
  border-color:rgba(79,70,229,.16);
  background:linear-gradient(135deg,rgba(99,102,241,.06),rgba(139,92,246,.028));
}
body.light .smart-overlay-modal{
  background:rgba(248,249,252,.98);
  border-color:rgba(0,0,0,.10);
  box-shadow:0 28px 90px rgba(24,30,45,.24);
}
body.light .smart-overlay-modal-backdrop{background:rgba(230,233,240,.45)}
body.light .smart-overlay-modal-master,
body.light .smart-overlay-modal-choice{background:rgba(255,255,255,.82)}
body.light .smart-overlay-modal-button.primary{background:#181a20;color:#fff;border-color:#181a20}

@media(max-width:760px){
  .existing-smart-overlay-editor{align-items:stretch}
  .existing-smart-overlay-actions{align-self:center}
  .smart-overlay-modal-backdrop{padding:12px}
  .smart-overlay-modal{border-radius:18px;max-height:90vh}
  .smart-overlay-modal-head{min-height:64px;padding:16px 18px}
  .smart-overlay-modal-head h3{font-size:19px}
  .smart-overlay-modal-body{padding:20px 18px}
  .smart-overlay-modal-footer{padding:14px 18px 18px}
  .smart-overlay-modal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .existing-smart-overlay-editor{flex-direction:column}
  .existing-smart-overlay-actions{width:100%;justify-content:space-between}
  .smart-overlay-modal-grid,
  .smart-overlay-modal-grid.trend-details{grid-template-columns:1fr}
  .smart-overlay-modal-advanced{align-items:stretch;flex-direction:column}
  .smart-overlay-modal-advanced .ghost{width:100%}
}


/* Folder card utility actions and Bingecat availability */
.folder-card-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-height:34px;
  padding:0 2px;
}
.folder-edit-card[disabled]{
  cursor:not-allowed;
}
.folder-edit-card-wrap.bingecat-unavailable .folder-edit-card{
  opacity:.42;
  filter:saturate(.45);
}
.folder-edit-card-wrap.bingecat-unavailable .folder-edit-card:hover{
  transform:none;
  border-color:rgba(255,255,255,.09);
}
body.light .folder-edit-card-wrap.bingecat-unavailable .folder-edit-card{
  opacity:.5;
}
