/* peter-workbench-layout-v3: existing ERP shell, one title, local task controls. */
/* report-controls-refined-v1: only the exact Peter renderer adds this scope. */
@media screen {
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-controls { grid-template-columns:minmax(0,1fr); gap:16px; }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-field-list { gap:12px; }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-quick-grid {
    grid-column:1/-1; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px;
    padding:3px; border-radius:var(--gc-ui-control-radius,10px); background:var(--bg-secondary,#f0f0f3);
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-quick-grid .gc-rpt-btn {
    box-sizing:border-box; min-width:0; height:30px; min-height:30px; padding:0 2px;
    border:1px solid transparent; border-radius:7px; background:transparent; color:var(--ink,#1d1d1f);
    font:500 13px/1.3 var(--font-sans); white-space:nowrap; box-shadow:none;
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-quick-grid .gc-rpt-btn:hover { background:var(--bg-hover,#f9f9fb); }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-quick-grid .gc-rpt-btn[aria-pressed="true"] {
    background:var(--bg-elevated,#fff); border-color:var(--line,#e5e5ea); color:var(--apple-blue,#007aff); font-weight:600;
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-action-grid {
    grid-template-columns:minmax(0,1fr); gap:8px; padding-top:8px; border-top:1px solid var(--line,#e5e5ea);
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-action-grid .gc-rpt-btn {
    box-sizing:border-box; min-width:0; height:var(--gc-ui-field-height,36px); min-height:var(--gc-ui-field-height,36px);
    border-radius:var(--gc-ui-control-radius,10px); white-space:nowrap; font:600 13px/1.3 var(--font-sans);
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined #gcRptExcel {
    justify-self:end; width:auto; padding:0 4px; border-color:transparent; background:transparent; color:var(--ink-mute,#6e6e73); font-weight:400;
  }
  html body #gcSalesReportPreview .gc-rpt-controls-refined #gcRptExcel:hover { color:var(--apple-blue,#007aff); background:var(--bg-hover,#f9f9fb); }
  html body #gcSalesReportPreview .gc-rpt-controls-refined #gcRptPdf { width:100%; background:var(--apple-blue,#007aff); border-color:var(--apple-blue,#007aff); color:#fff; }
  html body #gcSalesReportPreview .gc-rpt-controls-refined #gcRptPdf:hover { background:var(--apple-blue-hover,#0051d5); }
  html body #gcSalesReportPreview .gc-rpt-controls-refined .gc-rpt-btn:focus-visible { outline:2px solid var(--apple-blue,#007aff); outline-offset:2px; }
}
@media screen {
  html body.gc-wb-layout-v3 #gcAdminPageHead {
    display:flex!important; flex:0 0 40px; min-height:40px; height:40px;
    align-items:center; gap:12px; padding:0 24px!important; box-sizing:border-box;
  }
  html body.gc-wb-layout-v3 .gc-admin-page-breadcrumb { display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; }
  html body.gc-wb-layout-v3 #gcAdminPageTitle { font:600 14px/1.4 var(--font-sans); overflow:hidden; text-overflow:ellipsis; }
  html body.gc-wb-layout-v3 #gcWorkbenchParent { display:inline-flex; align-items:center; gap:8px; color:var(--ink-mute); }
  html body.gc-wb-layout-v3 #gcWorkbenchParent button { border:0; background:transparent; color:var(--ink-mute); padding:0; min-height:36px; font:400 13px/1.4 var(--font-sans); cursor:pointer; }
  html body.gc-wb-layout-v3 #gcWorkbenchParent button:hover { color:var(--apple-blue); }
  html body.gc-wb-layout-v3 :is(.gc-workbench-tool-header,.gq-toolbar) { display:none!important; }
  html body.gc-wb-layout-v3 #gcWorkbenchSelect { height:32px; min-height:32px; font:600 13px/1.4 var(--font-sans); }
  html body.gc-wb-layout-v3.gc-wb-overlay-active main#main > * { visibility:hidden; pointer-events:none; }
  html body.gc-wb-layout-v3 :is(#gcSalesReportPreview,#updateBackdrop).gc-wb-embedded {
    position:fixed!important; inset:auto!important; left:var(--wb-left,0px)!important; top:var(--wb-top,44px)!important;
    width:var(--wb-width,100%)!important; height:var(--wb-height,calc(100% - 44px))!important; max-width:none!important;
    padding:0!important; margin:0!important; z-index:100!important;
    background:var(--bg-elevated)!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
    border:1px solid var(--line); border-radius:var(--gc-ui-container-radius); box-sizing:border-box; overflow:hidden;
    align-items:stretch!important; justify-content:stretch!important;
  }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded > * {
    width:100%!important; max-width:none!important; height:100%!important; max-height:none!important; min-height:0;
    margin:0!important; border:0!important; border-radius:0!important; box-shadow:none!important; transform:none!important;
    display:flex; flex-direction:column;
  }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .modal-header { display:none!important; }
  /* Match the existing Peter operation-dialog cascade without changing other dialogs. */
  html body.gc-wb-layout-v3.peter-ledger-action-pilot-v1 #updateBackdrop.gc-form-dialog-frame.gc-wb-embedded:not(.feedback-drawer):not(.peter-ai-open) {
    padding:0!important; background:var(--bg-elevated)!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
  }
  html body.gc-wb-layout-v3.peter-ledger-action-pilot-v1 #updateBackdrop.gc-form-dialog-frame.gc-wb-embedded:not(.feedback-drawer):not(.peter-ai-open) > .modal {
    display:flex!important; flex-direction:column; width:100%!important; max-width:none!important; height:100%!important; max-height:none!important;
    border:0!important; border-radius:0!important; box-shadow:none!important; background:var(--bg-elevated)!important;
  }
  html body.gc-wb-layout-v3.peter-ledger-action-pilot-v1 #updateBackdrop.gc-form-dialog-frame.gc-wb-embedded:not(.feedback-drawer):not(.peter-ai-open) > .modal > .modal-header { display:none!important; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded #updateBody { flex:1 1 0; min-height:0; overflow:auto; padding:16px!important; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded #updateFooter { flex:0 0 auto; padding:8px 16px!important; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .po-import-demo { display:grid; grid-template-columns:minmax(220px,300px) minmax(0,1fr); gap:12px 20px; align-items:start; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .po-import-demo > :is(.po-import-demo-help,.po-import-upload,.po-import-actions,.po-import-file-list) { grid-column:1; margin:0; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded #poImportDemoPreview { grid-column:2; grid-row:1 / span 5; min-width:0; overflow:auto; min-height:200px; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .po-import-demo-help { font-size:12px; font-weight:400; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-shell { grid-template-columns:220px minmax(0,1fr); height:100%; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded :is(#gcRptClose,.gc-rpt-topbar-title strong) { display:none!important; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-topbar { min-width:0; padding:12px; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-stage { min-width:0; overflow:auto; padding:16px; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-template-panel .pet-mail-panel-titlebar > div > span { display:none; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-template { min-height:42px!important; padding:8px!important; margin-bottom:4px!important; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-template-icon { width:26px!important; height:26px!important; border-radius:6px!important; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-template-icon svg { width:16px!important; height:16px!important; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-compose-bar { display:flex; flex-wrap:nowrap; justify-content:space-between; gap:8px; padding:8px 12px; min-height:52px; overflow:visible; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-compose-title { min-width:0; flex:1 1 auto; gap:6px; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-compose-title > span { display:none; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-compose-title b { font-size:13px; white-space:nowrap; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-actions { flex:0 0 auto; flex-wrap:nowrap; gap:6px; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-actions > button { padding:0 10px; white-space:nowrap; }
  html body.gc-wb-layout-v3 #petMailPage:not(.pet-mail-sent-archive-open) .pet-mail-preview-caption { display:none; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-preview-stage { padding-top:12px; }
  html body.gc-wb-layout-v3 .gc-wb-more { position:relative; flex:0 0 auto; }
  html body.gc-wb-layout-v3 .gc-wb-more > summary { list-style:none; height:36px; padding:0 10px; display:flex; align-items:center; cursor:pointer; border:1px solid var(--line); border-radius:8px; background:var(--bg-elevated); font:600 13px/1.4 var(--font-sans); box-sizing:border-box; }
  html body.gc-wb-layout-v3 .gc-wb-more > summary::-webkit-details-marker { display:none; }
  html body.gc-wb-layout-v3 .gc-wb-more-items { position:absolute; right:0; top:calc(100% + 4px); z-index:200; min-width:180px; padding:6px; border:1px solid var(--line); border-radius:10px; background:var(--bg-elevated); box-shadow:var(--shadow-md); display:flex; flex-direction:column; gap:2px; }
  html body.gc-wb-layout-v3 #petMailPage .gc-wb-more-items > button { width:100%; text-align:left; justify-content:flex-start; border:0; background:transparent; min-height:36px; }
  html body.gc-wb-layout-v3 #petMailPage .gc-wb-more-items > button:hover { background:var(--bg-hover); }
  html body.gc-wb-layout-v3 #petMailPage .gc-wb-more-items > #petMailClear { border-top:1px solid var(--line); border-radius:0; color:var(--danger,#c93434); }
  html body.gc-wb-layout-v3 .gq-editor-content { grid-template-columns:minmax(0,1fr); }
  html body.gc-wb-layout-v3 .gq-reference { border:0; border-bottom:1px solid var(--line); padding:10px 16px; display:flex; align-items:flex-start; gap:16px; overflow:visible; }
  html body.gc-wb-layout-v3 .gq-reference .gq-photos { flex:0 0 156px; width:156px; margin:0; gap:6px; }
  html body.gc-wb-layout-v3 .gq-reference .gq-photos > :is(a,div) { height:64px; }
  html body.gc-wb-layout-v3 .gc-wb-reference-details { flex:1; min-width:0; }
  html body.gc-wb-layout-v3 .gc-wb-reference-details summary { display:list-item; cursor:pointer; color:var(--apple-blue); font:500 13px/1.4 var(--font-sans); padding:8px 0; min-height:20px; }
  html body.gc-wb-layout-v3 .gc-wb-reference-details .gq-fabrics { max-height:240px; height:auto!important; overflow:auto; font-size:13px; }
  html body.gc-wb-layout-v3 .gq-editor-content { display:flex; flex-direction:column; }
  html body.gc-wb-layout-v3 .gq-reference { flex:0 0 auto; }
  html body.gc-wb-layout-v3 .gq-editor-scroll { flex:1 1 0; min-height:0; }
}
@media screen and (min-width:1501px) { html body.gc-wb-layout-v3 #gcWorkbenchSelect { display:none; } }
@media screen and (max-width:1100px) {
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-shell:not(.templates-collapsed):not(.selection-collapsed):not(.manual-fabric-no-selection) { grid-template-columns:150px 250px minmax(0,1fr); }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-compose-bar { flex-wrap:wrap; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-actions { margin-left:auto; }
}
@media screen and (max-width:900px) {
  html body.gc-wb-layout-v3 #gcAdminPageHead { padding:0 18px!important; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-shell { display:flex; flex-direction:column; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-topbar { max-height:230px; flex:0 0 auto; overflow:auto; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-field-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-field :is(input,select) { min-width:0; width:100%; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-controls { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-field-list { grid-column:1/-1; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-stage { flex:1 1 0; }
}
@media screen and (max-width:720px) {
  html body.gc-wb-layout-v3 #gcAdminPageHead { height:44px; min-height:44px; flex-basis:44px; padding:0 12px!important; gap:6px; }
  html body.gc-wb-layout-v3 #gcAdminPageHead .gc-admin-page-head-separator { display:none; }
  html body.gc-wb-layout-v3 #gcWorkbenchParent button { min-height:44px; }
  html body.gc-wb-layout-v3 #gcWorkbenchSelect { height:44px; min-height:44px; }
  html body.gc-wb-layout-v3 #petMailPage .pet-mail-actions { flex-wrap:wrap; }
  html body.gc-wb-layout-v3 .gc-wb-more > summary { height:44px; }
  html body.gc-wb-layout-v3 #petMailPage .gc-wb-more-items > button { min-height:44px; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .po-import-demo { display:flex; flex-direction:column; gap:12px; }
  html body.gc-wb-layout-v3 #updateBackdrop.gc-wb-embedded .po-import-demo > * { width:100%; box-sizing:border-box; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-field-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-topbar { max-height:280px; }
  html body.gc-wb-layout-v3 .gq-reference { gap:12px; }
}
@media screen and (max-width:900px) {
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-controls-refined .gc-rpt-controls { grid-template-columns:minmax(0,1fr); gap:12px; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-controls-refined .gc-rpt-field-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-controls-refined .gc-rpt-field-list > :is(:first-child,:last-child) { grid-column:1/-1; }
  html body.gc-wb-layout-v3 #gcSalesReportPreview.gc-wb-embedded .gc-rpt-controls-refined .gc-rpt-topbar { max-height:min(360px,50vh); }
}
@media screen and (max-width:720px) {
  html body #gcSalesReportPreview .gc-rpt-controls-refined :is(.gc-rpt-quick-grid,.gc-rpt-action-grid) .gc-rpt-btn { height:var(--gc-ui-touch-target-height,44px); min-height:var(--gc-ui-touch-target-height,44px); }
}
