.pm-page .qg-app { grid-template-columns: minmax(0, 1fr) 320px; }
.pm-work { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 20px 22px 22px; }

.pm-drop { position: relative; display: grid; place-items: center; min-height: 360px; padding: 24px; border: 2px dashed var(--cc-line); border-radius: 18px; background: var(--cc-soft); cursor: pointer; outline: 0; transition: border-color .2s, background .2s; }
.pm-drop:hover, .pm-drop:focus-visible, .pm-drop.is-over { border-color: var(--cc-teal); background: var(--cc-teal-soft); }
.pm-drop-in { display: grid; justify-items: center; gap: 8px; text-align: center; }
.pm-drop-in b { font-size: 1.05rem; color: var(--cc-ink); }
.pm-drop-in > span:not(.pm-drop-ico):not(.pm-pick) { max-width: 340px; font-size: .8rem; line-height: 1.55; color: var(--cc-ink-3); }
.pm-drop-ico { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; border-radius: 18px; background: var(--cc-teal-soft); color: var(--cc-teal); font-size: 24px; }
html:not(.cf-light) .pm-drop-ico { color: var(--cc-bright); }
.pm-pick { width: auto; margin-top: 8px; padding: 0 24px; }
.pm-drop-in .pm-types { margin-top: 2px; font-size: .72rem !important; }
.pm-hint-mob { display: none; }
.pm-app:not(.is-empty) .pm-drop { display: none; }
.pm-page.is-dragging .pm-app:not(.is-empty) .pm-work { outline: 2px dashed var(--cc-teal); outline-offset: -8px; border-radius: 18px; }

.pm-queue { display: grid; gap: 12px; min-width: 0; }
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.pm-head-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pm-head-t b { font-size: .95rem; color: var(--cc-ink); }
.pm-head-t small { font-size: .74rem; color: var(--cc-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-count { min-width: 24px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--cc-teal); color: #fff; font-size: .7rem; font-weight: 800; }
.pm-head-a { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pm-hbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--cc-ink-2); font: 600 .8rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.pm-hbtn i { font-size: 13px; }
.pm-hbtn:hover { background: var(--cc-teal-soft); color: var(--cc-teal); }
html:not(.cf-light) .pm-hbtn:hover { color: var(--cc-bright); }
.pm-danger:hover { background: rgba(239, 68, 68, .1); color: #EF4444; }
html:not(.cf-light) .pm-danger:hover { color: #F87171; }
.pm-danger.is-armed { background: #EF4444; color: #fff; }
html:not(.cf-light) .pm-danger.is-armed { color: #fff; }

.pm-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pm-item { position: relative; display: grid; grid-template-columns: 22px 54px minmax(0, 1fr) auto auto; grid-template-areas: 'grip thumb name acts del' 'grip thumb sub acts del' 'grip thumb range acts del'; align-items: center; align-content: center; gap: 4px 12px; padding: 10px 10px 10px 8px; border: 1px solid var(--cc-line); border-radius: 14px; background: var(--cc-card); transition: border-color .2s, background .2s; }
.pm-item:hover { border-color: rgba(6, 147, 139, .35); }
.pm-item { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pm-item input { -webkit-user-select: text; user-select: text; cursor: text; }
.pm-item button { cursor: pointer; }
.pm-drag { opacity: .95; border-color: var(--cc-teal); background: var(--cc-card); transform: scale(1.02); }
.pm-item.is-err { border-color: rgba(239, 68, 68, .45); }
.pm-grip { grid-area: grip; display: flex; align-items: center; justify-content: center; height: 100%; color: var(--cc-ink-3); cursor: grab; touch-action: none; }
.pm-grip:active { cursor: grabbing; }
.pm-thumb { grid-area: thumb; position: relative; width: 54px; height: 70px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 8px; background: var(--cc-soft); }
.pm-thumb img { max-width: 100%; max-height: 100%; display: block; background: #fff; transition: transform .25s ease; }
.pm-thumb > i { font-size: 20px; color: var(--cc-ink-3); }
.pm-thumb.is-pdf > i { color: #EF4444; }
.pm-n { position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--cc-teal); color: #fff; font-size: .62rem; font-weight: 800; }
.pm-fname { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 600; color: var(--cc-ink); }
.pm-sub { grid-area: sub; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .72rem; color: var(--cc-ink-3); }
.pm-sub .pm-tag { padding: 1px 7px; border-radius: 6px; background: var(--cc-soft); font-size: .64rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--cc-ink-2); }
.pm-sub .pm-rot { color: var(--cc-teal); font-weight: 600; }
html:not(.cf-light) .pm-sub .pm-rot { color: var(--cc-bright); }
.pm-sub .pm-err { color: #EF4444; font-weight: 600; }
.pm-sub .pm-warn { color: #D97706; font-weight: 600; }
.pm-range { grid-area: range; display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; }
.pm-range input { width: 100%; max-width: 220px; height: 32px; padding: 0 10px; border: 1px solid var(--cc-line); border-radius: 9px; outline: 0; background: var(--cc-soft); color: var(--cc-ink); font: 500 .8rem 'Poppins', sans-serif; transition: border-color .2s, box-shadow .2s; }
.pm-range input::placeholder { color: var(--cc-ink-3); opacity: .8; font-size: .74rem; font-weight: 400; }
.pm-pass-in { position: relative; display: block; flex: 1 1 auto; min-width: 0; max-width: 240px; }
.pm-pass-in input { max-width: none; padding-right: 38px; }
.pm-eye { position: absolute; top: 50%; right: 3px; width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--cc-ink-3); font-size: 13px; cursor: pointer; transform: translateY(-50%); transition: color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.pm-eye:hover, .pm-eye[aria-pressed="true"] { color: var(--cc-teal); }
html:not(.cf-light) .pm-eye:hover, html:not(.cf-light) .pm-eye[aria-pressed="true"] { color: var(--cc-bright); }
.pm-unlock { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--cc-teal); color: #fff; font: 600 .76rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s, opacity .2s; }
.pm-unlock:hover { background: var(--cc-teal-h); }
.pm-unlock:disabled { opacity: .6; pointer-events: none; }
.pm-unlock i { font-size: 11px; }
.pm-range input:focus { border-color: var(--cc-teal); box-shadow: 0 0 0 3px rgba(6, 147, 139, .15); }
.pm-range input.is-bad { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.pm-range small { flex-shrink: 0; font-size: .7rem; font-weight: 600; color: var(--cc-ink-3); white-space: nowrap; }
.pm-range small.is-bad { color: #EF4444; }
.pm-acts { grid-area: acts; display: flex; align-items: center; gap: 2px; }
.pm-del { grid-area: del; }
.pm-ib { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; color: var(--cc-ink-3); font-size: 13px; cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.pm-ib:hover { background: var(--cc-teal-soft); color: var(--cc-teal); }
html:not(.cf-light) .pm-ib:hover { color: var(--cc-bright); }
.pm-ib:disabled { opacity: .3; pointer-events: none; }
.pm-ib.pm-del:hover { background: rgba(239, 68, 68, .1); color: #EF4444; }
.pm-ghost { opacity: .35; }
.pm-chosen { border-color: var(--cc-teal); background: var(--cc-teal-soft); }

.pm-more { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 2px dashed var(--cc-line); border-radius: 14px; background: transparent; color: var(--cc-ink-2); font: 600 .82rem 'Poppins', sans-serif; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.pm-more:hover { border-color: var(--cc-teal); color: var(--cc-teal); background: var(--cc-teal-soft); }
html:not(.cf-light) .pm-more:hover { color: var(--cc-bright); }

.pm-opts { display: grid; gap: 16px; min-width: 0; }
.pm-opt { display: grid; gap: 7px; min-width: 0; }
.pm-opt-k { font-size: .76rem; font-weight: 600; color: var(--cc-ink-2); }
.pm-opt-k small, .pm-tog small { font-weight: 400; color: var(--cc-ink-3); }
.pm-seg button { flex: 1 1 0; }
.pm-tog { align-items: flex-start; line-height: 1.4; }
.pm-tog > span:last-child { display: grid; gap: 1px; }
.pm-tog .qg-switch { flex-shrink: 0; margin-top: 1px; }
.pm-name-in { position: relative; display: block; }
.pm-page .pm-name-in input { height: 42px; padding: 0 46px 0 12px; border-radius: 11px; font-size: .84rem; font-weight: 500; }
.pm-name-in i { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); font-style: normal; font-size: .74rem; font-weight: 600; color: var(--cc-ink-3); pointer-events: none; }

.pm-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--cc-line); border-radius: 14px; background: var(--cc-card); }
.pm-sum div { display: grid; gap: 2px; padding: 10px 12px; min-width: 0; }
.pm-sum div + div { border-left: 1px solid var(--cc-line); }
.pm-sum span { font-size: .68rem; font-weight: 600; color: var(--cc-ink-3); }
.pm-sum b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; font-weight: 700; color: var(--cc-ink); }

.pm-done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(6, 147, 139, .35); border-radius: 14px; background: var(--cc-teal-soft); }
.pm-done-ico { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--cc-teal); color: #fff; font-size: 13px; }
.pm-done div { display: grid; gap: 1px; min-width: 0; }
.pm-done b { font-size: .86rem; color: var(--cc-ink); }
.pm-done span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; color: var(--cc-ink-2); }

.pm-dl .qg-btn-main:disabled { opacity: .5; cursor: not-allowed; }
.pm-dl-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }

.pm-busy { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pm-busy[hidden] { display: none; }
.pm-busy-card { width: 100%; max-width: 320px; display: grid; justify-items: center; gap: 6px; padding: 26px 22px 22px; border: 1px solid var(--cc-line); border-radius: 20px; background: var(--cc-card); text-align: center; }
.pm-busy-card b { margin-top: 6px; font-size: 1rem; color: var(--cc-ink); }
.pm-busy-card > span:not(.pm-spin):not(.pm-bar) { font-size: .78rem; color: var(--cc-ink-3); }
.pm-spin { width: 40px; height: 40px; border: 3px solid var(--cc-teal-soft); border-top-color: var(--cc-teal); border-radius: 50%; animation: pmSpin .8s linear infinite; }
@keyframes pmSpin { to { transform: rotate(360deg); } }
.pm-bar { width: 100%; height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--cc-soft); }
.pm-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--cc-teal); transition: width .2s ease; }

.pm-pv { position: fixed; inset: 0; z-index: 1250; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(8, 10, 14, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pm-pv[hidden] { display: none; }
.pm-pv-shell { width: min(960px, 100%); height: min(88vh, 860px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 22px; background: var(--cc-card); }
.pm-pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--cc-line); }
.pm-pv-tbox { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pm-pv-tbox b { font-size: .95rem; color: var(--cc-ink); }
.pm-pv-tbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; color: var(--cc-ink-3); }
.pm-pv-dl { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--cc-teal); color: #fff; font: 600 .8rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s; }
.pm-pv-dl:hover { background: var(--cc-teal-h); }
.pm-pv-x { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--cc-line); border-radius: 10px; background: var(--cc-soft); color: var(--cc-ink-2); cursor: pointer; transition: background .2s, color .2s; }
.pm-pv-x:hover { background: rgba(239, 68, 68, .1); color: #EF4444; }
.pm-pv-body { flex: 1; min-height: 0; display: flex; }
.pm-pv-side { width: 124px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow-x: hidden; overflow-y: auto; border-right: 1px solid var(--cc-line); scrollbar-width: thin; }
.pm-pv-th { flex-shrink: 0; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: 600 .66rem 'Poppins', sans-serif; color: var(--cc-ink-3); }
.pm-pv-th span:first-child { width: 100%; aspect-ratio: 1 / 1.414; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px solid var(--cc-line); border-radius: 6px; background: var(--cc-soft); transition: border-color .2s; }
.pm-pv-th img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.pm-pv-th.is-on span:first-child { border-color: var(--cc-teal); }
.pm-pv-th.is-on { color: var(--cc-teal); }
html:not(.cf-light) .pm-pv-th.is-on { color: var(--cc-bright); }
.pm-pv-stage { position: relative; touch-action: none; overscroll-behavior: contain; flex: 1; min-width: 0; min-height: 0; background: var(--cc-soft); }
.pm-pv-box { position: absolute; inset: 24px 24px 74px; display: flex; align-items: center; justify-content: center; }
.pm-pv-box canvas { display: block; background: #fff; border-radius: 3px; box-shadow: 0 10px 34px rgba(15, 23, 42, .16); }
.pm-pv-load { position: absolute; top: 50%; left: 50%; margin: -20px 0 0 -20px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.pm-pv-load.is-on { opacity: 1; }
.pm-pv-nav { position: absolute; left: 50%; bottom: 20px; display: flex; align-items: center; gap: 4px; padding: 4px; transform: translateX(-50%); border: 1px solid var(--cc-line); border-radius: 999px; background: var(--cc-card); }
.pm-pv-nav button { width: 32px; height: 32px; font-size: 12px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--cc-teal-soft); color: var(--cc-teal); cursor: pointer; transition: background .2s, color .2s; }
html:not(.cf-light) .pm-pv-nav button { color: var(--cc-bright); }
.pm-pv-nav button:hover { background: var(--cc-teal); color: #fff; }
.pm-pv-nav button:disabled { opacity: .35; pointer-events: none; }
.pm-pv-nav span { min-width: 54px; text-align: center; font-size: .74rem; font-weight: 700; color: var(--cc-ink); }
body.pm-lock { overflow: hidden; }
.po-page .qg-toast-text.pm-tt { display: flex; min-width: 0; overflow: hidden; }
.po-page .pm-tt-pre, .po-page .pm-tt-ext { flex-shrink: 0; white-space: pre; }
.po-page .pm-tt-stem { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    .po-page .pm-tt-pre { display: none; }
}

@media (max-width: 960px) {
    .pm-page .qg-app { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (max-width: 760px) {
    .pm-page .qg-app { grid-template-columns: 1fr; }
    .pm-work { order: 1; padding: 16px; }
    .pm-opts { order: 2; padding: 16px; border-top: 1px solid var(--cc-line); background: var(--cc-soft); }
    .pm-app.is-empty .pm-opts, .pm-app.is-empty .pm-sum, .pm-app.is-empty .pm-dl { display: none; }
    .pm-dl { grid-template-columns: minmax(0, 1fr) auto; }
    .pm-dl .qg-btn-main { width: 100%; }
    .pm-dl-row { display: flex; gap: 6px; }
    .pm-dl-row[hidden] { display: none; }
    .pm-dl-row .qg-btn-ghost { height: 46px; min-width: 52px; padding: 0 12px; }
    .pm-dl-row .qg-btn-ghost span { display: none; }
    .pm-hint-desk { display: none; }
    .pm-hint-mob { display: inline; }
    .pm-drop { min-height: 230px; padding: 20px 16px; border-radius: 16px; }
    .pm-drop-ico { width: 52px; height: 52px; border-radius: 16px; font-size: 21px; }
    .pm-drop-in b { font-size: .98rem; }
    .pm-pick { height: 44px; margin-top: 6px; }
    .pm-range input, .pm-page .pm-name-in input { font-size: 16px; }
    .pm-page .pm-name-in input { height: 44px; }
    .pm-range input::placeholder { font-size: .8rem; }
    .pm-pv { padding: 0; }
    .pm-pv-shell { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
    .pm-pv-body { flex-direction: column-reverse; }
    .pm-pv-side { width: auto; height: auto; flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px 8px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--cc-line); scrollbar-width: none; }
    .pm-pv-side::-webkit-scrollbar { display: none; }
    .pm-pv-th { width: 44px; gap: 6px; line-height: 1; }
    .pm-pv-box { inset: 14px 14px 62px; }
    .pm-pv-nav { bottom: 12px; }
    .pm-pv-nav button { width: 30px; height: 30px; }
    .pm-pv-nav span { min-width: 48px; font-size: .72rem; }
    .pm-pv-dl span { display: none; }
    .pm-pv-dl { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 600px) {
    .pm-head-t small { display: none; }
    .pm-hbtn { padding: 0 9px; }
    .pm-head-a .pm-hbtn:not(#pmAdd) span { display: none; }
    .pm-list { gap: 10px; }
    .pm-item { grid-template-columns: 50px minmax(0, 1fr) auto; grid-template-areas: 'thumb name del' 'thumb sub sub' 'thumb range acts'; gap: 4px 10px; padding: 10px; border-radius: 14px; }
    .pm-grip { display: none; }
    .pm-thumb { width: 50px; height: 66px; align-self: start; }
    .pm-fname { align-self: center; font-size: .82rem; }
    .pm-del { justify-self: end; width: 30px; height: 30px; margin: -4px -4px -4px 0; }
    .pm-sub { gap: 2px 8px; font-size: .7rem; }
    .pm-range { margin-top: 4px; }
    .pm-range input { max-width: none; height: 36px; }
    .pm-range small { font-size: .66rem; }
    .pm-pass-in { max-width: none; }
    .pm-eye { width: 34px; height: 32px; }
    .pm-unlock { height: 36px; }
    .pm-acts { justify-self: end; align-self: end; gap: 0; margin-right: -4px; }
    .pm-acts .pm-ib { width: 32px; height: 36px; }
    .pm-item.is-err { grid-template-areas: 'thumb name del' 'thumb sub sub' 'thumb range range'; }
    .pm-item.is-err .pm-acts { display: none; }
    .pm-sum b { font-size: .9rem; }
}