/* Netfold · карточки фото/видео на ноде и окно правки (assets/ui/nf-media.js) */
.nfm-row{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 0;max-width:100%}
.nfm-card,.nfm-chip{font:inherit;font-size:11px;line-height:1.2;color:inherit;cursor:pointer;border:1px solid rgba(0,0,0,.14);background:rgba(255,255,255,.78);box-shadow:0 1px 3px rgba(0,0,0,.14);transition:transform .12s,box-shadow .12s,background-color .12s}
.nfm-card{display:flex;align-items:center;gap:6px;max-width:100%;padding:3px 8px 3px 3px;border-radius:10px;text-align:left}
.nfm-chip{display:inline-flex;align-items:center;max-width:100%;padding:4px 10px;border-radius:999px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nfm-card:hover,.nfm-chip:hover{transform:translateY(-1px);box-shadow:0 3px 8px rgba(0,0,0,.2);background:#fff}
.nfm-card:focus-visible,.nfm-chip:focus-visible{outline:2px solid var(--nf-accent,#3b6cf6);outline-offset:2px}
.nfm-th{position:relative;flex:none;width:36px;height:36px;border-radius:7px;overflow:hidden;background:#dde3ea;display:grid;place-items:center}
.nfm-th img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.nfm-ph{font-size:16px}
.nfm-th img ~ .nfm-ph{display:none}
.nfm-play{position:absolute;inset:0;z-index:1;display:grid;place-items:center;color:#fff;font-size:13px;text-shadow:0 1px 3px rgba(0,0,0,.7);background:rgba(0,0,0,.2)}
.nfm-lb{min-width:0;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nfm-pen{opacity:0;font-size:11px;transition:opacity .12s}
.nfm-card:hover .nfm-pen,.nfm-card:focus-visible .nfm-pen{opacity:.7}
.nfm-more{font-weight:600}
body.dark .nfm-card,body.dark .nfm-chip,body.theme-midnight .nfm-card,body.theme-midnight .nfm-chip{background:rgba(32,40,49,.85);border-color:rgba(255,255,255,.2);color:#edf2f5}

body.nfm-open{overflow:hidden}
.nfm-modal{position:fixed;inset:0;z-index:12500;display:flex;align-items:center;justify-content:center;padding:20px}
.nfm-back{position:absolute;inset:0;background:rgba(20,24,30,.62);backdrop-filter:blur(4px)}
.nfm-dlg{position:relative;display:flex;flex-direction:column;width:min(1080px,96vw);height:min(760px,92vh);background:#fff;color:#1d1d1f;border-radius:16px;box-shadow:0 18px 60px rgba(0,0,0,.35);overflow:hidden}
.nfm-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid rgba(0,0,0,.1)}
.nfm-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.nfm-x{flex:none;width:34px;height:34px;border:0;border-radius:50%;background:rgba(0,0,0,.06);font-size:22px;line-height:1;cursor:pointer;color:inherit}
.nfm-x:hover{background:rgba(0,0,0,.12)}
.nfm-main{flex:1;min-height:0;display:flex}
.nfm-stage{position:relative;flex:1;min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#eef1f4;padding:12px;overflow:hidden}
.nfm-imgwrap{position:relative;user-select:none;touch-action:none;box-shadow:0 2px 12px rgba(0,0,0,.25);background:#fff}
.nfm-cv{display:block;width:100%;height:100%}
.nfm-crop{position:absolute;border:2px solid #fff;box-shadow:0 0 0 9999px rgba(0,0,0,.5),0 0 0 1px rgba(0,0,0,.5) inset;cursor:move;touch-action:none;outline:1px solid rgba(0,0,0,.4)}
.nfm-h{position:absolute;width:20px;height:20px;background:#fff;border:2px solid #3b6cf6;border-radius:50%;touch-action:none}
.nfm-h-nw{left:-11px;top:-11px;cursor:nwse-resize}.nfm-h-ne{right:-11px;top:-11px;cursor:nesw-resize}
.nfm-h-sw{left:-11px;bottom:-11px;cursor:nesw-resize}.nfm-h-se{right:-11px;bottom:-11px;cursor:nwse-resize}
.nfm-tip{font-size:11px;color:#6b7480}
.nfm-video{max-width:100%;max-height:100%;border-radius:8px;background:#000}
.nfm-msg{padding:20px;color:#6b7480;font-size:13px}
.nfm-side{flex:none;width:300px;display:flex;flex-direction:column;gap:10px;padding:12px 14px;overflow:auto;border-left:1px solid rgba(0,0,0,.1)}
.nfm-sec{display:flex;flex-direction:column;gap:8px}
.nfm-sec h3{margin:0;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#6b7480}
.nfm-in{width:100%;box-sizing:border-box;padding:7px 9px;border:1px solid rgba(0,0,0,.18);border-radius:8px;font:inherit;font-size:13px;background:#fff;color:inherit}
.nfm-fld{display:flex;flex-direction:column;gap:2px;font-size:12px}
.nfm-fl{display:flex;justify-content:space-between}
.nfm-fld input[type=range]{width:100%}
.nfm-btns{display:flex;flex-wrap:wrap;gap:6px}
.nfm-btn{padding:7px 11px;border:1px solid rgba(0,0,0,.18);border-radius:8px;background:#f5f6f8;font:inherit;font-size:12px;cursor:pointer;color:inherit}
.nfm-btn:hover{background:#e9ecf0}
.nfm-primary{background:#3b6cf6;border-color:#3b6cf6;color:#fff}.nfm-primary:hover{background:#2f5ae0}
.nfm-chk{display:flex;align-items:center;gap:8px;font-size:13px}
.nfm-note{margin:0;font-size:11px;color:#6b7480;line-height:1.4}
.nfm-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:auto;padding-top:10px;border-top:1px solid rgba(0,0,0,.1)}
.nfm-sp{flex:1}
.nfm-link{background:none;border:0;padding:2px 0;font:inherit;font-size:12px;color:#3b6cf6;cursor:pointer;text-decoration:underline}
.nfm-danger{color:#c0392b}
@media (max-width:760px){
  .nfm-modal{padding:0}
  .nfm-dlg{width:100vw;height:100%;border-radius:0;padding-top:env(safe-area-inset-top)}
  .nfm-main{flex-direction:column}
  .nfm-stage{flex:none;height:42vh}
  .nfm-side{width:auto;flex:1;border-left:0;border-top:1px solid rgba(0,0,0,.1)}
}
body.dark .nfm-dlg,body.theme-midnight .nfm-dlg{background:#202831;color:#edf2f5}
body.dark .nfm-stage,body.theme-midnight .nfm-stage{background:#151b21}
body.dark .nfm-head,body.dark .nfm-side,body.dark .nfm-foot,body.theme-midnight .nfm-head,body.theme-midnight .nfm-side,body.theme-midnight .nfm-foot{border-color:rgba(255,255,255,.14)}
body.dark .nfm-in,body.theme-midnight .nfm-in{background:#2a343e;color:#edf2f5;border-color:rgba(255,255,255,.2)}
body.dark .nfm-btn,body.theme-midnight .nfm-btn{background:#2a343e;border-color:rgba(255,255,255,.2)}
body.dark .nfm-x,body.theme-midnight .nfm-x{background:rgba(255,255,255,.1)}
@media (prefers-reduced-motion:reduce){.nfm-card,.nfm-chip{transition:none}}

.nfm-multi .nfm-lb{max-width:62px}
.nfm-multi .nfm-pen{display:none}
.nfm-compact .nfm-lb{display:none}
.nfm-compact .nfm-card{padding:3px}
