.purchase-ad-hoc-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--border,#dce1e7);border-radius:22px;background:var(--surface,#fff);color:var(--text,#16212c);box-shadow:0 24px 90px #11182730;overflow:auto;overscroll-behavior:contain}
.purchase-ad-hoc-dialog::backdrop{background:#14203270;backdrop-filter:blur(5px)}
.purchase-ad-hoc-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:26px 28px 20px;border-bottom:1px solid #8796a326}
.purchase-ad-hoc-dialog header h2{margin:4px 0 8px;font-size:25px;letter-spacing:-.6px;overflow-wrap:anywhere}.purchase-ad-hoc-dialog header p{margin:0;color:#667582;font-size:13px}.purchase-ad-hoc-dialog header>button{flex:none;width:36px;height:36px;padding:0;border:1px solid #8796a340;border-radius:50%;font-size:25px;background:transparent;color:inherit}
.ad-hoc-sheet-body{padding:24px 28px 28px}.purchase-ad-hoc-dialog label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:600;min-width:0}.purchase-ad-hoc-dialog label small{font-weight:400;color:#697787;line-height:1.5}.purchase-ad-hoc-dialog input,.purchase-ad-hoc-dialog select,.purchase-ad-hoc-dialog textarea{box-sizing:border-box;display:block;min-width:0;width:100%;max-width:100%;padding:11px 12px;border:1px solid #a5b1bf80;border-radius:10px;font:inherit;font-weight:400;color:inherit;background:transparent;outline-offset:2px}.purchase-ad-hoc-dialog textarea{resize:vertical}.purchase-ad-hoc-dialog input:focus-visible,.purchase-ad-hoc-dialog textarea:focus-visible,.purchase-ad-hoc-dialog select:focus-visible,.purchase-ad-hoc-dialog button:focus-visible{outline:2px solid #287aeb}
.purchase-ad-hoc-dialog fieldset{padding:0;border:0;margin:0;display:grid;gap:20px;min-width:0}.purchase-ad-hoc-dialog fieldset:disabled{opacity:.75}.ad-hoc-field-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 20px}.ad-hoc-wide{grid-column:1/-1}.ad-hoc-save-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:22px}.ad-hoc-save-row span{font-size:12px;color:#667582}
.purchase-ad-hoc-dialog button{cursor:pointer;min-height:40px;padding:10px 14px;border:1px solid #8796a340;background:transparent;color:inherit;border-radius:10px;font:inherit;font-size:13px;font-weight:600}.purchase-ad-hoc-dialog button:disabled{opacity:.45;cursor:default}.purchase-ad-hoc-dialog .primary-button{background:#2876e8;border-color:#2876e8;color:#fff}.purchase-ad-hoc-dialog button:hover:not(:disabled){filter:brightness(.96);box-shadow:none;transform:none}
.ad-hoc-section{margin-top:28px;padding-top:24px;border-top:1px solid #8796a330}.ad-hoc-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}.ad-hoc-section-title h3{font-size:17px;margin:0}.ad-hoc-state{font-size:12px;font-weight:600;padding:6px 10px;border-radius:30px;background:#2c77e514;color:#276bca}.ad-hoc-budget-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.ad-hoc-budget-facts>div{display:grid;gap:8px;padding:12px;background:#8796a30c;border-radius:12px}.ad-hoc-budget-facts span{font-size:11px;line-height:1.5;color:#667582}.ad-hoc-budget-facts strong{font-size:15px;overflow-wrap:anywhere}.ad-hoc-hint{font-size:12px;line-height:1.6;color:#866019}.ad-hoc-actions{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-top:18px}.ad-hoc-actions label{flex:1;min-width:150px}.ad-hoc-notice,[data-recovery],[data-action-confirm]{padding:14px;margin:0 0 18px;background:#de9b1712;border:1px solid #d59b3140;border-radius:12px;font-size:13px;line-height:1.6}.purchase-ad-hoc-dialog [hidden]{display:none!important}[data-action-confirm]{margin:16px 0 0}[data-action-confirm] button,[data-recovery] button{margin:8px 8px 0 0}.ad-hoc-document{display:flex;width:100%;justify-content:space-between;align-items:center;gap:12px;text-align:left;margin-top:8px}.ad-hoc-document span{overflow-wrap:anywhere;min-width:0}.ad-hoc-document small{font-size:11px;color:#667582}
.purchase-kind-dialog{width:min(650px,calc(100vw - 32px))}.purchase-kind-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:26px}.purchase-kind-options button{display:flex;flex-direction:column;align-items:flex-start;gap:12px;text-align:left;padding:24px;border-radius:16px}.purchase-kind-options strong{font-size:19px}.purchase-kind-options span{font-weight:400;font-size:13px;line-height:1.6;color:#667582}
.purchase-dark .purchase-ad-hoc-dialog{background:#1e282f;color:#eef3f6;border-color:#52616c}.purchase-dark .purchase-ad-hoc-dialog :is(header p,label small,.ad-hoc-save-row span,.ad-hoc-budget-facts span,.ad-hoc-document small,.purchase-kind-options span){color:#b5c1cb}.purchase-dark .ad-hoc-state{color:#9fc6ff}.purchase-dark .ad-hoc-hint{color:#e6bd79}
@media(max-width:560px){.purchase-ad-hoc-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:18px}.purchase-ad-hoc-dialog header{padding:20px 18px 16px}.ad-hoc-sheet-body{padding:20px 18px}.ad-hoc-field-grid{grid-template-columns:minmax(0,1fr);gap:16px}.purchase-kind-options{grid-template-columns:minmax(0,1fr);padding:18px}.ad-hoc-budget-facts{grid-template-columns:minmax(0,1fr)}.ad-hoc-document{align-items:start;flex-direction:column}.ad-hoc-save-row button{width:100%}}
.ad-hoc-extra{border-top:1px solid #8796a330;border-bottom:1px solid #8796a330;padding:14px 0}.ad-hoc-extra summary{cursor:pointer;font-size:13px;font-weight:600}.ad-hoc-extra summary small{display:block;margin:5px 0 0;font-weight:400;color:#71808d}.ad-hoc-extra[open]>.ad-hoc-field-grid{margin-top:18px}

/* Shared order rhythm: fixed identity, compact sections, one clear document entry. */
.purchase-ad-hoc-dialog{--ad-hoc-surface:var(--surface,#fff);width:min(880px,calc(100vw - 40px));scrollbar-gutter:stable;isolation:isolate}
.purchase-ad-hoc-dialog>header{position:sticky;top:0;z-index:2;background:var(--ad-hoc-surface);padding:24px 28px 20px}
.purchase-ad-hoc-dialog header>div{min-width:0}.purchase-ad-hoc-dialog header h2{overflow-wrap:anywhere;font-size:24px;line-height:1.3;letter-spacing:-.5px}
.purchase-ad-hoc-dialog header>button{flex:none;width:44px;height:44px;padding:0;font-size:24px;border-color:transparent;background:#8796a310}
.ad-hoc-tabs{display:flex;gap:6px;padding:5px;background:#8796a310;border-radius:13px;margin-bottom:24px}
.ad-hoc-tabs button{flex:1;min-height:44px;border:0;background:transparent;font-size:14px;color:inherit}
.ad-hoc-tabs button[aria-pressed=true]{background:var(--ad-hoc-surface);box-shadow:0 1px 5px #10182015}
.ad-hoc-tabs button span{font-size:11px;font-variant-numeric:tabular-nums;opacity:.7;margin-left:5px}
.ad-hoc-cost-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 110px;gap:18px 20px}
.ad-hoc-total{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px;border-radius:13px;background:#2876e80a}
.ad-hoc-total>span{font-size:14px;font-weight:600}.ad-hoc-total small{display:block;font-size:12px;font-weight:400;color:#667582;margin-top:5px}
.ad-hoc-total output{font-size:23px;font-weight:650;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;text-align:right}
.ad-hoc-document-panel{min-height:240px}.ad-hoc-document-panel h3{font-size:18px;margin:0}
.ad-hoc-document-panel p,.ad-hoc-document-hint{font-size:13px;line-height:1.6;color:#667582}.ad-hoc-document-hint{display:block;margin-top:22px}
.ad-hoc-document{min-height:64px!important;padding:14px 16px!important;transition:background .15s ease}.ad-hoc-document:hover{background:#8796a30a!important}
.ad-hoc-document span{font-size:14px}.ad-hoc-document small{white-space:nowrap}
.ad-hoc-delete-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:28px;padding-top:20px;border-top:1px solid #8796a326}
.purchase-ad-hoc-dialog button.ad-hoc-delete{color:#bc3434;min-height:44px;border-color:#bc343425;background:#bc343406}
.ad-hoc-delete-row small{color:#667582;font-size:12px;line-height:1.5}.purchase-ad-hoc-dialog [data-action-confirm]{scroll-margin-top:145px}
.purchase-dark .purchase-ad-hoc-dialog{--ad-hoc-surface:#1e282f}.purchase-dark .ad-hoc-total small,.purchase-dark .ad-hoc-document-panel p,.purchase-dark .ad-hoc-document-hint,.purchase-dark .ad-hoc-delete-row small{color:#b5c1cb}
.purchase-dark .purchase-ad-hoc-dialog button.ad-hoc-delete{color:#ffaaa3;border-color:#ffaaa330}
@media(max-width:560px){.purchase-ad-hoc-dialog :is(input,select,textarea){font-size:16px;min-height:44px}.ad-hoc-cost-grid{grid-template-columns:minmax(0,1fr)}.ad-hoc-tabs button{white-space:nowrap;font-size:13px;padding-inline:8px}.ad-hoc-tabs button span{margin-left:3px}}
@media(max-width:560px){.purchase-ad-hoc-dialog{width:calc(100vw - 16px)}.purchase-ad-hoc-dialog>header{padding:18px}.purchase-ad-hoc-dialog header h2{font-size:21px}.ad-hoc-total{padding:16px}.ad-hoc-total output{font-size:20px}.ad-hoc-tabs{margin-bottom:20px}.ad-hoc-delete-row{align-items:start;flex-direction:column}.ad-hoc-section-title [data-upload]{width:100%;min-height:44px}.ad-hoc-budget-facts{grid-template-columns:1fr}.ad-hoc-actions button{min-height:44px}}
