/* Program execution: mature analysis-tool rail and flat scheme progress ledger. */
/* Regular/assisted modes retain a full-width fixed action bar. Give the
 * scrollable rail the same clearance as the main work area; collaboration
 * already bounds its inspector above the measured conversation dock. */
#view-walkthrough .uaw-shell:not([data-uaw-mode="ai_collab"]) .uaw-context {
  padding-bottom: calc(var(--uaw-dock-height, 66px) + 24px) !important;
  scroll-padding-bottom: calc(var(--uaw-dock-height, 66px) + 24px);
}

@media (min-width: 981px) {
  #view-walkthrough .uaw-shell:not(.is-context-collapsed) {
    --uaw-context-width: 380px !important;
    grid-template-columns: minmax(0, 1fr) var(--uaw-context-width) !important;
  }

  #view-walkthrough .uaw-context {
    --peca-builtin-accent: #3f6f68;
    --peca-builtin-soft: #edf5f3;
    --peca-builtin-line: #d7e5e1;
    --peca-extension-accent: #6a5c88;
    --peca-extension-soft: #f3eff8;
    --peca-extension-line: #ded5ea;
    width: var(--uaw-context-width) !important;
    padding: 15px 16px 20px !important;
    background: #fafbfc !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  #view-walkthrough .uaw-context-resizer { display: none !important; }
}

/* The combined plan-and-feedback inspector needs room for one-to-one step
 * requirements. Keep the normal tool rail compact and widen only this view. */
@media (min-width: 981px) {
  #view-walkthrough .uaw-shell.is-scheme-progress-open:not(.is-context-collapsed) {
    --uaw-context-width: 480px !important;
    grid-template-columns: minmax(0, 1fr) var(--uaw-context-width) !important;
  }

  #view-walkthrough .uaw-shell.is-scheme-progress-open .uaw-context {
    width: var(--uaw-context-width) !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  #view-walkthrough .uaw-shell:not(.is-context-collapsed) {
    --uaw-context-width: 340px !important;
  }
}

#view-walkthrough .uaw-context-head {
  min-height: 42px !important;
  padding: 0 0 11px !important;
  border-bottom: 1px solid #dfe5ec !important;
}

#view-walkthrough .uaw-context-head strong {
  color: #182230;
  font-size: 16px !important;
  font-weight: 690;
  letter-spacing: -.015em;
}

#view-walkthrough .uaw-context-head [data-uaw-toggle-context] {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0 !important;
  border-color: #d8dee7 !important;
  border-radius: 8px !important;
  background: #fff !important;
}

#view-walkthrough .uaw-program-support,
#view-walkthrough [data-uaw-program-actions],
#view-walkthrough .peca-tool-catalog {
  display: grid;
  gap: 13px !important;
}

#view-walkthrough .peca-tool-source {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 1px 0 12px;
  border-bottom: 1px solid #e1e6ed;
  border-radius: 0;
  background: transparent;
}

#view-walkthrough .uaw-context .peca-tool-catalog {
  box-sizing: border-box;
  min-width: 0;
  padding: 14px !important;
}

#view-walkthrough .peca-tool-source span {
  grid-column: 1;
  color: #667085;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.35;
}

#view-walkthrough .peca-tool-source strong {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 12px;
  font-weight: 660;
  line-height: 1.5;
  white-space: normal !important;
}

#view-walkthrough .peca-tool-source small {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: #8791a0;
  font-size: 10.5px !important;
  font-weight: 520;
  line-height: 1.35 !important;
  white-space: nowrap;
}

#view-walkthrough .peca-tool-origin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  color: #52606f;
}

#view-walkthrough .peca-tool-origin > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 660;
}

#view-walkthrough .peca-tool-origin > span > i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--peca-builtin-accent);
}

#view-walkthrough .peca-tool-origin > small {
  color: #8a94a3;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

#view-walkthrough .peca-tool-group { display: grid; gap: 6px; }

#view-walkthrough .peca-tool-group h4 {
  margin: 0;
  color: #667281 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choice,
#view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(even),
#view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(3n) {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  justify-items: stretch !important;
  align-items: center !important;
  gap: 8px !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 7px 9px !important;
  border: 1px solid #e1e6eb !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #263244 !important;
  text-align: left !important;
  box-shadow: none !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choice:is(:hover, :focus-visible) {
  border-color: var(--peca-builtin-line) !important;
  background: #f6f9f8 !important;
  outline: 2px solid color-mix(in srgb, var(--peca-builtin-accent) 24%, transparent);
  outline-offset: 1px;
}

#view-walkthrough .peca-tool-group .peca-tool-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  background: var(--peca-builtin-soft) !important;
  color: var(--peca-builtin-accent) !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choice strong {
  overflow: visible;
  color: inherit;
  font-size: 11.5px !important;
  font-weight: 620 !important;
  line-height: 1.3 !important;
  text-overflow: clip;
  white-space: normal;
}

/* Keep each tool family visually attached to its own choices, while leaving
 * enough air from the preceding family to avoid headings touching the grid. */
#view-walkthrough .peca-tool-origin {
  margin: 2px 0;
  padding: 0 2px;
}

#view-walkthrough .peca-tool-group {
  gap: 10px;
}

#view-walkthrough .peca-tool-group + .peca-tool-group {
  margin-top: 6px;
}

#view-walkthrough .peca-tool-group h4 {
  padding: 0 2px;
}

#view-walkthrough .uaw-regular-progress {
  margin-top: 1px;
  padding: 12px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid #dfe5ec !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#view-walkthrough .uaw-scheme-progress-entry { gap: 7px; padding: 0; }

#view-walkthrough .uaw-scheme-progress-entry > button {
  min-height: 48px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#view-walkthrough .uaw-scheme-progress-entry > button:is(:hover, :focus-visible) {
  background: transparent !important;
  box-shadow: none !important;
}

#view-walkthrough .uaw-scheme-progress-entry small { color: #697586; font-size: 10.5px; font-weight: 650; }
#view-walkthrough .uaw-scheme-progress-entry strong { color: #26313f; font-size: 12px; font-weight: 670; line-height: 1.35; }
#view-walkthrough .uaw-scheme-progress-entry em { color: #7b8593; font-size: 10px; line-height: 1.4; white-space: nowrap; }

#view-walkthrough .uaw-scheme-progress-entry > button > b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 2px 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--peca-builtin-accent);
  font-size: 10px;
  font-weight: 660;
}

#view-walkthrough .uaw-scheme-progress-entry > button > b::after {
  display: block;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}
#view-walkthrough .uaw-scheme-progress-entry > i { height: 2px; margin: 0; background: #e6ebe9; }
#view-walkthrough .uaw-scheme-progress-entry > i > span { background: var(--peca-builtin-accent); }

#view-walkthrough .uaw-responsibility-notice {
  gap: 2px;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid #e3e8ee;
  border-radius: 0;
  background: transparent;
}

#view-walkthrough .uaw-responsibility-notice strong {
  color: #344054;
  font-size: 9.5px;
  font-weight: 640;
}

#view-walkthrough .uaw-responsibility-notice small {
  color: #7b8798;
  font-size: 9px;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] {
  gap: 8px;
  padding: 13px 0 0;
  border: 0;
  border-top: 1px solid var(--peca-extension-line);
  border-radius: 0;
  background: transparent;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] > header > span {
  color: var(--peca-extension-accent);
  font-size: 9px !important;
  font-weight: 650;
  letter-spacing: 0;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] > header > span > b {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--peca-extension-soft);
  color: var(--peca-extension-accent);
  font-size: 8px;
  font-weight: 720;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] > header > strong,
#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] > header > select {
  color: #342f40;
  font-size: 11px;
  font-weight: 650;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] .peca-professional-open {
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid var(--peca-extension-line);
  border-radius: 8px;
  background: #fcfbfd;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] .peca-professional-open:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--peca-extension-accent) 48%, white);
  background: var(--peca-extension-soft);
  outline: 2px solid color-mix(in srgb, var(--peca-extension-accent) 20%, transparent);
  outline-offset: 1px;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] .peca-professional-open > span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--peca-extension-soft);
  color: var(--peca-extension-accent);
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] .peca-professional-open strong {
  color: #342f40;
  font-size: 11px;
  font-weight: 650;
}

#view-walkthrough .peca-professional-catalog[data-peca-origin="extension"] .peca-professional-open small {
  color: #81778e;
  font-size: 9px;
}

#view-walkthrough .uaw-scheme-progress-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
}

#view-walkthrough .uaw-scheme-progress-panel > header {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 12px;
  border-bottom: 1px solid #dfe5ec;
}

#view-walkthrough .uaw-scheme-progress-panel > header > h3 { display: none; }

#view-walkthrough .uaw-scheme-progress-panel > header > button {
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
}

#view-walkthrough .uaw-scheme-progress-summary {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid #dfe5ec;
  border-radius: 0;
  background: transparent;
}

#view-walkthrough .uaw-scheme-progress-metric { min-width: 64px; padding-right: 14px; }
#view-walkthrough .uaw-scheme-progress-note { grid-column: 1 / -1; }

#view-walkthrough .uaw-scheme-step-list { gap: 0; padding: 0; border: 0; }

#view-walkthrough .uaw-scheme-step,
#view-walkthrough .uaw-scheme-step:is(:hover, :focus-within),
#view-walkthrough .uaw-scheme-step.is-current {
  overflow: visible;
  border: 0;
  border-bottom: 1px solid #e3e8ee;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#view-walkthrough .uaw-scheme-step.is-current { background: #f6f8fb; }

#view-walkthrough .uaw-scheme-step > details > summary {
  grid-template-columns: 28px minmax(0, 1fr) auto 10px;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 10px 2px;
}

#view-walkthrough .uaw-scheme-step > details > summary::after { grid-column: 4; grid-row: 1; }

#view-walkthrough .uaw-scheme-step > details > summary > b {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #7b8798;
  font-size: 11px;
}

#view-walkthrough .uaw-scheme-step.is-current > details > summary > b { background: transparent; color: #355d92; }

#view-walkthrough .uaw-scheme-step > details > summary strong {
  font-size: 12px;
  font-weight: 680;
  line-height: 1.45;
}

#view-walkthrough .uaw-scheme-step > details > summary em {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  padding: 3px 6px;
  font-size: 9px;
}

#view-walkthrough .uaw-scheme-step > details[open] > summary {
  border-bottom: 1px solid #e3e8ee;
  background: #f6f8fb;
}

#view-walkthrough .uaw-scheme-step-editor { gap: 10px; padding: 12px 2px 16px 36px; background: #fff; }
#view-walkthrough .uaw-scheme-progress-panel > footer { padding-top: 12px; }

@media (max-width: 720px) {
  #view-walkthrough .peca-tool-group .peca-tool-choices { grid-template-columns: 1fr !important; }
}

/* Stable desktop canvas: page chrome stays still; excess rows scroll inside
 * the data viewport. Narrow layouts return to natural document scrolling. */
@media (min-width: 981px) {
  #view-walkthrough .uaw-formal:has(.at-primary-work-stage[data-at-work-view="data"]) {
    overflow-y: hidden !important;
    overscroll-behavior-y: auto !important;
    padding-bottom: 0 !important;
    scroll-padding-bottom: 0 !important;
    scrollbar-gutter: auto !important;
  }

  #view-walkthrough .at-primary-work-stage[data-at-work-view="data"] .at-evidence-table-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-gutter: auto !important;
  }

  /* Expanded analysis methods need a scrollable result area above the dock.
   * Keep the stable table-only canvas unchanged when no method is expanded. */
  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-formal:has(.at-primary-work-stage[data-at-work-view="data"] #at-tool-adapter[open]) {
    overflow-y: auto !important;
    padding-bottom: calc(var(--uaw-dock-height, 66px) + 28px) !important;
    scroll-padding-bottom: calc(var(--uaw-dock-height, 66px) + 28px) !important;
  }
}

@media (max-width: 760px) {
  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell[data-uaw-mode="regular"] .uaw-bottom > [data-uaw-mode-actions] {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell[data-uaw-mode="regular"] .uaw-next-action {
    width: 100%;
  }
}

@media (max-width: 980px) {
  #view-walkthrough .uaw-formal {
    overflow-y: visible !important;
    scrollbar-gutter: auto !important;
  }
}

/* Keep the tool return action as a compact standalone control. It should not
 * reserve a full-width framed row above the scheme and feedback content. */
#view-walkthrough .uaw-scheme-progress-panel > header {
  justify-content: flex-start;
  min-height: 32px;
  padding: 0;
  border-bottom: 0;
}

#view-walkthrough .uaw-scheme-progress-summary {
  padding-block: 8px;
}

/* 2026-09-04: capability suitability and execution-workspace rail hardening. */
#view-walkthrough .uaw-program-support.is-awaiting-material [data-uaw-program-actions] > .peca-tool-catalog {
  display: grid !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choice,
#view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(even),
#view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(3n) {
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  height: auto !important;
  min-height: 64px !important;
}

#view-walkthrough .peca-tool-group .peca-tool-choices {
  grid-template-columns: minmax(0, 1fr) !important;
}

#view-walkthrough .peca-tool-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#view-walkthrough .peca-tool-copy strong {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#view-walkthrough .peca-tool-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #667385;
  font-size: 9.5px;
  font-weight: 520;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-walkthrough .peca-tool-state {
  align-self: start;
  margin-top: 1px;
  padding: 2px 5px;
  border-radius: 5px;
  color: #23675e;
  background: #e8f3f0;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.35;
  white-space: nowrap;
}

#view-walkthrough .peca-tool-badges {
  display: flex;
  align-self: start;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#view-walkthrough .peca-tool-badges .peca-tool-ai {
  position: static;
}

#view-walkthrough .peca-tool-choice.is-unavailable,
#view-walkthrough .peca-tool-choice.is-unavailable:is(:hover, :focus-visible) {
  border-color: #e2e6eb !important;
  background: #f7f8fa !important;
  color: #596575 !important;
  cursor: not-allowed;
  outline: none;
}

#view-walkthrough .peca-tool-choice.is-unavailable .peca-tool-icon {
  background: #eaedf1 !important;
  color: #7d8794 !important;
}

#view-walkthrough .peca-tool-choice.is-unavailable .peca-tool-state {
  color: #6b4f23;
  background: #f5ecdc;
}

#view-walkthrough .peca-tool-choice.is-unavailable .peca-tool-copy small {
  color: #626e7d;
}

#view-walkthrough .peca-access-notice {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #e5d6b8;
  border-radius: 8px;
  color: #6f5122;
  background: #fff9ed;
}

#view-walkthrough .peca-access-notice strong { font-size: 10px; }
#view-walkthrough .peca-access-notice span { font-size: 9.5px; line-height: 1.45; }

/* Reading and multi-source work keep tools secondary. Constrained canvases
 * use a non-modal right overlay so opening tools never moves the document. */
@media (min-width: 1601px) {
  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-context-collapsed):not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) {
    --uaw-context-width: clamp(300px, 22vw, 360px) !important;
    grid-template-columns: minmax(880px, 1fr) var(--uaw-context-width) !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-context-collapsed):not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-context {
    display: grid !important;
  }
}

@media (max-width: 1600px) {
  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) {
    position: relative !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-formal {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-row: 2 !important;
    height: auto !important;
    overflow: visible !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-context-collapsed):not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-context {
    position: fixed !important;
    z-index: 90 !important;
    inset: clamp(8px, calc(var(--uaw-viewport-offset, 128px) - 8px), 160px) 8px var(--uaw-inspector-bottom, 8px) auto !important;
    display: grid !important;
    grid-column: auto !important;
    grid-row: auto !important;
    box-sizing: border-box;
    width: min(380px, calc(100% - 16px)) !important;
    max-width: calc(100% - 16px) !important;
    height: auto !important;
    max-height: none !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    border: 0 !important;
    border-radius: 10px !important;
    background: #fbfcfe !important;
    box-shadow: -8px 8px 28px rgba(24, 37, 55, .16) !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-context-resizer {
    display: none !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-context-collapsed):not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-context-head {
    position: sticky;
    top: -15px;
    z-index: 1;
    background: #fafbfc;
  }
}

@media (max-width: 720px) {
  #view-walkthrough .peca-tool-group .peca-tool-choice,
  #view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(even),
  #view-walkthrough .peca-tool-group .peca-tool-choice:nth-of-type(3n) {
    min-height: 60px !important;
  }

  html[data-audit-execution-workspaces="enabled"] #view-walkthrough .uaw-shell:not(.is-context-collapsed):not(.is-review-workbench-open):has(.at-execution-worksheet:is([data-active-execution-workspace="evidence-review"], [data-active-execution-workspace="integrated-analysis"])) .uaw-context {
    width: calc(100% - 16px) !important;
  }
}
