@charset "UTF-8";

/* Soft Studio only. The adapter adds presentation attributes without changing
   native forms, dialog lifecycles, disclosure state, or business outcomes. */
@media screen {
  html[data-workbench-theme="studio"] {
    --studio-motion-ease:cubic-bezier(.22,.8,.3,1);
    --studio-motion-short:140ms;
    --studio-motion-panel:220ms;
  }

  html[data-workbench-theme="studio"]
  :is(button.primary,button.secondary,.topbar button,.toolbar > button,.form-actions > button,.overview-action,.studio-preview-actions > button):not(.nav-button):not(.record-row):not(.employee-row):not(.task-card-title) {
    transform-origin:center;
  }

  /* Keep repeated ledger rows still; only the disclosure control rotates. */
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"] > summary {
    list-style:none;
  }
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"] > summary::-webkit-details-marker {
    display:none;
  }
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"] > summary::before {
    content:""; display:inline-block; width:7px; height:7px; margin:0 12px 2px 2px;
    border-right:1.8px solid currentColor; border-bottom:1.8px solid currentColor;
    transform:rotate(-45deg); transform-origin:center; opacity:.7;
  }
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"][open] > summary::before {
    transform:rotate(45deg);
  }
  html[data-workbench-theme="studio"] [data-studio-motion="supplier-content"] {
    transform-origin:top center;
  }
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"]:is([data-studio-motion-state="expanding"],[data-studio-motion-state="collapsing"],[data-studio-motion-state="resizing"]) {
    overflow:clip;
  }
  html[data-workbench-theme="studio"] [data-studio-motion="supplier-content"][aria-busy="true"] {
    min-block-size:76px;
  }
  html[data-workbench-theme="studio"] [data-studio-motion="supplier-content"][aria-busy="true"] > p.muted {
    display:flex; align-items:center; min-block-size:76px; margin:0;
  }

  /* Batch dialogs remain in the native top layer. The list stays visible
     through a light backdrop while the operation has its own work surface. */
  html[data-workbench-theme="studio"]
  dialog.queue-batch-dialog[data-studio-motion="drawer"][open] {
    position:fixed; inset:0; margin:16px 16px 16px auto; display:flex; flex-direction:column;
    width:min(620px,calc(100vw - 32px)); max-width:calc(100vw - 32px);
    height:calc(100dvh - 32px); max-height:calc(100dvh - 32px);
    padding:25px; border-radius:24px; overflow:hidden; overscroll-behavior:contain;
    background:var(--surface,#fff); box-shadow:-14px 0 54px #253b311c;
    transform-origin:right center;
  }
  html[data-workbench-theme="studio"]
  dialog.queue-batch-dialog[data-studio-motion="drawer"]::backdrop {
    background:#253b3129;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > h2 {
    flex-shrink:0; margin:0 0 10px; line-height:1.4; overflow-wrap:anywhere;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > :is(p,.erp-context-note) {
    flex-shrink:0; margin-block:0 22px; overflow-wrap:anywhere;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] :is(form,.field-grid,.form-section) {
    min-width:0;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .field-grid {
    grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr));
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .queue-batch-options {
    flex:1 1 auto; min-height:0; max-height:none; overflow:auto;
    overscroll-behavior:contain; scrollbar-gutter:stable; scroll-padding-block:12px;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .queue-batch-option > span {
    min-width:0;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .queue-batch-option > button {
    flex-shrink:0; white-space:nowrap;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .form-readiness {
    flex-shrink:0; margin-block:14px; line-height:1.7; overflow-wrap:anywhere;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > .toolbar {
    position:static; flex-shrink:0; margin:0; padding:17px 0 0;
    border-top:1px solid var(--line,#e4e8e2); background:var(--surface,#fff);
    box-shadow:none; justify-content:flex-end;
  }

  /* In-place editors keep the existing split view and resize handles. */
  html[data-workbench-theme="studio"] #detail > form[data-studio-motion="panel"] > .form-actions {
    border-top-color:#dce5d2; background:var(--surface,#fff);
    box-shadow:0 -8px 16px #253b3105;
  }
  html[data-workbench-theme="studio"] :is(button,a,input,select,textarea,summary):focus-visible {
    outline:2px solid var(--focus,#6b844c); outline-offset:3px;
  }
  html[data-workbench-theme="studio"] :is(input,select,textarea)[aria-invalid="true"] {
    border-color:#9a5356; outline-color:#9a5356;
  }
}

@media screen and (max-width:700px) {
  html[data-workbench-theme="studio"]
  dialog.queue-batch-dialog[data-studio-motion="drawer"][open] {
    inset:auto 0 0; margin:0 10px 10px;
    width:calc(100vw - 20px); max-width:calc(100vw - 20px);
    height:auto; max-height:calc(100dvh - 24px);
    padding:22px 19px calc(22px + env(safe-area-inset-bottom));
    border-radius:24px; transform-origin:bottom center;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .field-grid {
    grid-template-columns:minmax(0,1fr);
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > .toolbar {
    padding-top:16px;
  }
}

/* On short landscape screens, prioritize reaching every option over pinning
   the header. Native dialog scrolling also follows keyboard focus naturally. */
@media screen and (max-height:500px) {
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"][open] {
    display:block; overflow:auto; height:calc(100dvh - 32px);
    max-height:calc(100dvh - 32px); scrollbar-gutter:stable;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] .queue-batch-options {
    overflow:visible; max-height:none; scrollbar-gutter:auto;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > .toolbar {
    margin-top:18px;
  }
}

@media screen and (prefers-reduced-motion:no-preference) {
  html[data-workbench-theme="studio"]
  :is(button.primary,button.secondary,.topbar button,.toolbar > button,.form-actions > button,.overview-action,.studio-preview-actions > button):not(.nav-button):not(.record-row):not(.employee-row):not(.task-card-title) {
    transition:background-color var(--studio-motion-short) ease,
      border-color var(--studio-motion-short) ease,color var(--studio-motion-short) ease,
      transform var(--studio-motion-short) var(--studio-motion-ease),box-shadow var(--studio-motion-short) ease;
  }
  html[data-workbench-theme="studio"]
  :is(button.primary,button.secondary,.topbar button,.toolbar > button,.form-actions > button,.overview-action,.studio-preview-actions > button):not(.nav-button):not(.record-row):not(.employee-row):not(.task-card-title):not(:disabled):active {
    transform:scale(.98); transition-duration:80ms;
  }
  html[data-workbench-theme="studio"] .queue-supplier-group[data-studio-motion="supplier"] > summary::before {
    transition:transform 180ms var(--studio-motion-ease);
  }
  html[data-workbench-theme="studio"]
  :is(.purchase-views,.purchase-detail-tabs,.ledger-view-toggle,.task-area-tabs,.task-view-tabs,.task-category-tabs,.budget-tabs,.column-editor-tabs,.workbench-theme-switch) > button {
    transition:background-color 160ms ease,border-color 160ms ease,color 160ms ease,box-shadow 160ms ease;
  }
}

@media screen and (prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine) {
  html[data-workbench-theme="studio"]
  :is(button.primary,button.secondary,.topbar button,.toolbar > button,.form-actions > button,.overview-action,.studio-preview-actions > button):not(.nav-button):not(.record-row):not(.employee-row):not(.task-card-title):not(:disabled):hover:not(:active) {
    transform:translateY(-1px); box-shadow:0 3px 8px #253b3110;
  }
}

@media screen and (prefers-reduced-motion:reduce) {
  html[data-workbench-theme="studio"] [data-studio-motion],
  html[data-workbench-theme="studio"] [data-studio-motion]::before,
  html[data-workbench-theme="studio"] [data-studio-motion]::after {
    animation:none!important; transition:none!important; scroll-behavior:auto!important;
  }
  html[data-workbench-theme="studio"]
  :is(button.primary,button.secondary,.topbar button,.toolbar > button,.form-actions > button,.overview-action,.studio-preview-actions > button):not(.nav-button):not(.record-row):not(.employee-row):not(.task-card-title) {
    transform:none!important; transition:none!important;
  }
}

@media screen and (forced-colors:active) {
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] {
    background:Canvas; color:CanvasText; border:1px solid CanvasText; box-shadow:none;
  }
  html[data-workbench-theme="studio"] dialog.queue-batch-dialog[data-studio-motion="drawer"] > .toolbar {
    background:Canvas; border-color:CanvasText; box-shadow:none;
  }
}

/* One background follows the existing pressed control. No new business DOM. */
@media screen {
  html[data-workbench-theme="studio"] [data-studio-selection] {
    position:relative; isolation:isolate;
  }
  html[data-workbench-theme="studio"] [data-studio-selection]::before {
    content:""; position:absolute; inset:0 auto auto 0; pointer-events:none;
    width:var(--studio-pill-width); height:var(--studio-pill-height);
    transform:translate(var(--studio-pill-x),var(--studio-pill-y)); transform-origin:0 0;
    background:#e8e1f1; border:1px solid #ddd4e7; border-radius:10px;
    box-sizing:border-box; z-index:-1;
  }
  html[data-workbench-theme="studio"] [data-studio-selection] > button[aria-pressed="true"] {
    background:transparent!important; border-color:transparent!important;
  }
}
@media screen and (forced-colors:active) {
  html[data-workbench-theme="studio"] [data-studio-selection]::before {background:Highlight; border-color:Highlight;}
  html[data-workbench-theme="studio"] [data-studio-selection] > button[aria-pressed="true"] {color:HighlightText;}
}
@media print {
  [data-studio-selection]::before {display:none!important;}
}
