.ps-doc { display: grid; gap: 14px; min-width: 0; }
.ps-doc[hidden] { display: none; }

.ps-file { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--cc-line); border-radius: 14px; background: var(--cc-card); }
.ps-file-th { grid-area: auto; }
.ps-file-meta { display: grid; gap: 4px; min-width: 0; }
.ps-file-meta .pm-fname, .ps-file-meta .pm-sub { grid-area: auto; }
.ps-file-meta .pm-fname { font-size: .9rem; }
.ps-file-a { display: flex; align-items: center; gap: 2px; }
.ps-pass { grid-area: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 14px; border: 1px solid rgba(239, 68, 68, .25); border-radius: 14px; background: rgba(239, 68, 68, .05); }
.ps-pass[hidden] { display: none; }
.ps-pass::before { content: 'This PDF is locked. Enter its password to open it.'; flex: 1 1 100%; font-size: .76rem; font-weight: 600; line-height: 1.45; color: var(--cc-ink-2); }
.ps-pass .pm-pass-in { flex: 1 1 0; min-width: 0; max-width: none; }
.ps-pass .pm-pass-in input { width: 100%; max-width: none; height: 42px; padding: 0 44px 0 12px; border-radius: 11px; background: var(--cc-card); font-size: .84rem; }
.ps-pass .pm-pass-in input::placeholder { font-size: .8rem; }
.ps-pass .pm-eye { right: 6px; width: 32px; height: 32px; border-radius: 8px; }
.ps-pass .pm-unlock { height: 42px; padding: 0 18px; border-radius: 11px; font-size: .82rem; }

.ps-res { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(6, 147, 139, .35); border-radius: 14px; background: var(--cc-teal-soft); }
.ps-res[hidden] { display: none; }
.ps-res-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ps-res-head div { display: grid; gap: 1px; min-width: 0; }
.ps-res-head b { font-size: .88rem; color: var(--cc-ink); }
.ps-res-head span:not(.pm-done-ico) { font-size: .72rem; color: var(--cc-ink-2); }
.ps-res-list { display: grid; gap: 6px; max-height: 300px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.ps-res-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 7px 7px 10px; border: 1px solid var(--cc-line); border-radius: 11px; background: var(--cc-card); }
.ps-res-ico { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(239, 68, 68, .1); color: #EF4444; font-size: 13px; }
.ps-res-meta { display: grid; gap: 1px; min-width: 0; }
.ps-res-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 600; color: var(--cc-ink); }
.ps-res-meta span { font-size: .68rem; color: var(--cc-ink-3); }
.ps-res-a { display: flex; gap: 2px; }

.ps-gridbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ps-quick { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--cc-line); border-radius: 11px; background: var(--cc-soft); }
.ps-bar-r { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.ps-q-sel { display: flex; gap: 2px; }
.ps-q-sel[hidden] { display: none !important; }
.ps-q-sel:not([hidden]) + .ps-q-del { margin-left: 3px; position: relative; }
.ps-q-sel:not([hidden]) + .ps-q-del::before { content: ''; position: absolute; left: -4px; top: 6px; bottom: 6px; width: 1px; background: var(--cc-line); }
.ps-quick .ps-q-del { width: 34px; padding: 0; font-size: 12px; }
.ps-quick .ps-q-del:hover { color: #EF4444; }
.ps-quick .ps-q-del.is-on { background: #EF4444; color: #fff; }
.ps-pa-del { display: none !important; }
.ps-app.is-del .ps-pa-del { display: flex !important; }
.ps-pg-acts { justify-content: flex-end; }
.ps-app.is-del .ps-pg-acts { justify-content: space-between; }
.ps-quick button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--cc-ink-2); font: 600 .74rem 'Poppins', sans-serif; cursor: pointer; transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.ps-quick button:hover { background: var(--cc-card); color: var(--cc-teal); }
html:not(.cf-light) .ps-quick button:hover { color: var(--cc-bright); }

.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 12px; min-width: 0; }
.ps-pg { position: relative; display: grid; gap: 6px; padding: 0; border: 0; background: none; font: 600 .72rem 'Poppins', sans-serif; color: var(--cc-ink-3); text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ps-pg-box { position: relative; aspect-ratio: 1 / 1.3; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px solid var(--cc-line); border-radius: 10px; background: var(--cc-soft); transition: border-color .2s, opacity .2s, transform .2s; }
.ps-pg-box img { max-width: calc(100% - 12px); max-height: calc(100% - 12px); display: block; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.ps-pg-box .pm-spin { width: 20px; height: 20px; border-width: 2px; }
.ps-pg:hover .ps-pg-box { border-color: rgba(6, 147, 139, .45); }
.ps-pg-chk { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--cc-line); border-radius: 7px; background: var(--cc-card); color: transparent; font-size: 11px; transition: background .2s, border-color .2s, color .2s; }
.ps-pg-g { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; display: none; align-items: center; justify-content: center; border-radius: 7px; background: var(--cc-teal); color: #fff; font-size: .66rem; font-weight: 800; }
.ps-pg-n { line-height: 1; }
.ps-pg:focus-visible { outline: 0; }
.ps-pg:focus-visible .ps-pg-box { box-shadow: 0 0 0 3px rgba(6, 147, 139, .25); }
.ps-pg-acts { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; pointer-events: none; }
.ps-pg:hover .ps-pg-acts, .ps-pg:focus-within .ps-pg-acts { opacity: 1; transform: none; pointer-events: auto; }
.ps-pa { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 9px; color: #fff; font-size: 12px; cursor: pointer; transition: background .2s, transform .15s; -webkit-tap-highlight-color: transparent; }
.ps-pa:active { transform: scale(.92); }
.ps-pa-del { background: #EF4444; }
.ps-pa-del:hover { background: #DC2626; }
.ps-pa-pv { background: var(--cc-teal); }
.ps-pa-pv:hover { background: var(--cc-teal-h); }
.ps-chosen .ps-pg-acts, .pm-ghost .ps-pg-acts { opacity: 0; }
@media (hover: none) {
    .ps-pg-acts { opacity: 1; transform: none; pointer-events: auto; left: 5px; right: 5px; bottom: 5px; }
    .ps-pa { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
}
.ps-pg-n small { font-size: .62rem; font-weight: 500; color: var(--cc-ink-3); }
.ps-pg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ps-app[data-mode="range"] .ps-pg, .ps-app[data-mode="every"] .ps-pg { cursor: grab; }
.ps-chosen .ps-pg-box { border-color: var(--cc-teal); }
.ps-reset { height: 32px; }
.ps-reset:hover { background: rgba(239, 68, 68, .1); color: #EF4444; }
html:not(.cf-light) .ps-reset:hover { background: rgba(239, 68, 68, .14); color: #F87171; }
.ps-hint { font-size: .7rem; color: var(--cc-ink-3); }
.ps-hint:empty { display: none; }
.ps-page .pm-dl-row { display: flex; gap: 6px; }
.ps-page #psPreview { flex: 1.7 1 0; }
.ps-page #psRedo { flex: 1 1 0; }
.ps-page #psShareFile { flex: 0 0 44px; padding: 0; }
.ps-page #psShareFile span { display: none; }
.ps-pg.is-on .ps-pg-box { border-color: var(--cc-teal); }
.ps-pg.is-on .ps-pg-chk { border-color: var(--cc-teal); background: var(--cc-teal); color: #fff; }
.ps-pg.is-on .ps-pg-n { color: var(--cc-teal); }
html:not(.cf-light) .ps-pg.is-on .ps-pg-n { color: var(--cc-bright); }
.ps-pg.is-out .ps-pg-box { opacity: .4; }
.ps-app[data-mode="range"] .ps-pg-chk, .ps-app[data-mode="every"] .ps-pg-chk { display: none; }
.ps-app[data-mode="range"] .ps-pg:not(.is-out) .ps-pg-g, .ps-app[data-mode="every"] .ps-pg:not(.is-out) .ps-pg-g { display: flex; }
.ps-pg[data-alt="1"] .ps-pg-g { background: #0F172A; }
html:not(.cf-light) .ps-pg[data-alt="1"] .ps-pg-g { background: #475569; }
.ps-app[data-mode="range"] .ps-pg:not(.is-out) .ps-pg-box, .ps-app[data-mode="every"] .ps-pg:not(.is-out) .ps-pg-box { border-color: rgba(6, 147, 139, .55); }
.ps-app[data-mode="range"] .ps-pg[data-alt="1"]:not(.is-out) .ps-pg-box, .ps-app[data-mode="every"] .ps-pg[data-alt="1"]:not(.is-out) .ps-pg-box { border-color: rgba(15, 23, 42, .45); }
html:not(.cf-light) .ps-app[data-mode="range"] .ps-pg[data-alt="1"]:not(.is-out) .ps-pg-box, html:not(.cf-light) .ps-app[data-mode="every"] .ps-pg[data-alt="1"]:not(.is-out) .ps-pg-box { border-color: rgba(148, 163, 184, .55); }

.ps-modes button { padding: 0 6px; font-size: .76rem; }
.ps-panel { display: grid; gap: 14px; min-width: 0; }
.ps-panel[hidden] { display: none; }
.ps-in input { height: 42px; padding: 0 12px; border-radius: 11px; font-size: .84rem; }
.ps-in input::placeholder { font-size: .8rem; }
.ps-in input.is-bad { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.ps-err { font-size: .7rem !important; line-height: 1.45; color: #EF4444 !important; }
.ps-err[hidden] { display: none; }
.ps-step { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; height: 42px; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 11px; background: var(--cc-soft); }
.ps-step button { border: 0; background: transparent; color: var(--cc-ink-2); font-size: 12px; cursor: pointer; transition: background .2s, color .2s; }
.ps-step button:hover { background: var(--cc-teal-soft); color: var(--cc-teal); }
.ps-step input { width: 100%; min-width: 0; border: 0; border-left: 1px solid var(--cc-line); border-right: 1px solid var(--cc-line); outline: 0; background: var(--cc-card); color: var(--cc-ink); font: 700 .9rem 'Poppins', sans-serif; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.ps-step input::-webkit-outer-spin-button, .ps-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ps-pv-files { display: flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 3px; border: 1px solid var(--cc-line); border-radius: 10px; background: var(--cc-soft); }
.ps-pv-files[hidden] { display: none; }
.ps-pv-files button { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: transparent; color: var(--cc-ink-2); font-size: 11px; cursor: pointer; transition: background .2s, color .2s; }
.ps-pv-files button:hover { background: var(--cc-card); color: var(--cc-teal); }
.ps-pv-files button:disabled { opacity: .3; pointer-events: none; }
.ps-pv-files span { min-width: 72px; text-align: center; font-size: .72rem; font-weight: 700; color: var(--cc-ink); white-space: nowrap; }

.ps-page .pm-pv-tbox b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
    .ps-in input, .ps-step input { font-size: 16px; }
    .ps-in input { height: 44px; }
    .ps-step { height: 44px; }
    .ps-pass { padding: 12px; }
    .ps-pass .pm-pass-in input { height: 46px; font-size: 16px; }
    .ps-pass .pm-unlock { height: 46px; padding: 0 16px; }
    .pm-pv-head { flex-wrap: wrap; }
    .ps-pv-files { order: 3; width: 100%; justify-content: space-between; }
}
@media (max-width: 600px) {
    .ps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
    .ps-file { grid-template-columns: 48px minmax(0, 1fr) auto; padding: 8px 8px 8px 10px; }
    .ps-file .pm-thumb { width: 48px; height: 62px; }
    .ps-file-a .pm-hbtn span { display: none; }
    .ps-gridbar { gap: 8px; }
    .ps-gridbar .pm-head-t small { display: none; }
    .ps-bar-r { display: contents; }
    .ps-gridbar .pm-head-t { order: 1; flex: 1 1 auto; min-height: 32px; }
    .ps-reset { order: 2; flex-shrink: 0; }
    .ps-quick { order: 3; flex: 1 1 100%; min-width: 0; }
    .ps-q-sel { flex: 1 1 auto; }
    .ps-q-sel button { flex: 1 1 0; padding: 0 4px; }
    .ps-pg-chk, .ps-pg-g { top: 5px; }
    .ps-pg-chk { right: 5px; width: 20px; height: 20px; }
    .ps-pg-g { left: 5px; min-width: 20px; height: 20px; }
    .ps-res-list li { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; }
}