/* Data workspaces keep their controls outside independently scrollable tables. */
@media screen {
  body.myschedule:is([data-surface="editor"],[data-surface="reports"]){grid-template-rows:54px minmax(0,1fr) 22px}
  .myschedule:is([data-surface="editor"],[data-surface="reports"]) .app-header{height:54px}
  .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace main{padding:12px 16px 8px;gap:8px;min-width:0}
  .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace-caption{min-height:44px;flex:none;padding-bottom:0!important;min-width:0}
  .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace-caption>div{min-width:0}
  .myschedule #editor-view,.myschedule #reports-view{min-width:0;min-height:0;isolation:isolate}
  .myschedule #editor-view>.native-editor-toolbar{flex:none;flex-wrap:nowrap;align-items:center;min-height:46px;padding:7px 12px;gap:6px}
  .myschedule .mys-editor-undo{display:flex;gap:4px}
  .myschedule .mys-editor-undo button{width:31px;padding:5px;font-size:15px}
  .myschedule #editor-view>.native-editor-toolbar>#editor-selection-status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .myschedule .mys-workspace-menu-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
  .myschedule #editor-view .editor-pane{min-width:0;min-height:0}
  .myschedule :is(#orders-view,#resources-view)>.pane-heading{display:none}
  .myschedule :is(#orders-view,#resources-view)>.panel-toolbar{min-width:0;min-height:46px;padding:7px 12px}
  .myschedule #order-search{width:min(360px,100%);min-width:0;flex:1;height:32px}
  .myschedule #order-count{font-size:11px;color:var(--muted);white-space:nowrap}
  .myschedule :is(#orders-view,#resources-view)>.panel-toolbar>[data-command]{display:none}
  .myschedule #resources-view>.panel-toolbar>span{min-width:0;overflow-wrap:anywhere;line-height:1.5}
  .myschedule #editor-view .table-scroll,.myschedule #reports-view>.table-scroll{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .myschedule :is(#orders-view,#resources-view)>.table-scroll>table{min-width:960px}
  .myschedule #master-view>.panel-toolbar{display:grid;grid-template-columns:minmax(90px,1fr) minmax(180px,320px) auto;min-width:0;padding:8px 12px;gap:10px}
  .myschedule #master-view #master-search{width:100%;min-width:0;height:32px}
  .myschedule #master-title{overflow-wrap:anywhere;font-size:12px}
  .myschedule #master-view>.table-scroll>table{min-width:100%;width:100%}
  .myschedule #master-view[data-kind="products"]>.table-scroll>table{min-width:1100px}
  .myschedule #master-route-preview{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
  .myschedule #master-route-preview .pane-heading{position:sticky;top:0;left:0;z-index:4;min-width:0;gap:8px;background:white}
  .myschedule #master-route-preview .table-scroll{overflow:visible}
  .myschedule #master-route-preview table{min-width:950px}
  .myschedule #secondary-view .dataset-json{min-height:0;resize:none;overflow:auto;border-radius:0}
  .myschedule #secondary-view .editor-note{flex:none;overflow-wrap:anywhere;line-height:1.5;margin:8px 12px}
  .myschedule .mys-subnav{min-width:0;max-width:100%;gap:4px;scrollbar-width:thin}
  .myschedule .mys-subnav button{flex:none;white-space:nowrap}
  .myschedule #reports-view>.pane-heading{display:none}
  .myschedule #reports-view>.panel-toolbar{display:grid;grid-template-columns:minmax(200px,1.2fr) minmax(140px,1fr) auto auto;min-width:0;padding:8px 12px;gap:10px}
  .myschedule #reports-view>.panel-toolbar>label{display:flex;align-items:center;gap:8px;min-width:0}
  .myschedule #report-kind,.myschedule #report-search{min-width:0;width:100%;height:32px;max-width:none}
  .myschedule #reports-view .report-caption{flex:none;padding:8px 12px;overflow-wrap:anywhere;line-height:1.5}
  .myschedule #reports-view>.table-scroll>table{min-width:760px}
  .myschedule .mys-report-tabs{display:flex;gap:6px;flex:none;padding:8px 12px;border-bottom:1px solid var(--line)}
  .myschedule .mys-report-tabs button{min-height:32px;padding:6px 12px;font-size:11px}
  .myschedule .mys-report-tabs button[aria-selected="true"]{background:var(--primary-95);color:var(--primary-40);border-color:var(--primary-70)}
  .myschedule #reports-view>#report-gantt-slot{display:flex;flex-direction:column;flex:1;min-height:0;height:auto;max-height:none;overflow:hidden;border-top:0}
  .myschedule #report-gantt-slot>.shared-gantt{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
  .myschedule #report-gantt-slot .gantt{flex:1;min-height:0}
  .myschedule #report-gantt-slot .board-footer{flex:none}
  .myschedule .mys-report-chart-tools{display:flex;align-items:center;gap:6px;flex:none;padding:8px 12px;border-bottom:1px solid var(--line)}
  .myschedule .mys-report-chart-tools>span{margin-right:auto;font-size:11px;color:var(--muted)}
  .myschedule .mys-report-chart-tools button{min-height:30px;padding:5px 10px;font-size:11px}
  .myschedule .mys-workspace-menu{inset:auto;margin:0;position:fixed;width:min(300px,calc(100vw - 24px));max-height:min(400px,calc(100dvh - 24px));overflow:auto;padding:8px;border:1px solid var(--line);border-radius:8px;background:white;box-shadow:0 12px 32px #362f2b26;color:var(--text);opacity:0;transform:translateY(-5px) scale(.98);transition:opacity 150ms ease,transform 150ms ease,display 150ms allow-discrete,overlay 150ms allow-discrete}
  .myschedule .mys-workspace-menu:popover-open{display:flex;flex-direction:column;gap:4px;opacity:1;transform:translateY(0) scale(1)}
  .myschedule .mys-workspace-menu>button{display:block;width:100%;text-align:left;min-height:34px;padding:8px 10px;font-size:11px;white-space:normal;border:0;background:white;line-height:1.5}
  .myschedule .mys-workspace-menu>button:hover{background:var(--surface-subtle)}
  .myschedule .mys-workspace-menu>strong{font-size:11px;padding:5px 10px 8px;color:var(--muted);border-bottom:1px solid var(--line)}
  .myschedule #order-dialog .operation-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 18px;padding:14px;border:1px solid var(--line);border-radius:7px;background:var(--surface-subtle)}
  .myschedule #order-dialog .operation-row label{min-width:0;gap:6px;line-height:1.5}
  .myschedule #order-dialog .operation-row input,.myschedule #order-dialog .operation-row select{width:100%;min-width:0;min-height:34px}
  .myschedule #order-dialog .operation-row select[multiple]{min-height:78px}
  .myschedule #order-dialog .operation-row .row-actions{grid-column:1 / -1}
  @starting-style{.myschedule .mys-workspace-menu:popover-open{opacity:0;transform:translateY(-5px) scale(.98)}}
  @media(max-width:1050px){
    .myschedule #reports-view>.panel-toolbar{grid-template-columns:minmax(190px,1fr) minmax(130px,1fr) auto}
    .myschedule #refresh-reports{grid-column:1 / 3;grid-row:2;justify-self:start}
    .myschedule #reports-view>.panel-toolbar>.mys-workspace-menu-trigger{grid-column:3;grid-row:1 / 3}
  }
  @media(max-width:680px){
    .myschedule #order-dialog .operation-row{grid-template-columns:repeat(2,minmax(0,1fr));margin:12px;padding:12px}
    .myschedule #order-dialog .operation-row label:has(select[multiple]),.myschedule #order-dialog .operation-row label:has(input[type="datetime-local"]){grid-column:1 / -1}
    .myschedule :is(#order-dialog,#resource-dialog) .subheading{flex-wrap:wrap;gap:8px;padding:12px 16px}
    .myschedule :is(#order-dialog,#resource-dialog) .subheading h3{margin:0;min-width:0}
    .myschedule #resource-dialog .edit-row label{min-width:0}
    .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace main{padding:10px 10px 8px;gap:8px}
    .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace-caption{align-items:flex-start;flex-direction:column;gap:8px}
    .myschedule:is([data-surface="editor"],[data-surface="reports"]) .mys-page-actions{width:100%;gap:6px}
    .myschedule:is([data-surface="editor"],[data-surface="reports"]) .mys-page-actions button{flex:1;min-width:0;padding:7px;font-size:11px;white-space:normal}
    .myschedule #editor-view>.native-editor-toolbar{padding:7px 8px;gap:5px;min-height:44px}
    .myschedule #editor-view .native-editor-toolbar>.mys-workspace-menu-trigger{margin-left:auto;padding:6px 8px;font-size:10px}
    .myschedule #master-view>.panel-toolbar{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px}
    .myschedule #master-title{grid-column:1 / -1}
    .myschedule #master-view>.panel-toolbar>.mys-workspace-menu-trigger{font-size:10px;padding:5px 8px}
    .myschedule :is(#orders-view,#resources-view)>.panel-toolbar{padding:7px 8px;gap:8px}
    .myschedule #reports-view>.panel-toolbar{grid-template-columns:minmax(0,1fr) auto;padding:8px;gap:8px}
    .myschedule #reports-view>.panel-toolbar>label{grid-column:1 / -1;gap:8px}
    .myschedule #report-search{grid-column:1 / -1}
    .myschedule #refresh-reports{grid-column:1;grid-row:auto;justify-self:stretch;white-space:normal}
    .myschedule #reports-view>.panel-toolbar>.mys-workspace-menu-trigger{grid-column:2;grid-row:auto}
    .myschedule .mys-report-tabs{padding:7px 8px}
    .myschedule #reports-view .report-caption{font-size:10px;padding:7px 8px}
    .myschedule .mys-report-chart-tools{padding:7px 8px;flex-wrap:wrap}
    .myschedule .mys-report-chart-tools>span{display:none}
  }
  @media(max-height:500px){
    .myschedule:is([data-surface="editor"],[data-surface="reports"]) .workspace main{overflow:auto}
    .myschedule :is(#editor-view,#reports-view){flex:1 0 220px}
  }
}
@media print{
  .mys-workspace-menu,.mys-workspace-menu-trigger,.mys-report-tabs,.mys-report-chart-tools{display:none!important}
  html body.myschedule #reports-view.print-active #mys-report-table-panel[hidden],
  html body.myschedule #reports-view.print-active #report-caption[hidden]{display:block!important}
}
