/* Janela da pasta (assistente) */
.modal-box.fm-box { width: min(640px, 100%); }
.fm-box .modal-head { padding: 12px 14px; }
.fm-box .modal-head h3 { flex: 1; min-width: 0; }
.fm-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fm-ico { color: var(--muted); display: grid; }
.fm-head input { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 15px; font-weight: 700; color: var(--fg); }
.fm-head input:hover, .fm-head input:focus { border-color: var(--line-2); background: var(--bg-2); outline: none; }
.fm-head small { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.fm-head .icon-btn { font-size: 13px; }
.fm-box .modal-body { padding: 0; display: grid; }

.fm-hero { position: relative; margin: 10px; border-radius: 12px; min-height: 170px; overflow: hidden; background: #111116 center / cover no-repeat; border: 1px solid var(--line); display: flex; align-items: flex-end; }
.fm-strip { position: absolute; top: 10px; right: -10px; bottom: 10px; display: flex; gap: 8px; transform: perspective(700px) rotateY(-12deg); transform-origin: right center; opacity: .9; }
.fm-strip img { height: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.fm-live { position: absolute; top: 10px; right: 12px; z-index: 2; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #fff; background: rgba(0,0,0,.55); border-radius: 6px; padding: 3px 7px; }
.fm-front { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 14px; width: 100%; background: linear-gradient(90deg, rgba(10,10,14,.9), rgba(10,10,14,.5) 60%, transparent); }
.fm-tile { flex: none; width: 168px; aspect-ratio: 16 / 9; border-radius: 10px; border: 2px solid rgba(255,255,255,.9); background: #1b1a22 center / cover no-repeat; display: grid; align-items: end; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.fm-tile.poster { width: 92px; aspect-ratio: 2 / 3; }
.fm-tile.square { width: 110px; aspect-ratio: 1; }
.fm-tile span { padding: 16px 8px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; text-align: center; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.fm-tile.txt { align-items: center; background: radial-gradient(120% 90% at 20% 0%, rgba(255,138,61,.35), transparent 60%), #1b1a22; }
.fm-tile.txt span { background: none; font-size: 13px; }
.fm-meta { display: grid; gap: 2px; min-width: 0; }
.fm-meta b { font-size: 15px; font-weight: 800; text-transform: uppercase; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); overflow-wrap: anywhere; }
.fm-meta small { color: rgba(255,255,255,.75); font-size: 12px; }

.fm-sec { margin: 0 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; }
.fm-capa { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fm-lbl, .fm-fl > span:first-child { font-size: 12.5px; color: var(--soft); font-weight: 600; }
.tip { font-style: normal; color: var(--muted); cursor: help; font-size: 11px; }
.fm-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.fm-radio input { accent-color: var(--accent); }
.fm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-f { display: grid; gap: 6px; min-width: 0; }
.fm-f.full { grid-column: 1 / -1; }
.fm-f.off { opacity: .45; pointer-events: none; }
.fm-fl { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.fm-tags { display: flex; align-items: center; gap: 8px; }
.fm-badge, .fm-tv { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--soft); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; }
.fm-badge { color: var(--accent); border-color: rgba(255,138,61,.45); }
.fm-tags .link { font-size: 12px; white-space: nowrap; }
.fm-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.fm-in input { min-width: 0; font-family: var(--mono); font-size: 12px; }
.fm-reset { width: 36px; }
.switch.mini span:empty { margin: 0; }

.fm-src { margin: 12px 10px 0; display: grid; gap: 8px; }
.fm-src-head { display: flex; justify-content: space-between; align-items: center; }
.fm-src-head b { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.fm-src-head .link { font-size: 12px; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 8px; padding: 5px 6px 5px 6px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.fm-chip small { color: var(--muted); font-weight: 500; }
.fm-chip .grip { color: #55546a; cursor: grab; font-size: 11px; }
.fm-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 2px; }
.fm-chip button:hover { color: var(--fg); }
.fm-chip.add { cursor: pointer; color: var(--soft); padding: 5px 10px; }
.fm-chip.add:hover { border-color: var(--accent); color: var(--fg); }
.fm-add { display: grid; gap: 6px; }
.fm-res { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.fm-res button { border: 1px dashed var(--line-2); background: none; color: var(--soft); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; }
.fm-res button:hover { border-color: var(--accent); color: var(--fg); }
.fm-res small { color: var(--muted); }

.fm-gal { margin: 12px 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; }
.fm-gal-head { display: flex; justify-content: space-between; align-items: center; }
.fm-gal .hint { margin: 0; }
.fm-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: max-content; gap: 8px; max-height: 340px; overflow: auto; }
.fm-gal-grid.poster { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.fm-gal-grid button { border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; display: grid; text-align: left; color: var(--soft); }
.fm-gal-grid button:hover { border-color: var(--accent); }
.fm-gal-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #1b1a22; }
.fm-gal-grid.poster img { aspect-ratio: 2 / 3; }
.fm-gal-grid small { padding: 4px 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fm-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 12px 10px; margin-top: 12px; border-top: 1px solid var(--line); background: var(--panel); }
@media (max-width: 560px) {
  .fm-grid { grid-template-columns: minmax(0, 1fr); }
  .fm-tile { width: 128px; }
  .fm-strip { opacity: .35; }
}

/* arrastar as pastas na coleção */
.cx-tile[data-i] { cursor: grab; }
.cx-tile.sortable-ghost { opacity: .35; }
.cx-tile.sortable-chosen .cx-art { border-color: var(--accent); }
.sortable-fallback { opacity: .9 !important; transform: rotate(2deg); }
