.purchase-page{padding:26px;color:var(--ink);font-size:1rem;line-height:1.6;min-width:0}
.purchase-page h2{font-size:1.4rem}.purchase-page label{font-size:.88rem}
.purchase-page input,.purchase-page textarea,.purchase-page select{font-size:16px}
.purchase-page fieldset{border:0;padding:0;margin:0;min-width:0}
.purchase-heading,.purchase-section-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:20px}
.purchase-heading p,.purchase-count,.hint{color:var(--muted)}
.purchase-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.purchase-actions button{font-size:.88rem}.purchase-filters{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto auto;gap:14px;align-items:end;background:var(--bg);padding:20px;border:1px solid var(--line);border-radius:12px;margin-bottom:18px}
.purchase-document{display:flex;justify-content:space-between;gap:24px;padding:24px;border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.purchase-document>div{min-width:0}.purchase-document h3{margin:12px 0 8px}.purchase-document p{margin:6px 0;overflow-wrap:anywhere}.purchase-document .purchase-actions{max-width:350px}
.content[data-view=orders] #toolbar:empty{display:none}.content[data-view=orders]{overflow:visible;min-width:0}
.purchase-editor-page{background:#f4f7fb;padding:20px}.po-editor-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;position:sticky;top:0;z-index:8;padding:12px 0;background:#f4f7bff5;backdrop-filter:blur(10px);border-bottom:1px solid #dfe6ef;margin-bottom:20px}
.po-editor-bar{background:#f4f7fbf5}.po-editor-bar>div{min-width:0}.po-editor-bar strong{font-size:1rem}.po-editor-bar>div:first-child{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.po-editor-bar #poSavedStatus{font-size:.8rem;color:var(--muted);flex-basis:100%;padding-left:4px}
.po-editor-bar .purchase-actions{justify-content:flex-end}.po-editor-bar button{min-height:48px}
.po-workspace{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:22px;align-items:start;min-width:0}.po-workspace>section{min-width:0}
.po-sheet-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}.purchase-delivery{display:flex;align-items:center;gap:8px;min-width:0}.purchase-delivery label{margin:0;white-space:nowrap}.purchase-delivery input{width:156px;min-width:0}.po-sheet-controls button{font-size:.82rem}
.po-sheet-host{padding:24px;background:#e8eef5;border:1px solid #d6e0ed;border-radius:12px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-gutter:stable;min-width:0}
.po-sheet-view{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin:0 0 10px;min-width:0}
.po-sheet-view>span{font-size:13px;color:var(--muted);margin-right:auto}
.po-sheet-view button{min-height:44px;padding:8px 12px;font-size:14px;white-space:nowrap}
.po-sheet-view button[aria-pressed=true]{color:#075fac;background:#e7f1ff;border-color:#b6d5ff}
@media print{.po-sheet-view{display:none!important}}
.po-paper{border:1px solid #60646b;background:#fff;min-width:850px;box-shadow:0 5px 24px #24374d0a;color:#111}
.po-paper-title{display:grid;grid-template-columns:1fr 235px;align-items:center;border-bottom:1px solid #222;min-height:116px}.po-paper-title h2{font-size:clamp(25px,2vw,38px);text-align:center;font-weight:800;margin:0;padding:24px;overflow-wrap:anywhere}.po-paper-title>div{padding:14px}.po-paper-title label{font-size:14px;color:#526076;margin-bottom:6px}.po-paper-title input{border:1px solid transparent;background:transparent;font-size:17px;font-weight:700;padding:8px;min-height:44px}
.purchase-page .po-paper-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:16px;min-width:0;margin:0}
.purchase-page .po-paper-table th,.purchase-page .po-paper-table td{border:1px solid #777;padding:0;vertical-align:middle;text-align:center;background:#fff;color:#111;white-space:normal;position:static;max-width:none}
.purchase-page .po-paper-table th{background:#e9e9e9;padding:15px 6px;font-size:16px;font-weight:750;line-height:1.5}
.purchase-page .po-paper-table tr:hover td{background:#fff}.po-paper-table .po-col-brand{width:9%}.po-paper-table .po-col-flute{width:8%}.po-paper-table .po-col-name{width:34%}.po-paper-table .po-col-spec{width:21%}.po-paper-table .po-col-qty{width:9%}.po-paper-table .po-col-delivery{width:19%}.po-paper-table:has(.po-col-remark) .po-col-name{width:27%}.po-paper-table:has(.po-col-remark) .po-col-delivery{width:14%}.po-col-remark{width:12%}
.purchase-page .po-paper input,.purchase-page .po-paper textarea{border:1px solid transparent;border-radius:0;background:transparent;color:#111;width:100%;min-width:0;font-size:16px;text-align:center;line-height:1.6;padding:14px 7px;min-height:56px;opacity:1}
.purchase-page .po-paper input:hover,.purchase-page .po-paper textarea:hover{background:#f4f8fe}.purchase-page .po-paper input:focus,.purchase-page .po-paper textarea:focus{background:#edf5ff;outline:2px solid #378bdb;outline-offset:-2px;position:relative;z-index:1}
.purchase-page .po-paper textarea{resize:vertical;min-height:68px}.purchase-page .po-name-cell textarea{text-align:left;padding-left:16px;font-weight:650}.po-name-cell small{display:block;text-align:left;padding:0 16px;overflow-wrap:anywhere}.po-row-tools{display:flex;flex-wrap:wrap;gap:4px;padding:2px 10px 8px}.po-row-tools button{min-width:44px;min-height:44px;border:1px solid #d9e2ed;color:#496078;background:#f6f8fb;border-radius:5px;padding:6px 8px;font-size:13px;font-weight:500}.po-row-tools button.danger{color:#a32b2b}.po-blank-row td{height:62px}
.po-paper-notes{display:grid;grid-template-columns:17% 1fr;min-height:112px;border-top:1px solid #333;border-bottom:1px solid #333}.po-paper-notes label{display:flex;align-items:center;justify-content:center;margin:0;border-right:1px solid #777;font-size:17px;font-weight:700;padding:12px;overflow-wrap:anywhere}.purchase-page .po-paper-notes textarea{text-align:left;padding:16px}
.po-paper-footer{display:grid;grid-template-columns:1fr 32%;min-height:112px}.po-paper-footer>img{max-width:230px;width:75%;align-self:center;margin:18px 24px}.po-paper-footer>div{border-left:1px solid #777}.po-paper-footer>div>div{display:grid;grid-template-columns:70px 1fr;min-height:56px;align-items:stretch}.po-paper-footer>div>div+div{border-top:1px solid #777}.po-paper-footer strong,.po-paper-footer span{padding:12px 8px;display:flex;align-items:center;justify-content:center;font-size:15px;overflow-wrap:anywhere}.po-paper-footer strong{border-right:1px solid #777}
.po-paper-hint{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:.8rem;padding:12px 0}.po-table-mode{display:none}.po-mobile-tabs{display:none}
.po-catalog{position:sticky;top:120px;border:1px solid #dce5ef;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 8px 24px #1b3b6107;min-width:0;display:flex;flex-direction:column;max-height:calc(100dvh - 140px)}
.po-catalog-head{padding:20px 18px 16px;flex-shrink:0}.po-catalog-head h3{margin:0 0 4px;font-size:1.2rem}.po-catalog-head p{color:var(--muted);font-size:14px;line-height:1.6;margin:6px 0 14px}.po-catalog-head input{font-size:16px;min-height:48px}.po-catalog-head label{font-size:14px}.po-catalog-head>button{width:100%;margin-top:12px;font-size:14px;min-height:44px}
.po-catalog-filters{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.po-catalog-filters select{font-size:15px;padding:10px 8px}.po-catalog-notice{margin:0;background:#f6f9fd;border-block:1px solid var(--line);padding:9px 18px;font-size:14px;color:#4f6580;flex-shrink:0}.po-catalog-notice button{font-size:13px}
.po-catalog-list{overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;min-height:100px;flex:1}.po-catalog-item{display:flex;align-items:center;gap:12px;padding:18px 14px;border-bottom:1px solid #e6ebf2;min-width:0}.po-catalog-item>div{min-width:0;flex:1}.po-catalog-item strong{display:block;font-size:16px;line-height:1.6;overflow-wrap:anywhere}.po-catalog-item span,.po-catalog-item small{display:block;color:var(--muted);font-size:14px;line-height:1.6;margin-top:4px;overflow-wrap:anywhere}.po-catalog-item button{flex-shrink:0;min-height:44px;min-width:44px;padding:8px;font-size:22px;border-radius:8px}.po-catalog-bottom{border-top:1px solid var(--line);padding:14px 18px;background:#f7faff;display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;flex-shrink:0}.po-catalog-bottom strong{font-size:14px}.po-catalog-bottom button{display:none}
.po-manage-catalog{border:1px solid var(--line);border-radius:14px;overflow:hidden;max-width:1000px;margin:auto}.po-manage-catalog .po-catalog-head{position:sticky;top:0;background:white;z-index:2}.po-manage-catalog .po-catalog-list{max-height:65vh}.po-manage-catalog .po-catalog-item button{font-size:16px}.po-manage-catalog .po-catalog-filters{max-width:500px}
.purchase-output-options,.po-cost-section,.po-document-tools{border:1px solid var(--line);border-radius:12px;background:#fff;margin-top:22px;padding:20px}.purchase-page summary{min-height:44px;cursor:pointer;font-weight:650;padding:8px 0}.purchase-output-fields,.purchase-company-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:20px}.purchase-company-fields{grid-template-columns:repeat(3,minmax(0,1fr));padding-top:20px;border-top:1px solid var(--line)}.checkline{line-height:1.7}.purchase-page .checkline input{width:24px;min-height:24px}.purchase-page .hint{font-size:14px}.purchase-section-heading{align-items:flex-start;margin:0 0 18px}.purchase-section-heading h3{font-size:1.2rem;margin:0}.purchase-section-heading>span{font-size:14px;max-width:300px;color:var(--muted)}
.po-cost-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.po-cost-summary>div+div{border-left:1px solid var(--line);padding-left:22px}.po-cost-summary span{display:block;font-size:15px;color:var(--muted)}.po-cost-summary strong{font-size:23px;display:block;margin-top:8px;overflow-wrap:anywhere}.po-cost-summary>p{grid-column:1/-1;margin:0;padding:12px;border-radius:8px;background:#fff7e9;color:#85571c;font-size:15px}.po-cost-options{display:flex;align-items:end;flex-wrap:wrap;gap:24px;margin:22px 0}.po-cost-options>div{max-width:130px}.po-cost-options .checkline{padding-bottom:10px;font-size:16px}.po-cost-section>details{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}.po-cost-rows article{display:grid;gap:8px;padding:18px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.po-cost-rows strong,.po-cost-rows span{font-size:16px}.po-cost-rows small{font-size:14px;color:var(--muted)}.po-cost-rows .tag{font-size:13px;display:inline-block}.po-rule{border:1px solid var(--line);padding:16px;border-radius:10px;margin:18px 0}.po-rule-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.po-rule-note{grid-column:1/-1}.po-rule>button{margin-top:14px;font-size:14px}.po-formula{background:#f5f8fd;padding:16px;font-size:15px;border-radius:8px;overflow-wrap:anywhere}.po-cost-section .purchase-actions button{font-size:15px}
.purchase-preview{margin-top:22px;border:1px solid var(--line);background:white}.purchase-preview img{width:100%;height:auto;display:block}.purchase-link{display:inline-flex;min-height:46px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:10px 15px;color:var(--ink);font-size:.9rem;font-weight:600;text-decoration:none}
dialog:has(#poPreviewImage){max-height:92dvh;overflow:auto}dialog:has(#poPreviewImage) .modal-head{position:sticky;top:0;background:#fff;z-index:4}dialog:has(#poPreviewImage) .purchase-actions{position:sticky;top:0;background:#fff;z-index:3;padding:10px 0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:1700px){.po-workspace{grid-template-columns:minmax(0,1fr) 360px}.po-paper{min-width:0}.po-sheet-host{padding:28px}}
@media(max-width:1250px){.po-workspace{grid-template-columns:minmax(0,1fr) 290px;gap:16px}.purchase-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.po-sheet-host{padding:16px}.po-cost-summary{gap:12px}.po-cost-summary>div+div{padding-left:12px}.po-cost-summary strong{font-size:20px}.purchase-heading{flex-wrap:wrap}}
@media(max-width:1000px){.purchase-page{padding:18px 14px}.purchase-document{display:block}.purchase-document .purchase-actions{max-width:none;margin-top:16px}.po-editor-bar{position:sticky;top:0;display:block;margin-bottom:0;padding:12px 0}.po-editor-bar>div:first-child{gap:10px}.po-editor-bar #poSavedStatus{font-size:14px}.po-editor-bar .purchase-actions{justify-content:flex-start;margin-top:12px;display:flex;gap:8px}.po-editor-bar .purchase-actions button{flex:1;font-size:15px;padding:10px 8px;min-height:48px}.po-editor-bar .purchase-actions .primary{flex:1.4}.po-editor-bar strong{font-size:17px}.po-editor-bar button{font-size:15px}
  .po-mobile-tabs{display:flex;gap:8px;position:sticky;top:138px;z-index:7;background:#f4f7fb;padding:12px 0;margin-bottom:12px}.po-mobile-tabs button{flex:1;min-height:50px;font-size:17px}.po-mobile-tabs button[aria-pressed=true]{background:var(--blue);color:white;border-color:var(--blue)}
  .po-workspace{display:block}.po-workspace[data-pane=paper] #poCatalogPane{display:none}.po-workspace[data-pane=catalog] #poDocumentPane{display:none}.po-catalog{position:relative;top:0;max-height:calc(100dvh - 230px);min-height:400px}.po-catalog-head{padding:18px}.po-catalog-head p{font-size:15px}.po-catalog-bottom button{display:block;font-size:16px}.po-catalog-item{padding:18px}.po-catalog-item strong{font-size:18px}.po-catalog-item span{font-size:16px}.po-catalog-item button{min-width:50px;min-height:50px}.po-catalog-head input{font-size:18px;min-height:52px}.po-catalog-filters select{font-size:16px;min-height:50px}
  .purchase-page input,.purchase-page select,.purchase-page textarea{font-size:18px;min-height:50px}.purchase-page label{font-size:16px}.po-sheet-controls{margin-top:8px}.purchase-delivery{flex-wrap:wrap;width:100%}.purchase-delivery label{font-size:16px}.purchase-delivery input{flex:1}.po-sheet-controls .purchase-actions{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.po-sheet-controls button{font-size:15px;min-height:48px;padding:8px}.po-sheet-host{padding:12px}.po-paper-hint{font-size:15px;align-items:flex-start;flex-wrap:wrap}.po-table-mode{display:block;font-size:16px;min-height:48px}
  .po-cost-summary{grid-template-columns:1fr}.po-cost-summary>div+div{border-left:0;border-top:1px solid var(--line);padding:16px 0 0}.po-cost-summary strong{font-size:26px}.purchase-section-heading{display:block}.purchase-section-heading>span{display:block;margin-top:10px}.purchase-output-fields,.purchase-company-fields{grid-template-columns:1fr}.purchase-page .checkline{font-size:16px}.purchase-output-options,.po-cost-section{padding:18px 14px}.po-rule-fields{grid-template-columns:1fr}.po-cost-options{align-items:center}.po-cost-options>div{max-width:140px}.purchase-filters{grid-template-columns:1fr 1fr}.purchase-filters>div:first-child{grid-column:1/-1}.purchase-heading{display:block}.purchase-heading>.purchase-actions{margin-top:16px}.po-editor-bar>div:first-child>button{padding:8px 10px}
}
@media(max-width:650px){
  .po-sheet-host:not(.po-preview-mode){padding:0;background:transparent;border:0;overflow:visible}
  .po-sheet-host:not(.po-preview-mode) .po-paper{min-width:0;border:0;box-shadow:none;background:transparent}
  .po-sheet-host:not(.po-preview-mode) .po-paper-title{grid-template-columns:1fr;background:white;border:1px solid var(--line);border-radius:12px;margin-bottom:14px;min-height:0}
  .po-sheet-host:not(.po-preview-mode) .po-paper-title h2{font-size:25px;padding:18px}.po-sheet-host:not(.po-preview-mode) .po-paper-title>div{padding:0 16px 16px}
  .po-sheet-host:not(.po-preview-mode) .po-paper-table,.po-sheet-host:not(.po-preview-mode) .po-paper-table tbody{display:block;width:100%;table-layout:auto}
  .po-sheet-host:not(.po-preview-mode) colgroup,.po-sheet-host:not(.po-preview-mode) thead,.po-sheet-host:not(.po-preview-mode) .po-blank-row{display:none}
  .po-sheet-host:not(.po-preview-mode) .po-data-row{display:grid;grid-template-columns:1fr 1fr;gap:16px 12px;background:white;border:1px solid var(--line);border-radius:12px;padding:18px 14px;margin-bottom:16px}
  .po-sheet-host:not(.po-preview-mode) .po-data-row>td{display:block;border:0;min-width:0;background:transparent;padding:0;text-align:left}
  .po-sheet-host:not(.po-preview-mode) .po-data-row>td:before{content:attr(data-label);display:block;color:var(--muted);font-size:16px;font-weight:600;margin-bottom:6px}
  .po-sheet-host:not(.po-preview-mode) .po-name-cell{grid-column:1/-1;grid-row:1}.po-sheet-host:not(.po-preview-mode) .po-data-row>td:nth-child(4),.po-sheet-host:not(.po-preview-mode) .po-data-row>td:nth-child(7){grid-column:1/-1}
  .po-sheet-host:not(.po-preview-mode) .po-paper input,.po-sheet-host:not(.po-preview-mode) .po-paper textarea{border:1px solid #c9d5e3;border-radius:8px;font-size:18px;min-height:54px;background:#fff;padding:12px;text-align:left}
  .po-sheet-host:not(.po-preview-mode) .po-paper textarea{min-height:90px}.po-sheet-host:not(.po-preview-mode) .po-row-tools{padding:10px 0 0;gap:8px}.po-sheet-host:not(.po-preview-mode) .po-row-tools button{font-size:15px;min-height:48px;flex:1}
  .po-sheet-host:not(.po-preview-mode) .po-paper-notes{display:block;border:1px solid var(--line);border-radius:12px;background:#fff;padding:18px 14px}.po-sheet-host:not(.po-preview-mode) .po-paper-notes label{display:block;border:0;text-align:left;padding:0;margin-bottom:10px;font-size:18px}
  .po-sheet-host:not(.po-preview-mode) .po-paper-footer{display:none}.po-cost-section .purchase-actions{display:grid;grid-template-columns:1fr}.po-cost-section .purchase-actions button{font-size:16px;min-height:50px}
}
@media print{.po-catalog,.po-editor-bar,.po-mobile-tabs,.po-sheet-controls,.po-row-tools,.po-paper-hint,.purchase-output-options,.po-cost-section,.po-document-tools{display:none!important}.po-workspace{display:block}.po-sheet-host{overflow:visible;background:white;border:0;padding:0}.po-paper{min-width:0;box-shadow:none}.purchase-editor-page{padding:0;background:white}}

.po-navigation{display:flex;gap:8px;border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:20px;flex-wrap:wrap}
.po-navigation button{min-height:48px;font-size:16px}.po-navigation button[aria-current=page]{background:#e6f1ff;border-color:#a9cdef;color:#075eae}
.po-paper-title{display:block;min-height:130px;border-bottom:1px solid #ccc}.po-paper-title h2{font-size:clamp(32px,2.8vw,48px);padding:32px 20px}
.po-paper-meta{display:grid;grid-template-columns:1fr 235px;align-items:center;min-height:76px;border-bottom:1px solid #333}.po-paper-meta>div{display:flex;align-items:center;padding:10px 18px;gap:12px}.purchase-page .po-paper-meta select,.purchase-page .po-paper-meta input{border:1px solid transparent;min-height:48px;font-size:18px;font-weight:700;padding:8px;background:transparent}.po-paper-meta select{width:auto;max-width:80%}.po-paper-meta strong{font-size:18px;white-space:nowrap}
.po-catalog-head p{display:none}.po-catalog-head>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.po-catalog-head h3{margin-bottom:16px}.po-catalog-filters label{margin-bottom:4px}
.po-config-card{background:white;border:1px solid var(--line);padding:24px;border-radius:12px;margin-bottom:24px}.po-config-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}.po-config-fields textarea{font-size:17px;line-height:1.8}.po-config-card p{font-size:16px;color:var(--muted)}.po-suppliers article{border:1px solid var(--line);padding:20px;border-radius:10px;margin-top:16px}.po-supplier-fields{display:grid;grid-template-columns:2fr 1fr 1fr auto;align-items:end;gap:20px}.po-supplier-fields .checkline{margin-bottom:10px}.po-config-save{display:flex;justify-content:space-between;align-items:center;gap:16px;position:sticky;bottom:0;background:white;padding:18px;border:1px solid var(--line);border-radius:10px}.po-config-save span{font-size:16px}
.po-manage-catalog .po-catalog-item{flex-wrap:wrap}.po-manage-catalog .po-catalog-item>div{flex-basis:65%}.po-manage-catalog .po-catalog-item>button{font-size:15px}
body:has(.purchase-editor-page) main>.page-head{display:none}
body:has(.purchase-editor-page) .top-actions>[data-act=savePrint],body:has(.purchase-editor-page) .top-actions>[data-act=export],body:has(.purchase-editor-page) .top-actions>[data-act=print],body:has(.purchase-editor-page) .top-actions>[data-act=undo],body:has(.purchase-editor-page) .top-actions>[data-act=redo]{display:none}
dialog:has([name=poName]) .modal-head{position:sticky;top:0;z-index:3;background:#fff}dialog:has([name=poName]) .modal-footer{position:sticky;bottom:0;z-index:3}dialog:has([name=poName]){overflow:auto}
@media(min-width:1001px){.po-row-tools{opacity:0;transition:opacity .15s}.po-data-row:hover .po-row-tools,.po-data-row:focus-within .po-row-tools{opacity:1}}
@media(max-width:1000px){.po-mobile-tabs{top:var(--po-bar-height,150px)}.po-catalog{max-height:calc(100dvh - var(--po-bar-height,150px) - 90px);min-height:350px}.po-config-fields{grid-template-columns:1fr 1fr}.po-supplier-fields{grid-template-columns:1fr 1fr}.po-supplier-fields>div:first-child{grid-column:1/-1}.po-config-save{bottom:calc(76px + env(safe-area-inset-bottom));flex-wrap:wrap}.po-navigation{gap:6px}.po-navigation button{flex:1;padding:10px 6px;font-size:15px}.po-paper-meta select{max-width:80%}}
@media(max-width:650px){.po-config-card{padding:18px 14px}.po-config-fields,.po-supplier-fields{grid-template-columns:1fr}.po-config-save button{width:100%;font-size:18px;min-height:52px}.po-sheet-host:not(.po-preview-mode) .po-paper-meta{grid-template-columns:1fr;background:white;border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.po-sheet-host:not(.po-preview-mode) .po-paper-meta select{max-width:80%;font-size:17px}.po-sheet-host:not(.po-preview-mode) .po-paper-meta input{font-size:18px}.po-sheet-host:not(.po-preview-mode) .po-paper-title{min-height:0}.po-sheet-host:not(.po-preview-mode) .po-paper-meta>div{padding:12px}.po-sheet-host:not(.po-preview-mode) .po-paper-title h2{font-size:28px}}
@media(min-width:1001px) and (max-width:1500px){.po-paper{min-width:720px}.po-sheet-host{padding:14px}.po-catalog{top:110px}}
.purchase-editor-page{overflow-anchor:none}.po-workspace,.po-catalog,.po-sheet-host{overflow-anchor:none}
.content:has(.purchase-editor-page)>.tabs{display:none}.po-editor-bar .po-navigation{border:0;padding:0;margin:0;gap:6px}.po-editor-bar .po-navigation button{font-size:14px;min-height:44px;padding:8px 10px}.po-editor-bar>div:first-child{flex:1}.po-editor-bar>div:first-child>strong{font-size:15px}.po-editor-bar #poSavedStatus{font-size:14px}
.po-mobile-back,.po-quantity-control>button{display:none}.po-catalog-notice{max-height:100px;overflow:hidden}
@media(max-width:1000px){.po-editor-bar .po-navigation{display:none}.po-mobile-back{display:block}.po-editor-bar .purchase-actions>[data-act=poExcel],.po-editor-bar .purchase-actions>[data-act=poPng]{display:none}.po-editor-bar .purchase-actions button{min-height:52px;font-size:17px}.po-editor-bar>div:first-child>strong{font-size:16px}.po-editor-bar #poSavedStatus{font-size:14px;line-height:1.5}.po-mobile-tabs button{font-size:18px;min-height:52px}}
@media(max-width:650px){.po-sheet-host:not(.po-preview-mode) .po-data-row>td:nth-child(5),.po-sheet-host:not(.po-preview-mode) .po-data-row>td:nth-child(6){grid-column:1/-1}.po-sheet-host:not(.po-preview-mode) .po-quantity-control{display:flex;gap:10px}.po-sheet-host:not(.po-preview-mode) .po-quantity-control>button{display:block;min-width:56px;min-height:56px;font-size:26px}.po-sheet-host:not(.po-preview-mode) .po-quantity-control input{font-size:26px;font-weight:700;text-align:center}.po-config-fields textarea{font-size:18px}}
.po-bulk-toggle{display:none}
@media(max-width:1000px){.po-bulk-toggle{display:block;width:100%;min-height:50px;font-size:17px!important}.po-sheet-controls:not(.po-controls-open)>div{display:none}.po-workspace{scroll-margin-top:calc(var(--po-bar-height,150px) + 78px)}}
@media(max-width:650px){.po-sheet-host:not(.po-preview-mode) .po-paper-title{display:none}.po-sheet-host:not(.po-preview-mode) .po-paper-meta>div{padding:4px 10px}.po-sheet-host:not(.po-preview-mode) .po-paper-meta input,.po-sheet-host:not(.po-preview-mode) .po-paper-meta select{min-height:48px;padding:8px}}
.po-catalog-search{display:flex;gap:8px;min-width:0}.po-catalog-search input{flex:1;min-width:0}.po-search-toggle{display:none}
@media(max-width:1000px){.purchase-editor-page{min-height:calc(100dvh + 260px)}.po-search-toggle{display:block;min-width:54px;font-size:16px;padding:8px}.po-catalog-head .po-catalog-filters{display:none}.po-catalog-head.po-filters-open .po-catalog-filters{display:grid}.po-catalog-head>[data-act=poQuotePane]{display:none}.po-catalog-head h3{font-size:19px;margin-bottom:12px}.po-catalog-list{min-height:0}.po-catalog-bottom{flex-wrap:nowrap;padding:10px 14px;gap:8px}.po-catalog-bottom strong{font-size:14px;flex:1;min-width:0}.po-catalog-bottom button{font-size:16px;min-width:100px;padding:8px 10px}.po-catalog{min-height:0}}
@media(max-width:1000px){.po-catalog-list .po-catalog-item strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}}
.po-autosave{display:flex;align-items:center;gap:12px;padding:10px 0 16px;color:var(--muted);font-size:15px;flex-wrap:wrap}.po-autosave button{min-height:44px}.po-drafts{border:1px solid #bad5f1;background:#f1f7ff;padding:20px;border-radius:12px;margin:20px 0}.po-drafts>p{font-size:16px;line-height:1.7}.po-drafts .purchase-document{background:white;margin-top:12px}@media(max-width:650px){.po-drafts{padding:16px 12px}.po-autosave{font-size:15px;line-height:1.6}}@media print{.po-autosave{display:none!important}}
.po-name-cell textarea{overflow-y:hidden}
.po-sheet-host{position:relative}
/* Full-width purchase masters use tables on desktop and the same rows as mobile cards. */
.po-management-page .purchase-heading{align-items:flex-start}.po-management-page .purchase-heading h2{margin:0 0 8px;font-size:26px}.po-management-page .purchase-heading p{margin:0;font-size:16px;max-width:900px}
.po-management-page .po-manage-catalog{max-width:none;margin:0;background:#fff}.po-manage-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0}.po-manage-metrics button{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;text-align:left;border-radius:12px}.po-manage-metrics button[aria-pressed=true]{border-color:#7fb4e8;background:#eef6ff;color:#0755a3}.po-manage-metrics span{font-size:17px}.po-manage-metrics strong{font-size:28px}.po-manage-metrics small{font-size:16px;margin-left:6px;font-weight:400}
.po-manage-filters{display:grid;grid-template-columns:minmax(260px,2fr) minmax(180px,1fr) minmax(140px,.7fr);gap:18px;padding:22px;background:#fff}.po-manage-filters label,.po-manage-results-bar label{display:block;margin-bottom:7px;font-size:16px;font-weight:600}.po-manage-filters input,.po-manage-filters select{min-height:48px;font-size:16px}.po-manage-secondary{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;gap:14px;align-items:end}.po-manage-secondary button{min-height:48px;font-size:16px}
.po-manage-results-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;background:#f6f9fd;border-block:1px solid var(--line);padding:14px 22px}.po-manage-results-bar p{margin:0;font-size:16px;color:#43566e}.po-manage-results-bar>div{display:flex;align-items:center;gap:10px}.po-manage-results-bar label{white-space:nowrap;margin:0}.po-manage-results-bar select{width:160px;min-height:44px;font-size:16px}
.po-manage-table-wrap{position:relative;overflow:auto;max-height:calc(100dvh - 365px);min-height:320px;scrollbar-gutter:stable;overscroll-behavior:contain;overflow-anchor:none}.purchase-page .po-master-table{width:100%;min-width:1080px;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:16px}.purchase-page .po-master-table th,.purchase-page .po-master-table td{max-width:none;white-space:normal;text-align:left;padding:16px 18px;border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}.purchase-page .po-master-table th{position:sticky;top:0;z-index:2;background:#f3f6fa;font-size:16px;font-weight:700;color:#41536b;box-shadow:0 1px 0 var(--line)}.purchase-page .po-master-table td{line-height:1.65;background:white;font-size:16px}.po-master-table tr:hover td{background:#f7fbff}.po-master-table td>strong{display:block;font-size:17px}.po-master-table td>span:not(.tag),.po-master-table td>small{display:block;font-size:14px;color:#52637a;margin-top:4px;line-height:1.65}.po-master-table .po-master-name>strong{font-size:17px;line-height:1.7;color:#20344d}.po-master-table .po-master-price>strong{white-space:nowrap;color:#164f85;font-size:18px}.po-master-table .po-price-basis{display:inline-block!important;font-size:13px!important;padding:3px 7px;border-radius:5px;background:#edf5fc;color:#365e83!important}.po-master-table .po-price-estimated{background:#fff4db;color:#785112!important}.po-spec-text{font-variant-numeric:tabular-nums;font-weight:500}.po-master-actions{display:flex;gap:8px;flex-wrap:wrap}.po-master-actions button{font-size:15px;min-height:44px;padding:8px 12px}.po-master-table .po-archived-row td{background:#f7f8fa;color:#59697b}.po-master-table .tag{font-size:14px;white-space:nowrap}
.po-config-tabs{display:flex;gap:10px;margin:24px 0}.po-config-tabs button{min-width:140px;font-size:17px;min-height:48px}.po-config-tabs button[aria-pressed=true]{background:#e8f3ff;color:#0755a3;border-color:#9ec7ef}.po-category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.po-category-card,.po-supplier-management{border:1px solid var(--line);background:#fff;border-radius:12px;overflow:hidden}.po-category-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px;border-bottom:1px solid var(--line)}.po-category-heading h3{margin:0;font-size:20px}.po-category-heading h3>span{font-size:15px;color:var(--muted);font-weight:400;margin-left:10px}.po-category-heading button{font-size:16px;min-height:44px}.po-category-heading p{margin:5px 0 0;font-size:16px;color:var(--muted)}.po-category-card ul{list-style:none;margin:0;padding:0 22px;max-height:340px;overflow:auto}.po-category-card li{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:70px;padding:12px 0;border-bottom:1px solid var(--line)}.po-category-card li:last-child{border-bottom:0}.po-category-card li>div:first-child{min-width:0}.po-category-card li strong{display:block;font-size:17px;overflow-wrap:anywhere}.po-category-card li small{display:block;color:#607086;font-size:14px;margin-top:2px}.po-category-actions{display:flex;gap:8px;flex-shrink:0}.po-category-actions button{min-height:44px;font-size:15px;padding:8px 12px}.po-management-help{font-size:16px;color:#52637a;line-height:1.8;margin:22px 0}.po-supplier-management .po-manage-table-wrap{min-height:0;max-height:none}.purchase-page .po-supplier-table{min-width:850px}.po-document-delete{font-size:15px}
@media(min-width:1001px){.po-master-table th:first-child,.po-master-table td:first-child{padding-left:24px}.po-management-page{padding:28px}.po-master-actions{flex-direction:column;align-items:stretch}}
@media(max-width:1000px){.po-management-page .purchase-heading h2{font-size:24px}.po-management-page .purchase-heading>.primary{width:100%;margin-top:18px;font-size:18px;min-height:52px}.po-manage-metrics{gap:8px;margin:20px 0}.po-manage-metrics button{display:block;padding:14px 10px}.po-manage-metrics span{font-size:15px}.po-manage-metrics strong{display:block;font-size:25px;margin-top:4px}.po-manage-metrics small{font-size:14px}.po-manage-filters{grid-template-columns:1fr 1fr;gap:16px;padding:18px 14px}.po-manage-search{grid-column:1/-1}.po-manage-secondary{grid-template-columns:1fr 1fr;gap:16px}.po-manage-secondary>button{grid-column:1/-1}.po-manage-results-bar{padding:14px;flex-wrap:wrap}.po-manage-results-bar>div{margin-left:auto}.po-manage-results-bar select{width:145px}.po-manage-table-wrap{max-height:none;min-height:0;overflow:visible}.purchase-page .po-master-table,.po-master-table tbody{display:block;min-width:0;width:100%}.po-master-table colgroup,.po-master-table thead{display:none}.po-master-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 14px;padding:20px 16px;border-bottom:1px solid var(--line)}.purchase-page .po-master-table td{display:block;padding:0;border:0;background:transparent!important;font-size:17px;min-width:0}.po-master-table td:before{content:attr(data-label);display:block;color:#607086;font-size:14px;margin-bottom:5px}.po-master-table td:first-child{grid-column:1/-1}.po-master-table td:first-child:before{display:none}.po-master-table td:last-child{grid-column:1/-1}.po-master-table td:last-child:before{display:none}.po-master-table .po-master-name>strong{font-size:18px}.po-master-actions{display:flex;gap:12px;margin-top:4px}.po-master-actions button{flex:1;min-height:50px;font-size:17px}.po-category-grid{gap:18px}.po-category-heading{padding:18px 16px}.po-category-card ul{padding:0 16px}.po-category-card li{gap:8px}.po-category-actions{gap:6px}.po-category-actions button{padding:8px 10px;min-height:48px;font-size:16px}.po-document-delete{display:none}}
@media(max-width:700px){.po-category-grid{grid-template-columns:1fr}.po-config-tabs button{flex:1;min-width:0}.po-category-card li{min-height:78px}.po-category-card li strong{font-size:18px}.po-category-card ul{max-height:none}.po-supplier-management .po-category-heading{align-items:flex-start;flex-wrap:wrap}.po-supplier-management .po-category-heading button{width:100%;font-size:18px;min-height:52px}}
/* Compact paper proportions follow the original purchase form. Editing tools stay outside it. */
.po-recipient-control{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:16px}.po-recipient-control label{margin:0;white-space:nowrap}.po-recipient-control select{width:auto;max-width:320px;min-height:44px;font-size:16px}.po-recipient-control>span{white-space:nowrap}
.po-sheet-controls>.purchase-actions{justify-content:flex-start}.po-sheet-controls>.purchase-delivery{margin-left:auto}.po-row-manager{position:relative}.po-row-manager>summary{border:1px solid var(--line);border-radius:9px;background:#fff;min-height:44px;padding:9px 14px;font-size:16px;list-style:none}.po-row-manager>div{position:absolute;left:0;top:calc(100% + 8px);z-index:10;width:340px;max-width:calc(100vw - 60px);padding:18px;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 30px #233a5e20;background:#fff}.po-row-manager select{margin:8px 0 14px}.po-row-manager .purchase-actions{display:flex!important;flex-wrap:wrap}.po-row-manager .purchase-actions button{flex:1}
.po-compact-paper .po-paper-header{display:grid;grid-template-columns:minmax(0,1fr) 240px;min-height:48px;align-items:center;border-bottom:1px solid #111}.po-compact-paper .po-paper-header h2{font-size:23px;line-height:1.4;margin:0;padding:8px 18px;text-align:left}.purchase-page .po-compact-paper .po-paper-header input{font-size:18px;font-weight:700;min-height:44px;padding:6px 10px}
.purchase-page .po-compact-paper .po-paper-table th{font-size:16px;padding:8px 5px;background:#ddd;line-height:1.4}.purchase-page .po-compact-paper .po-paper-table td{line-height:1.4}.purchase-page .po-compact-paper input,.purchase-page .po-compact-paper textarea{min-height:36px;padding:6px 8px;font-size:16px;line-height:1.5}.purchase-page .po-compact-paper .po-name-cell textarea{min-height:32px;padding:6px 12px;font-weight:500;resize:none}.po-compact-paper .po-blank-row td{height:36px}.po-compact-paper td[data-po-column=qty] input,.po-compact-paper td[data-po-column=delivery] input{font-weight:700}.po-compact-paper td[data-po-column=delivery] input{background:transparent!important}.po-compact-paper .po-paper-notes{min-height:72px}.po-compact-paper .po-paper-notes label{font-size:17px;padding:10px}.purchase-page .po-compact-paper .po-paper-notes textarea{min-height:72px;padding:10px 14px}.po-compact-paper .po-paper-footer{min-height:72px;grid-template-columns:1fr 32%}.po-compact-paper .po-paper-footer>img{width:180px;max-width:75%;margin:10px 20px}.po-compact-paper .po-paper-footer>div>div{min-height:36px}.po-compact-paper .po-paper-footer strong,.po-compact-paper .po-paper-footer span{padding:6px 8px;font-size:15px}
@media(max-width:1000px){.po-recipient-control{flex-wrap:wrap}.po-recipient-control select{flex:1;max-width:none;min-height:50px;font-size:17px}.po-sheet-controls>.purchase-delivery{margin-left:0}.po-sheet-controls>.purchase-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.po-row-manager>summary{font-size:17px;min-height:48px;text-align:center}.po-row-manager>div{position:relative;left:auto;top:auto;width:auto;max-width:none;margin-top:10px}.po-row-manager{min-width:0}.po-compact-paper .po-paper-header h2{font-size:23px}}
@media(max-width:650px){.po-sheet-host:not(.po-preview-mode) .po-compact-paper .po-paper-header{grid-template-columns:1fr;min-height:48px;background:#fff;border:1px solid var(--line);border-radius:10px;margin-bottom:16px}.po-sheet-host:not(.po-preview-mode) .po-paper-header h2{display:none}.po-sheet-host:not(.po-preview-mode) .po-paper-header input{font-size:18px;min-height:50px}.po-sheet-host:not(.po-preview-mode) .po-data-row>td[data-po-column]{grid-column:1/-1}.po-sheet-host:not(.po-preview-mode) .po-data-row>td[data-po-column=brand],.po-sheet-host:not(.po-preview-mode) .po-data-row>td[data-po-column=flute]{grid-column:auto}.po-sheet-host:not(.po-preview-mode) .po-compact-paper input,.po-sheet-host:not(.po-preview-mode) .po-compact-paper textarea{font-size:18px;min-height:52px;padding:12px}.po-sheet-host:not(.po-preview-mode) .po-name-cell textarea{min-height:68px}.po-sheet-host:not(.po-preview-mode) td[data-po-column=qty] input{font-size:26px}.po-sheet-host:not(.po-preview-mode) td[data-po-column=delivery]{border-radius:8px;padding:8px}.po-recipient-control label{width:100%;font-size:16px}}

/* Keep each row action label together; wrap whole buttons on narrow screens. */
.po-row-manager .purchase-actions{gap:8px}.po-row-manager .purchase-actions button{flex:1 0 auto;min-width:64px;white-space:nowrap;word-break:keep-all;overflow-wrap:normal;padding:10px 12px}

.purchase-page .po-compact-paper .po-data-row textarea{box-sizing:border-box;display:block;margin:0;resize:none;overflow-y:hidden;min-height:36px;line-height:24px;padding:5px 12px}
@media(max-width:650px){.po-sheet-host:not(.po-preview-mode) .po-compact-paper .po-data-row textarea{min-height:68px;padding:12px;line-height:27px}}

.po-model-editor{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px;padding-right:5px}.po-model-editor:has(textarea:only-child){grid-template-columns:minmax(0,1fr);padding-right:0}.purchase-page .po-compact-paper .po-name-cell textarea{white-space:pre;overflow-wrap:normal;word-break:normal;overflow-x:auto;scrollbar-width:thin}.po-row-delete{font-size:13px!important;min-height:30px!important;padding:3px 6px!important;white-space:nowrap}.purchase-page .po-compact-paper td[data-po-column=brand] textarea{text-align:center;padding-left:5px;padding-right:5px;overflow-wrap:anywhere}
@media(max-width:650px){.po-sheet-host:not(.po-preview-mode) .po-paper{min-width:0!important}.po-row-delete{min-height:44px!important;padding:6px 8px!important}}
@media print{.po-row-delete{display:none!important}.po-model-editor{display:block}}
