/* Confirmed fullscreen document and structured customs workspace. */
body.jw-approved-design #modal.aw-fullscreen{position:fixed!important;inset:0!important;margin:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;min-width:0!important;border:0;border-radius:0!important;resize:none!important;padding:0!important}
#modal.aw-fullscreen #modalBody{height:100%;display:flex;flex-direction:column;min-height:0}
#modal.aw-fullscreen .dialog-head{height:58px;min-height:58px;display:flex;align-items:center;padding:8px 16px;gap:12px;border-bottom:1px solid #dce7f3;background:#fff}
#modal.aw-fullscreen .dialog-head h2{font-size:18px;line-height:26px;white-space:nowrap;margin:0}
#modal.aw-fullscreen .dialog-head>[data-close]{flex:none}
#modal.aw-fullscreen .dialog-actions{display:none}
#modal.aw-fullscreen .dialog-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;max-height:none!important;padding:0!important;gap:0!important}
#awToolbar{display:flex;align-items:center;gap:12px;flex:1;min-width:0}#awToolbar>label{display:flex;flex-direction:row;align-items:center;gap:6px;white-space:nowrap}#awToolbar select{min-width:96px;width:auto}#awToolbar .aw-toolbar-fill{flex:1}.aw-check{display:flex!important;flex-direction:row!important;align-items:center;gap:6px!important}.aw-check input{width:16px!important;min-height:16px!important;height:16px!important}
#awNotice{padding:8px 16px;background:#fff7e7;color:#9a5b00;border-bottom:1px solid #f9dc9e;display:flex;align-items:center;gap:10px;font-size:13px}#awNotice[hidden]{display:none}
.aw-preview-work{display:flex;flex:1;min-height:0;min-width:0;background:#e4ebf3}#awPaperHost{flex:1;min-width:0;min-height:0;overflow:auto;padding:12px 18px;position:relative;overscroll-behavior:contain}.aw-paper-page{margin:0 auto 18px;background:#fff;box-shadow:0 2px 14px #18365025}.aw-paper-page canvas{display:block;max-width:none}
#awSettings{width:360px;flex:none;background:white;border-left:1px solid #dce7f3;padding:14px;overflow:auto;display:flex;flex-direction:column;gap:12px}#awSettings[hidden]{display:none}#awSettings header{display:flex;justify-content:space-between;align-items:center}#awSettings h2{font-size:16px}#awSettings nav{display:flex;border-bottom:1px solid #dce7f3}#awSettings nav button{flex:1;border:0;border-radius:0}#awSettings nav button.active{color:#1265ff;border-bottom:2px solid #1265ff}#awSettings section{border-bottom:1px solid #dce7f3;padding:0 0 12px}#awSettings h3{font-size:14px;margin:8px 0 12px}#awSettings label{display:flex;flex-direction:column;gap:4px;margin:10px 0}#awSettings label:not(.aw-check)>input{width:100%}#awSettings p{font-size:12px;color:#647b9c;margin:8px 0}#awSettings .aw-logo-preview{width:130px;max-height:85px;object-fit:contain}#awSettings .aw-sign-preview{max-width:180px;max-height:70px;object-fit:contain}#awSettings .aw-settings-actions{display:flex;gap:8px;margin-top:auto}.aw-preview-bottom{height:48px;min-height:48px;display:flex;align-items:center;justify-content:center;gap:16px;border-top:1px solid #dce7f3;background:white;font-size:13px}.aw-preview-bottom select{width:130px!important}.aw-preview-bottom #awProgress{position:absolute;left:16px;color:#647b9c;font-size:12px}
.aw-column-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.aw-column-choices label{display:flex;flex-direction:row;align-items:center;gap:8px}.aw-column-choices input{width:16px!important}
#jdEditor .aw-hs-col{width:135px}#jdEditor .aw-hs label>span{display:none}#jdEditor .aw-hs .link{padding:2px!important;height:22px;min-height:22px;font-size:12px}#jdEditor .jd-contract>[data-aw-contract-preview]{margin-top:12px}.jd-product-table [hidden]{display:none!important}
.aw-customs-form{background:#fff;padding:4px 0 12px;min-width:0}.aw-customs-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.aw-customs-grid>label{font-size:13px;line-height:18px;margin:0;min-width:0}.aw-customs-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;padding-top:12px;margin-top:12px;border-top:1px solid #e1eaf5}.aw-customs-extra{margin-top:12px;border:0;padding:0}.aw-customs-extra[open]>summary{margin-bottom:12px}.aw-customs-form input,.aw-customs-form select{width:100%;height:32px!important;min-height:32px!important}.aw-customs-form details{background:white}.jw-declaration-layout .compact-editor>.tabs{margin-bottom:12px}.jw-declaration-layout .compact-editor>details,.jw-declaration-layout .compact-editor>p{margin:8px 0}.jw-declaration-layout .decl-product-table td{vertical-align:middle;padding:6px!important}.jw-declaration-layout .decl-product-table label{font-size:12px}.jw-declaration-layout .decl-product-table input{height:32px!important;min-height:32px!important}.jd-decl-drawer{width:350px!important}body.jd-decl-drawer-open .content{padding-right:364px!important}.jd-decl-drawer .decl-elements-summary{padding:0!important}.jd-decl-drawer .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.jd-decl-drawer input,.jd-decl-drawer select{width:100%}
#awHSForm{display:flex;gap:8px;align-items:end}#awHSForm>label{flex:1}.aw-hs-result{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #e1eaf5}.aw-hs-result span{flex:1}.aw-hs-result small{display:block;font-size:12px;color:#647b9c}
body.jw-approved-design .actions-cell{overflow:visible}body.jw-approved-design .action-menu[open]{position:relative;z-index:90}body.jw-approved-design .action-menu-items{z-index:100;min-width:200px;white-space:normal;max-width:min(360px,80vw)}body.jw-approved-design .action-menu-items button{white-space:normal;text-align:left;width:100%;height:auto}
@media(max-width:1100px){#modal.aw-fullscreen .dialog-head{height:auto;min-height:58px;flex-wrap:wrap}#awToolbar{order:3;flex-basis:100%;flex-wrap:wrap;gap:8px}#awSettings{width:320px}.aw-customs-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.aw-customs-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.aw-preview-bottom #awProgress{position:static}}
@media(max-width:700px){#awSettings{position:absolute;right:0;top:110px;bottom:48px;width:min(360px,100vw);z-index:4;box-shadow:-5px 0 20px #18365033}.aw-customs-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.aw-customs-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.aw-preview-bottom{gap:8px}.aw-preview-bottom #awProgress{display:none}.aw-preview-bottom select{width:120px!important}body.jd-decl-drawer-open .content{padding-right:8px!important}.jd-decl-drawer{width:100%!important}.aw-column-choices{grid-template-columns:1fr}}
/* One vertical scrolling surface per workspace child; horizontal tables must not trap the wheel. */
body.jw-workspace-child{height:100dvh;overflow:hidden!important}
body.jw-workspace-child #root,body.jw-workspace-child #root>.app{height:100%;min-height:0}
body.jw-workspace-child #root>.app>.main{height:100dvh;min-height:0;overflow-y:auto!important;overflow-x:hidden;overscroll-behavior-y:auto;scrollbar-gutter:stable}
body.jw-workspace-child .main>.content{overflow:visible!important;height:auto!important;min-height:100%;touch-action:pan-y}
body.jw-workspace-child .table-scroll,body.jw-workspace-child .jd-table-scroll{overscroll-behavior-y:auto!important;touch-action:pan-x pan-y}
body>.aw-menu-portal{display:flex!important;flex-direction:column!important;gap:4px;padding:8px;background:white;border:1px solid #dce7f3;border-radius:4px;box-shadow:0 5px 18px #18365025;white-space:normal}body>.aw-menu-portal button{display:flex;width:100%;text-align:left;justify-content:flex-start;white-space:normal;height:auto}
.dg-process-config{padding:12px;border:1px solid #dce7f3;border-radius:4px}.dg-process-config h3{margin:0;font-size:14px}.dg-process-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(70px,1fr) minmax(90px,1fr) auto;align-items:end;gap:10px;margin-top:10px}.dg-process-row label{margin:0!important;min-width:0}.dg-process-row input{width:100%}.aw-drop-zone{border:1px dashed #8eb6ef;border-radius:4px;padding:14px;background:#f7fbff;outline-offset:2px}.aw-drop-zone:focus,.aw-drag-over{outline:2px solid #1265ff!important;background:#e8f2ff!important}.aw-drop-zone p{font-size:12px;color:#647b9c;margin:6px 0}.aw-drop-zone input{max-width:100%}.aw-drop-zone [role=status]{display:block;font-size:12px;color:#315a90;margin-top:8px}#jdEditor .jd-image:focus{outline:2px solid #1265ff;outline-offset:-2px}
@media(max-width:600px){.dg-process-row{grid-template-columns:minmax(0,1fr) 70px 90px}.dg-process-row>button{grid-column:1/-1;justify-self:end}}

#awNotice{max-height:90px;overflow:auto;flex-shrink:0}#awNotice>span{flex:1;min-width:0}#awNotice>button{flex-shrink:0}

/* Compact profit editor: one wide input column and a result strip visible while scrolling. */
.profit-glance{position:sticky;top:0;z-index:12;display:grid;grid-template-columns:1.3fr repeat(4,minmax(0,1fr));gap:10px;padding:12px 16px;margin-bottom:12px;background:#fff;border:1px solid #cddff2;border-radius:6px;box-shadow:0 2px 8px #17345112}
.profit-glance span{display:block;font-size:12px;color:#647b9c}.profit-glance strong{font-size:19px;color:#173451;white-space:nowrap}.profit-glance-main strong{font-size:26px;color:#176444}.profit-glance .negative{color:#bd3c35}.profit-glance small{grid-column:1/-1;color:#866021;font-size:11px}
body .profit-edit-layout,body.jw-layout-clean .profit-edit-layout{grid-template-columns:minmax(0,1fr)!important;gap:10px}
.profit-inputs>.surface{padding:14px 16px;margin-bottom:10px}.profit-inputs .section-head{margin-bottom:8px}.profit-inputs .form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.profit-inputs label{margin-bottom:4px}.profit-secondary{margin:6px 0;font-size:12px}.profit-secondary>summary,.profit-results>summary{cursor:pointer;color:#526b8e;padding:6px 0}.profit-secondary:not([open]){border-top:1px solid #edf1f6}.profit-secondary .pf-freight-reference{padding:10px;margin:6px 0}.profit-inputs .form-hint{margin:5px 0;font-size:11px}.profit-edit-layout>.profit-results{position:static;padding:10px 16px;margin:0 0 70px}.profit-results dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 20px}
@media(min-width:701px){.profit-cost-table{table-layout:fixed;min-width:0!important;width:100%}.profit-cost-table th,.profit-cost-table td{min-width:0!important;white-space:normal;padding:7px!important}.profit-cost-table th:nth-child(1){width:24%}.profit-cost-table th:nth-child(2){width:6%}.profit-cost-table th:nth-child(3){width:21%}.profit-cost-table th:nth-child(4){width:14%}.profit-cost-table th:nth-child(5),.profit-cost-table th:nth-child(6){width:9%}.profit-cost-table th:nth-child(7){width:17%}.profit-cost-table input,.profit-cost-table select,.profit-cost-table .jw-select{min-width:0;width:100%;max-width:100%}.profit-cost-table .jw-select-button{min-width:0!important;white-space:normal!important}.profit-inputs .table-scroll{max-width:100%}}
@media(max-width:700px){.profit-glance{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}.profit-glance>div:nth-child(n+3){display:none}.profit-inputs .form-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}.profit-results dl{grid-template-columns:1fr}.profit-glance strong{font-size:22px}}
.profit-secondary .pf-freight-reason textarea{min-height:36px;height:36px}.profit-secondary .pf-freight-heading{margin-bottom:6px}.profit-secondary .pf-freight-values strong{margin:3px 0}

body .profit-inputs>.surface:first-child{min-height:0!important;height:auto!important}.profit-info-actions{gap:6px;flex-wrap:wrap}.profit-info-actions button{min-height:30px!important;padding:4px 10px!important;font-size:12px!important}.profit-info-actions .profit-warning{color:#9a5b00!important}
