.pte-card{overflow:hidden}
.pte-app [hidden]{display:none!important}
.pte-app{display:grid;gap:14px}
.pte-filebar,.pte-control-row,.pte-page-nav,.pte-actions,.pte-result-actions,.pte-panel-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pte-filebar{padding:12px 14px;background:var(--surface-soft,#f5f6f8);border-radius:12px}
.pte-filepick{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:10px;background:#f1404b;color:#fff;font-weight:700;cursor:pointer}
.pte-filepick input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.pte-password,.pte-pages,.pte-number,.pte-page-nav label{display:flex;align-items:center;gap:7px;color:var(--text-muted,#69707a);font-size:.92rem}
.pte-password input,.pte-pages input,.pte-number input,.pte-page-nav input{min-height:38px;width:auto;max-width:100%;padding:7px 10px;border:1px solid var(--border,#dfe2e7);border-radius:9px;background:var(--surface,#fff);color:var(--text,#222)}
.pte-password input{width:150px}
.pte-pages input{width:220px}
.pte-number input{width:70px}
.pte-page-nav input{width:72px}
.pte-fileinfo{min-width:150px;color:var(--text-muted,#69707a);overflow-wrap:anywhere}
.pte-controls{display:grid;gap:10px;padding:12px 14px;border:1px solid var(--border,#e4e6eb);border-radius:12px}
.pte-actions{padding-top:8px;border-top:1px solid var(--border,#e4e6eb)}
.pte-check{display:inline-flex;align-items:center;gap:7px;color:var(--text-muted,#69707a)}
.pte-check input{accent-color:#f1404b}
.pte-instructions{margin:0;color:var(--text-muted,#69707a);font-size:.94rem}
.pte-status{min-height:42px;padding:11px 14px;border-radius:10px;background:var(--surface-soft,#f5f6f8);color:var(--text,#333);line-height:1.55}
.pte-status[data-state="error"]{background:#fff0f0;color:#a5242b}
.pte-status[data-state="ok"]{background:#eff8f2;color:#21633d}
.pte-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);gap:14px;align-items:start}
.pte-preview-panel,.pte-result-panel{min-width:0;border:1px solid var(--border,#e4e6eb);border-radius:12px;background:var(--surface,#fff);overflow:hidden}
.pte-panel-title{justify-content:space-between;min-height:48px;padding:10px 13px;border-bottom:1px solid var(--border,#e4e6eb)}
.pte-panel-title span{color:var(--text-muted,#69707a);font-size:.86rem}
.pte-scroll{position:relative;max-height:68vh;min-height:240px;overflow:auto;background:#eef0f3;padding:10px}
.pte-stage{position:relative;width:max-content;max-width:100%;margin:0 auto;line-height:0}
.pte-stage canvas{display:block;width:100%;height:auto;background:#fff;box-shadow:0 2px 12px #17203320}
.pte-overlay{position:absolute;inset:0;touch-action:none;cursor:crosshair}
.pte-region{position:absolute;border:2px solid #ed3347;background:#f1404b25;box-shadow:0 0 0 9999px #1112;pointer-events:none}
.pte-empty{display:grid;place-items:center;min-height:220px;padding:24px;color:var(--text-muted,#69707a);text-align:center}
.pte-result-actions{padding:10px 12px;border-bottom:1px solid var(--border,#e4e6eb)}
.pte-table-scroll{max-height:68vh;min-height:250px;overflow:auto}
.pte-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;font-size:.9rem}
.pte-table th,.pte-table td{padding:5px;border-right:1px solid var(--border,#e4e6eb);border-bottom:1px solid var(--border,#e4e6eb);background:var(--surface,#fff)}
.pte-table th{position:sticky;top:0;z-index:2;background:var(--surface-soft,#f5f6f8);color:var(--text-muted,#69707a);font-weight:650}
.pte-table td:first-child,.pte-table th:first-child{position:sticky;left:0;z-index:1;background:var(--surface-soft,#f5f6f8)}
.pte-table th:first-child{z-index:3}
.pte-table input{width:150px;max-width:45vw;min-height:34px;padding:6px 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text,#222);font:inherit}
.pte-table input:focus{outline:2px solid #f1404b55;border-color:#f1404b}
.pte-row-number{display:inline-flex;min-width:38px;align-items:center;justify-content:space-between;gap:5px}
.pte-row-delete{border:0;background:transparent;color:var(--text-muted,#69707a);font-size:1.1rem;cursor:pointer}
.pte-row-delete:hover{color:#c32637}
.pte-help{padding:12px 14px;border:1px solid var(--border,#e4e6eb);border-radius:10px;color:var(--text-muted,#69707a)}
.pte-help summary{color:var(--text,#333);cursor:pointer;font-weight:650}
.pte-help div{max-width:1000px;line-height:1.75}
.pte-help p:last-child{margin-bottom:0}
@media(max-width:980px){.pte-workspace{grid-template-columns:1fr}.pte-scroll{max-height:55vh}.pte-table-scroll{max-height:60vh}}
@media(max-width:620px){.pte-filebar{align-items:stretch}.pte-password{align-items:flex-start;flex-direction:column}.pte-password input,.pte-pages input{width:min(100%,280px)}.pte-page-nav{width:100%}.pte-pages{width:100%;align-items:flex-start;flex-direction:column}.pte-number{flex:1}.pte-actions .btn,.pte-result-actions .btn{min-height:38px}.pte-stage{width:100%}.pte-table input{width:128px}}
@media print{.pte-filebar,.pte-controls,.pte-instructions,.pte-preview-panel,.pte-result-actions,.pte-help,.pte-status{display:none!important}.pte-workspace{display:block}.pte-result-panel{border:0}.pte-table-scroll{max-height:none;overflow:visible}.pte-table th{position:static}.pte-table td:first-child,.pte-table th:first-child{position:static}}
