/* Shared screen chrome for all makers. Worksheet/print roots are excluded. */
@media screen {
  .zg-maker-workspace { --mw-error:#b62f42; }
  .dark-mode .zg-maker-workspace { --mw-error:#ffabb9; }
  .maker-engine .maker-generation-status[hidden] { display:none!important; }
  .maker-engine.zg-ws-editor header.ws-studio-header,
  .zg-maker-workspace .maker-engine.zg-ws-editor header.ws-studio-header,
  .zg-maker-workspace #makerView:not(.zg-ws-active) header.lesson-view-header {
    height:56px; min-height:56px; padding-block:5px;
  }
  /* Dedicated headers only: one identity in both themes, independent of paper,
     footer and Help-panel tokens. Specificity also covers legacy dark headers. */
  #pdfMakerWorkspace #makerView header:is(.ws-studio-header,.lesson-view-header) {
    background:linear-gradient(90deg,#7545E8 0%,#653AD1 55%,#45258F 100%);
    border-bottom-color:rgb(255 255 255 / .2);
  }
  #pdfMakerWorkspace #makerView header :is(.ws-brand,.ws-brand small,.ws-tool-title,.maker-workspace-brand,.lesson-view-title) {
    color:#fff;
  }
  #pdfMakerWorkspace #makerView header .ws-brand { border-right-color:rgb(255 255 255 / .25); }
  #pdfMakerWorkspace #makerView header .ws-identity>.ph {
    color:#fff; background:rgb(255 255 255 / .14);
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn) {
    color:#fff; background:rgb(255 255 255 / .08); border-color:transparent;
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn):hover:not(:disabled) {
    background:rgb(255 255 255 / .16);
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn):is([aria-pressed=true],[aria-expanded=true]) {
    background:rgb(255 255 255 / .22);
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn):active:not(:disabled) {
    background:rgb(255 255 255 / .28);
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn):focus-visible {
    outline:3px solid #fff; outline-offset:2px; box-shadow:none;
  }
  #pdfMakerWorkspace #makerView header :is(.maker-workspace-theme,.maker-workspace-back,.maker-help-btn):disabled {
    opacity:.45; background:rgb(255 255 255 / .04); cursor:not-allowed;
  }
  .zg-maker-workspace #makerView:not(.zg-ws-active) .lesson-view-titleblock {
    display:flex; align-items:center; gap:24px; min-width:0;
  }
  .zg-maker-workspace #makerView:not(.zg-ws-active) .maker-title-row { flex:1; min-width:0; }
  .zg-maker-workspace #makerView:not(.zg-ws-active) .lesson-view-title { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .maker-engine.zg-ws-editor footer.ws-action-dock,
  .zg-maker-workspace .maker-engine.zg-ws-editor footer.ws-action-dock,
  .zg-maker-workspace footer.maker-workspace-dock {
    display:grid; grid-template-columns:auto minmax(0,1fr) auto;
    min-height:56px; padding:5px 22px; gap:12px;
  }
  .maker-engine.zg-ws-editor .ws-generate-actions,
  .zg-maker-workspace [data-workspace-generate] { grid-column:1; grid-row:1; }
  .maker-engine.zg-ws-editor .ws-output-actions,
  .zg-maker-workspace [data-workspace-output] { grid-column:3; grid-row:1; }
  .maker-engine .maker-generation-status,
  .maker-engine.zg-ws-editor .ws-feedback,
  .zg-maker-workspace .maker-engine.zg-ws-editor .ws-feedback {
    grid-column:2; grid-row:1; justify-self:start; display:inline-flex; align-items:center;
    gap:6px; min-width:0; min-height:28px; margin:0; padding:4px 8px;
    font-size:11px; line-height:1.4; background:var(--mw-canvas,var(--ws-canvas));
    color:var(--ws-accent,var(--mw-accent)); border-radius:6px; overflow-wrap:anywhere;
  }
  .maker-engine .maker-generation-status>.ph,
  .maker-engine.zg-ws-editor .ws-feedback>.ph { flex:none; font-size:16px; }
  .maker-engine .maker-generation-status[data-error=true],
  .maker-engine.zg-ws-editor .ws-feedback[data-error=true] { color:var(--ws-error,var(--mw-error,#b62f42)); }
  .zg-maker-workspace footer.maker-workspace-dock>[data-workspace-output] { flex-wrap:nowrap; }
  .zg-maker-workspace footer.maker-workspace-dock .maker-print-tip { display:none; }
  .zg-maker-workspace footer.maker-workspace-dock .maker-export-controls input { min-height:44px; }
  .zg-maker-workspace footer.maker-workspace-dock button { border-radius:5px; box-shadow:none; }
  .zg-maker-workspace footer.maker-workspace-dock .btn-primary { background:#7545e8; border-color:#7545e8; color:#fff; }
  .zg-maker-workspace footer.maker-workspace-dock .btn-primary:hover:not(:disabled) { background:#5630b7; border-color:#5630b7; }
  .zg-maker-workspace footer.maker-workspace-dock .btn-outline-secondary { background:var(--mw-surface); border-color:var(--mw-line); color:var(--mw-ink); }
  .zg-maker-workspace footer.maker-workspace-dock .btn-outline-secondary:hover:not(:disabled) { background:var(--mw-canvas); }
  .zg-maker-workspace footer.maker-workspace-dock [data-workspace-regenerate] { width:44px; padding:0; display:grid; place-items:center; }
  .zg-maker-workspace footer.maker-workspace-dock [data-workspace-regenerate]>.ph { font-size:20px; }
  .zg-maker-workspace .maker-document-info { color:var(--mw-muted); font-size:11px; white-space:nowrap; }
  .zg-maker-workspace .maker-help-btn,
  .maker-engine.zg-ws-editor .ws-header-actions .maker-help-btn {
    width:44px; height:44px; min-width:44px; min-height:44px; flex:none; padding:8px;
    border:0; border-radius:5px; background:transparent; color:var(--mw-accent,var(--ws-purple));
    box-shadow:none; transform:none; transition:background 150ms ease;
  }
  .zg-maker-workspace .maker-help-btn i,
  .maker-engine.zg-ws-editor .ws-header-actions .maker-help-btn i { font-size:20px; }
  .zg-maker-workspace .maker-help-btn:hover,
  .maker-engine.zg-ws-editor .ws-header-actions .maker-help-btn:hover { background:var(--mw-canvas,var(--ws-canvas)); box-shadow:none; transform:none; }
  .zg-maker-workspace .maker-help-btn:focus-visible,
  .maker-engine.zg-ws-editor .ws-header-actions .maker-help-btn:focus-visible { outline:3px solid var(--mw-accent,var(--ws-purple)); outline-offset:2px; box-shadow:none; transform:none; }
  @media(max-width:1200px) { .zg-maker-workspace .maker-document-info { display:none; } }
  @media(max-width:760px) {
    .zg-maker-workspace #makerView:not(.zg-ws-active) .lesson-view-titleblock { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; }
    .zg-maker-workspace #makerView:not(.zg-ws-active) .maker-workspace-brand { grid-column:1; grid-row:1; margin:0; }
    .zg-maker-workspace #makerView:not(.zg-ws-active) div.maker-title-row { display:contents; }
    .zg-maker-workspace #makerView:not(.zg-ws-active) h2.lesson-view-title { grid-column:1; grid-row:2; }
    .zg-maker-workspace #makerView:not(.zg-ws-active) div.maker-title-actions { grid-column:2; grid-row:1/span 2; }
    .maker-engine.zg-ws-editor footer.ws-action-dock,
    .zg-maker-workspace .maker-engine.zg-ws-editor footer.ws-action-dock,
    .zg-maker-workspace footer.maker-workspace-dock {
      grid-template-columns:auto minmax(0,1fr); gap:6px 8px;
      padding:5px 12px calc(5px + env(safe-area-inset-bottom,0px));
    }
    .maker-engine.zg-ws-editor .ws-mobile-pagination { grid-column:1/-1; grid-row:1; }
    .maker-engine.zg-ws-editor .ws-generate-actions,
    .zg-maker-workspace [data-workspace-generate] { grid-column:1; grid-row:2; }
    .maker-engine .maker-generation-status,
    .maker-engine.zg-ws-editor .ws-feedback,
    .zg-maker-workspace .maker-engine.zg-ws-editor .ws-feedback { grid-column:2; grid-row:2; }
    .maker-engine.zg-ws-editor .ws-output-actions,
    .zg-maker-workspace [data-workspace-output] { grid-column:1/-1; grid-row:3; }
  }
  .zg-maker-workspace[data-workspace-compact=true] footer[data-workspace-dock] {
    display:flex; flex-direction:row; flex-wrap:nowrap; min-height:56px; padding:5px 12px; gap:10px;
  }
}
