.pt-page { display:flex; flex-direction:column; gap:12px; min-width:0; color:#20354f; }
.pt-page *, .pt-dialog *, .pt-pdf-dialog * { box-sizing:border-box; }
.pt-page h3,.pt-page h4,.pt-dialog h3,.pt-dialog h4,.pt-pdf-dialog h3 { margin:0; }
.pt-page-head,.pt-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.pt-page-head p,.pt-dialog-head p { margin:6px 0 0; color:#64748b; font-size:12px; line-height:1.6; }
body #content .pt-page button,.pt-dialog button,.pt-pdf-dialog button { width:auto; margin:0; flex:0 0 auto; }
.pt-button { border:1px solid #cedbea; color:#1c5aa5; background:#fff; border-radius:6px; padding:7px 11px; min-height:32px; font:inherit; font-size:12px; cursor:pointer; }
.pt-button.pt-primary { color:white; background:#1763c5; border-color:#1763c5; }
.pt-button:disabled { opacity:.5; cursor:default; }
.pt-button:focus-visible,.pt-business-tabs button:focus-visible { outline:2px solid #1763c5; outline-offset:2px; }
.pt-business-tabs { display:flex; gap:7px; padding-bottom:8px; border-bottom:1px solid #dfe7f1; }
.pt-business-tabs button { border:1px solid #d5deea; background:#fff; color:#37516f; border-radius:6px; padding:8px 18px; min-height:36px; }
.pt-business-tabs button[aria-selected=true] { background:#1763c5; border-color:#1763c5; color:#fff; }
.pt-filters { display:flex; align-items:flex-end; flex-wrap:wrap; gap:8px; }
.pt-filters label { display:flex; flex-direction:column; gap:5px; min-width:120px; font-size:12px; color:#64748b; }
.pt-filters .pt-keyword { flex:1; min-width:170px; }
.pt-filters input,.pt-filters select { width:100%; margin:0; height:34px; padding:5px 9px; border:1px solid #cedbea; border-radius:6px; background:white; color:#20354f; }
.pt-filters .pt-button { min-height:34px; }
.pt-table-scroll { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; border:1px solid #dfe7f1; border-radius:8px; background:#fff; scroll-padding-top:42px; }
.pt-table-scroll table { width:100%; min-width:720px; border-collapse:separate; border-spacing:0; font-size:12px; }
.pt-table-scroll th,.pt-table-scroll td { padding:12px; text-align:left; vertical-align:top; border-bottom:1px solid #e7edf4; }
.pt-table-scroll th { position:sticky; top:0; z-index:1; background:#f3f7fc; color:#465d79; font-weight:600; white-space:nowrap; }
.pt-table-scroll th:nth-child(1) { width:17%; }.pt-table-scroll th:nth-child(2) { width:25%; }.pt-table-scroll th:nth-child(3) { width:12%; }.pt-table-scroll th:nth-child(4) { width:14%; }
.pt-table-scroll td strong,.pt-table-scroll td small { display:block; overflow-wrap:anywhere; line-height:1.6; }.pt-table-scroll td small { margin-top:4px; color:#6b7f96; }
.pt-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.pt-table-scroll .pt-button { scroll-margin-block:44px; }
.pt-badge { display:inline-block; padding:3px 7px; border-radius:5px; background:#edf3fa; color:#526b89; font-size:12px; white-space:nowrap; }.pt-badge.is-active { background:#e7f5ee;color:#1c7552; }
.pt-empty { text-align:center!important; color:#6b7f96; padding:35px 20px!important; line-height:1.7; }.pt-empty p { margin:0 0 12px; }
.pt-page-foot { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px; color:#6b7f96; font-size:12px; line-height:1.6; }
.pt-help { color:#6b7f96; font-size:12px; line-height:1.7; margin:8px 0; }
.pt-operation { background:#edf5fe; border-radius:6px; padding:10px 12px; font-size:12px; line-height:1.7; margin:0; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }.pt-operation[hidden] { display:none; }
.pt-error { color:#a83c29!important; background:#fff4ee; }.pt-error:not(.pt-operation) { padding:10px; border-radius:5px; }
.pt-dialog,.pt-pdf-dialog { padding:0; border:1px solid #dce5f1; border-radius:10px; color:#20354f; background:#fff; width:min(1050px,calc(100vw - 32px)); max-width:none; height:min(850px,calc(100dvh - 32px)); max-height:calc(100dvh - 32px); overflow:hidden; box-shadow:0 20px 80px #1329434d; }
.pt-dialog[open],.pt-pdf-dialog[open] { display:flex; flex-direction:column; }
.pt-dialog::backdrop,.pt-pdf-dialog::backdrop { background:rgba(15,28,46,.48); }
.pt-dialog-head { padding:16px 20px; flex:0 0 auto; border-bottom:1px solid #e2e9f1; }.pt-dialog-head h3 { font-size:17px; overflow-wrap:anywhere; }
.pt-dialog-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px 20px; display:flex; flex-direction:column; gap:14px; }
.pt-current { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border:1px solid #dce8f7; background:#f5f9ff; border-radius:7px; }.pt-current span { display:block; color:#6b7f96; font-size:12px; margin-bottom:5px; }.pt-current strong { font-size:14px; overflow-wrap:anywhere; }
.pt-upload,.pt-content-editor { border:1px solid #dce5ef; padding:12px; border-radius:7px; }.pt-upload summary { cursor:pointer; color:#1c5aa5; font-weight:600; font-size:13px; }.pt-content-editor h4 { font-size:14px; }
.pt-dialog fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:0; margin:12px 0 0; border:0; min-width:0; }.pt-dialog fieldset:disabled { opacity:.7; }
.pt-dialog label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:12px; line-height:1.5; }.pt-dialog label span { color:#49617d; }
.pt-dialog input:not([type=checkbox]),.pt-dialog textarea { width:100%; padding:8px 10px; border:1px solid #ccd8e6; border-radius:5px; color:#20354f; background:#fff; margin:0; font:inherit; font-size:13px; min-width:0; }.pt-dialog input[type=file] { padding:7px; font-size:12px; }.pt-dialog textarea { resize:vertical; }
.pt-dialog small { color:#6b7f96; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }.pt-wide { grid-column:1/-1; }.pt-form-actions { display:flex; justify-content:flex-end; gap:8px; }
.pt-version-list { display:flex; flex-direction:column; gap:10px; }.pt-version-list>h4 { font-size:14px; }.pt-version { border:1px solid #dce5ef; border-radius:7px; padding:13px; }.pt-version header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }.pt-version header strong { display:block; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }.pt-version header small { display:block; margin-top:4px; }.pt-version-notes { white-space:pre-wrap; overflow-wrap:anywhere; color:#64748b; font-size:12px; line-height:1.6; }.pt-activate { display:flex; align-items:center; gap:10px; flex-wrap:wrap; border-top:1px solid #e6edf5; margin-top:12px; padding-top:12px; }.pt-activate label { flex-direction:row; align-items:center; }.pt-activate input { width:16px; height:16px; margin:0; flex:0 0 auto; }
.pt-pdf-dialog { width:min(1200px,calc(100vw - 24px)); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); }.pt-pdf-body { flex:1; min-height:0; overflow:auto; background:#f1f4f8; }.pt-pdf-body>p { padding:20px; }.pt-pdf-body iframe { display:block; width:100%; height:100%; border:0; background:#e6e9ee; }
@media(min-width:769px){.pt-page{height:var(--pt-page-height,calc(100dvh - 120px));overflow:hidden}.pt-table-scroll{flex:1}.pt-page-head,.pt-business-tabs,.pt-filters,.pt-operation,.pt-page-foot{flex:0 0 auto}}
@media(min-width:769px)and(max-height:700px){.pt-page{gap:8px}.pt-page-head p{margin-top:3px}.pt-business-tabs{padding-bottom:6px}.pt-business-tabs button{padding:6px 14px;min-height:32px}.pt-dialog-head{padding:12px 16px}.pt-dialog-body{padding:12px 16px}}
@media(max-width:768px){.pt-page-head{flex-wrap:wrap}.pt-page-foot{display:block}.pt-filters label{flex:1}.pt-dialog fieldset{grid-template-columns:minmax(0,1fr)}.pt-dialog-head{padding:12px}.pt-dialog-body{padding:12px}.pt-table-scroll{max-height:65vh}.pt-current{align-items:flex-start}}

/* Mobile template library: original fields and version operations remain intact. */
body.mobile-ui-active #content .pt-page{gap:8px;height:auto;overflow:visible;}
body.mobile-ui-active #content .pt-page-head{display:flex;align-items:center;flex-wrap:nowrap;gap:6px;}
body.mobile-ui-active #content .pt-page-head>div{display:none;}
body.mobile-ui-active #content .pt-page-head>[data-pt-count]{order:-2;flex:1;font-size:12px;color:#66758b;}
body.mobile-ui-active #content .pt-page-head>.mpt-help{order:-1;}
body.mobile-ui-active #content .pt-page-head>.pt-button{font-size:12px;min-height:36px;padding:5px 8px;}
body.mobile-ui-active .pt-page .mpt-help>summary{list-style:none;cursor:pointer;color:#175cc3;font-size:12px;line-height:20px;padding:8px 3px;white-space:nowrap;}
body.mobile-ui-active .pt-page .mpt-help>summary::after{content:'⌄';margin-left:3px;}
body.mobile-ui-active .pt-page .mpt-help:not([open])>.mpt-help-body{display:none;}
body.mobile-ui-active .pt-page .mpt-help-body{position:fixed;z-index:1400;overflow:auto;box-sizing:border-box;padding:10px;border:1px solid #d7e3f3;border-radius:8px;background:#fff;box-shadow:0 8px 24px #17365d26;font-size:12px;line-height:18px;color:#66758b;}
body.mobile-ui-active .pt-page .mpt-help-body>p{margin:0 0 8px;}
body.mobile-ui-active .pt-page .mpt-help-body>span{display:block;}
body.mobile-ui-active #content .pt-page-foot:empty{display:none;}
body.mobile-ui-active #content .pt-business-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:0;border:0;}
body.mobile-ui-active #content .pt-business-tabs>button{width:100%;min-width:0;min-height:36px;font-size:12px;line-height:20px;padding:6px;}
body.mobile-ui-active #content .pt-filters{display:grid;grid-template-columns:minmax(0,1fr) 100px auto;align-items:center;gap:5px;}
body.mobile-ui-active #content .pt-filters label{min-width:0;margin:0;}
body.mobile-ui-active #content .pt-filters label>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
body.mobile-ui-active #content .pt-filters .pt-keyword{grid-column:1;grid-row:1;min-width:0;}
body.mobile-ui-active #content .pt-filters label:first-child{grid-column:2;grid-row:1;}
body.mobile-ui-active #content .pt-filters :is(input,select){height:36px;min-height:36px;padding:6px;font-size:12px;font-weight:400;}
body.mobile-ui-active #content .pt-filters>.pt-button{font-size:12px;min-height:36px;padding:5px;}
body.mobile-ui-active #content .pt-table-scroll{max-height:none;overflow:visible;border:0;border-radius:0;background:transparent;}
body.mobile-ui-active #content .pt-table-scroll table{display:block;min-width:0;border:0;}
body.mobile-ui-active #content .pt-table-scroll thead{display:none;}
body.mobile-ui-active #content .pt-table-scroll tbody{display:grid;gap:7px;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:8px 10px;border:1px solid #dce5ef;border-radius:9px;background:#fff;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td{padding:0;border:0;min-width:0;font-size:11px;line-height:16px;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td::before{display:none;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:first-child{grid-column:1;grid-row:1;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:first-child>strong{font-size:14px;line-height:20px;font-weight:600;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:first-child>small{display:none;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(2){grid-column:1/-1;grid-row:2;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(2)>strong{font-size:12px;line-height:17px;font-weight:400;}
body.mobile-ui-active #content .pt-table-scroll .mpt-same-name>td:nth-child(2)>strong{display:none;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(2)>small{display:none;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(3){display:none;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(4){grid-column:2;grid-row:1;text-align:right;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(4)>small{margin:2px 0 0;color:#a85b16;font-size:11px;line-height:16px;}
body.mobile-ui-active #content .pt-table-scroll tr[data-template-key]>td:nth-child(5){grid-column:1/-1;grid-row:3;}
body.mobile-ui-active #content .pt-table-scroll .mpt-card-footer{display:flex;align-items:center;flex-wrap:wrap;gap:2px 7px;}
body.mobile-ui-active #content .pt-table-scroll .mpt-card-version{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 5px;flex:1 1 70px;min-width:0;color:#66758b;font-size:11px;line-height:16px;}
body.mobile-ui-active #content .pt-table-scroll .mpt-card-version>small{display:inline;margin:0;font-size:11px;line-height:16px;}
body.mobile-ui-active #content .pt-table-scroll .pt-row-actions{display:flex;justify-content:flex-end;gap:7px;margin-left:auto;}
body.mobile-ui-active #content .pt-table-scroll .pt-row-actions>.pt-button{min-height:28px;line-height:20px;padding:4px 0;border:0;background:transparent;font-size:12px;color:#175cc3;}
body.mobile-ui-active #content .pt-table-scroll .pt-badge{font-size:11px;line-height:17px;padding:0 4px;border-radius:4px;}
body.mobile-ui-active #content .pt-table-scroll .pt-empty{display:block;border:0;padding:16px 10px!important;}
body.mobile-ui-active #content :is(.pt-dialog,.pt-pdf-dialog){position:fixed;inset:auto;left:8px;top:calc(var(--mpt-vv-top,0px) + 8px);margin:0;width:calc(100% - 16px);max-width:none;height:auto;max-height:calc(var(--mpt-vv-height,100dvh) - 16px);border-radius:9px;}
body.mobile-ui-active #content .pt-pdf-dialog{height:calc(var(--mpt-vv-height,100dvh) - 16px);}
body.mobile-ui-active #content .pt-dialog-head{align-items:center;padding:8px 10px;gap:8px;}
body.mobile-ui-active #content .pt-dialog-head>div{flex:1;min-width:0;}
body.mobile-ui-active #content .pt-dialog-head h3{font-size:14px;line-height:20px;font-weight:600;}
body.mobile-ui-active #content .pt-dialog-head p{font-size:11px;line-height:16px;margin:2px 0 0;}
body.mobile-ui-active #content .pt-dialog-head>[data-pt-action=close],body.mobile-ui-active #content .pt-dialog-head>[data-pt-action=close-pdf]{order:-1;font-size:12px;min-height:36px;padding:5px 7px;white-space:nowrap;}
body.mobile-ui-active #content .pt-dialog-body{padding:10px;gap:8px;}
body.mobile-ui-active #content .pt-current{padding:6px 8px;gap:6px;align-items:center;}
body.mobile-ui-active #content .pt-current span{font-size:11px;line-height:16px;margin:0;}
body.mobile-ui-active #content .pt-current strong{font-size:12px;line-height:17px;font-weight:500;}
body.mobile-ui-active #content .pt-current>.pt-button{min-height:32px;padding:5px 6px;font-size:11px;}
body.mobile-ui-active #content .pt-dialog :is(.pt-upload,.pt-content-editor){padding:8px;}
body.mobile-ui-active #content .pt-dialog .pt-help{font-size:11px;line-height:17px;margin:6px 0;}
body.mobile-ui-active #content .pt-dialog fieldset{gap:8px;margin:8px 0 0;}
body.mobile-ui-active #content .pt-dialog label{margin:0;gap:4px;min-width:0;font-weight:400;font-size:12px;line-height:18px;}
body.mobile-ui-active #content .pt-dialog :is(input:not([type=checkbox]),textarea,.mpt-section-picker select){font-size:13px;font-weight:400;line-height:19px;padding:6px 8px;min-height:36px;width:100%;margin:0;}
body.mobile-ui-active #content .pt-dialog .mpt-section-picker{grid-column:1/-1;display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:6px;}
body.mobile-ui-active #content .pt-dialog .mpt-section-hidden{display:none;}
body.mobile-ui-active #content .pt-dialog .pt-content-editor textarea{min-height:140px;}
body.mobile-ui-active #content .pt-dialog .pt-form-actions{gap:6px;flex-wrap:wrap;}
body.mobile-ui-active #content .pt-dialog .pt-form-actions>.pt-button{min-height:36px;padding:6px;font-size:12px;line-height:18px;}
body.mobile-ui-active #content .pt-dialog .pt-version-list{gap:7px;}
body.mobile-ui-active #content .pt-dialog .pt-version{padding:8px 10px;border-radius:9px;}
body.mobile-ui-active #content .pt-dialog .pt-version header{gap:6px;margin-bottom:3px;}
body.mobile-ui-active #content .pt-dialog .pt-version header strong{font-size:14px;line-height:20px;font-weight:600;}
body.mobile-ui-active #content .pt-dialog .pt-version header small{font-size:11px;line-height:16px;margin-top:1px;}
body.mobile-ui-active #content .pt-dialog .pt-badge{font-size:11px;line-height:17px;padding:0 4px;}
body.mobile-ui-active #content .pt-dialog .pt-version-notes{font-size:11px;line-height:16px;margin:3px 0;}
body.mobile-ui-active #content .pt-dialog .pt-activate{padding-top:7px;margin-top:6px;gap:5px;}
body.mobile-ui-active #content .pt-dialog .pt-activate label{flex-direction:row;align-items:flex-start;font-size:12px;line-height:18px;}
body.mobile-ui-active #content .pt-dialog .pt-activate input{margin-top:2px;}
