/* Scoped workspace compositions. Shared typography, colors and radii come from redesign.css. */
.flow-context-overview, .flow-text-equivalent, .architecture-text-equivalent,
.workspace-session-content, .fixture-detail { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius-md, 16px); background: var(--surface); }
:is(.flow-context-overview, .flow-text-equivalent, .architecture-text-equivalent, .workspace-session-content, .fixture-detail) > summary { padding: 16px 20px; min-height: 48px; color: var(--text); font: 500 14px/1.5 var(--sans); cursor: pointer; overflow-wrap: anywhere; }
.flow-context-overview .crypto-operation-chain, .flow-context-overview .flow-human-summary { margin: 0; border: 0; }
.operation-flow-page { --flow-label: 12px; --flow-label-strong: 13px; --flow-action: 14px; --flow-body: 15px; }
.flow-control-deck { border-radius: var(--radius-md, 16px); overflow: hidden; }
.flow-mode-picker label span, .flow-scenario-options label span { border-radius: var(--radius-sm, 12px); }
.flow-explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 20px; align-items: start; margin-block: 24px; }
.flow-explorer > * { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md, 16px); background: var(--surface); }
.flow-explorer .operation-journey-head { display: block; padding: 20px; }
.flow-explorer .operation-journey-head h3 { font-size: 21px; line-height: 1.3; }
.flow-explorer .operation-journey-actions { flex-wrap: wrap; margin-top: 16px; }
.flow-explorer .flow-owner-legend { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface-2); }
.flow-explorer .flow-owner-legend span { padding: 8px 12px; }
.flow-explorer .operation-journey-scroll { max-height: 590px; overflow: auto; padding: 16px; }
.flow-explorer .operation-steps { min-width: 0; grid-auto-columns: auto; grid-auto-flow: row; gap: 12px; }
.flow-explorer .operation-step-item::before, .flow-explorer .operation-step-item::after { display: none; }
.flow-explorer .operation-step { min-height: 118px; gap: 8px; border-radius: var(--radius-sm, 12px); padding: 16px; }
.flow-explorer .operation-step.is-selected { transform: none; background: var(--surface-3); outline: 2px solid var(--accent); outline-offset: -2px; }
.flow-explorer .operation-step-meta small { white-space: normal; overflow: visible; text-overflow: clip; }
.flow-explorer .operation-step-copy small { letter-spacing: 0; }
[data-flow-mode="sandbox"] .flow-explorer .operation-step-item.is-after-stop .operation-step { opacity: 1; border-style: dashed; }
.flow-step-select { display: grid; gap: 8px; margin: 16px 20px 0; font-size: 13px; }
.flow-step-select select { width: 100%; min-width: 0; padding: 10px 12px; }
.flow-playback-note { padding: 0 20px; color: var(--muted); font-size: 13px; }
.flow-explorer .flow-step-inspector { position: sticky; top: calc(var(--cr-suite-height, 60px) + 20px); overflow: hidden; }
.flow-explorer .flow-step-inspector > header { grid-template-columns: auto minmax(0, 1fr); }
.flow-explorer .flow-detail-states { grid-column: 1 / -1; justify-content: start; }
.flow-explorer .flow-detail-body { grid-template-columns: minmax(0, 1fr); }
.flow-explorer .flow-detail-explanation { border-right: 0; }
.flow-explorer .flow-detail-register { grid-template-columns: minmax(0, 1fr); }
.flow-explorer .flow-detail-register > div { padding: 14px 20px; border-right: 0; }
.flow-explorer .flow-detail-register dt { letter-spacing: 0; text-transform: none; }
.flow-explorer .flow-step-inspector > footer { flex-wrap: wrap; }
.flow-text-scroll { max-width: 100%; overflow: auto; }
.flow-text-scroll table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 14px; }
.flow-text-scroll :is(th,td) { min-width: 160px; padding: 14px 16px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.flow-text-scroll button { min-height: 44px; border: 0; background: transparent; color: var(--accent); text-align: left; cursor: pointer; font: 500 14px/1.5 var(--sans); }
.architecture-explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 20px; align-items: start; }
.architecture-explorer .deployment-flow { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; max-height: 820px; overflow-y: auto; border-radius: var(--radius-md, 16px); }
.architecture-explorer .deployment-zone { padding: 22px; }
.architecture-explorer .deployment-handoff { padding: 18px; border-inline: 0; }
.architecture-explorer .deployment-zone > ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.architecture-explorer .deployment-zone > ol li { display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius-sm, 12px); }
.architecture-explorer .deployment-zone > ol li::after { display: none; }
.architecture-explorer .deployment-zone :is(b,small,em) { overflow-wrap: anywhere; }
.architecture-explorer .deployment-zone :is(small,em) { font-size: 13px; line-height: 1.5; }
.architecture-explorer [data-inspect-node] { min-height: 40px; margin-top: 8px; padding: 8px 12px; color: var(--accent); border: 1px solid var(--line-strong); border-radius: var(--radius-sm, 12px); background: var(--surface); cursor: pointer; }
.architecture-explorer [data-inspected="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.architecture-inspector { position: sticky; top: calc(var(--cr-suite-height, 60px) + 20px); padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md, 16px); }
.architecture-inspector h3 { font-size: 23px; line-height: 1.3; margin: 8px 0 24px; }
.architecture-inspector dl { display: grid; gap: 20px; }
.architecture-inspector dt { color: var(--muted); font-size: 13px; }
.architecture-inspector dd { margin: 6px 0 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace-access-intro { padding: 28px; margin: 24px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 20px); }
.workspace-access-intro h2 { max-width: 630px; margin: 0 0 12px; font-size: 25px; line-height: 1.3; }
.workspace-access-intro p { max-width: 750px; margin-bottom: 22px; font-size: 15px; color: var(--muted); }
body[data-workspace-access="connected"] .workspace-session-content { border: 0; margin: 0; background: transparent; }
.workspace-session-content > :not(summary) { margin-inline: 0; }
.connections-page .connection-card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-md, 16px); overflow: hidden; }
.connections-page .connection-card { min-height: 105px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; transform: none; }
.connections-page .connection-card:last-child { border-bottom: 0; }
.connections-page .connection-card:hover { background: var(--surface-2); box-shadow: none; transform: none; }
.connections-page .boundary-grid { margin-bottom: 20px; }
.studio-catalog-heading { display: flex; align-items: start; justify-content: space-between; gap: 28px; margin-top: 24px; }
.studio-catalog-heading h2 { flex-shrink: 0; font-size: 22px; }
.studio-catalog-heading p { max-width: 720px; color: var(--muted); font-size: 14px; }
.fixture-detail { margin: 16px; }
.fixture-detail > fieldset { border: 0; margin: 0; }
.pilot-page #pilot-form { position: relative; }
.pilot-page #pilot-form > .form-actions { position: sticky; z-index: 5; top: calc(var(--cr-suite-height, 60px) + 8px); padding: 12px; margin-top: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md, 16px); }
.pilot-form-outline { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.pilot-form-outline a { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm, 12px); color: var(--accent); font-size: 14px; }
.pilot-page .form-block { scroll-margin-top: 180px; }
.pilot-page .evidence-actions { position: sticky; z-index: 4; top: calc(var(--cr-suite-height, 60px) + 8px); background: var(--surface); }
.pilot-generation { min-height: 260px; padding: 44px; display: grid; place-content: center; background: var(--surface-2); }
.pilot-generation p { max-width: 420px; color: var(--muted); }
body[data-guided-journey] .buy-simple-layout { grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); gap: 22px; padding: 24px; }
body[data-guided-journey] .purchase-flow__node { min-height: 174px; padding: 18px; }
body[data-guided-journey] .purchase-flow__node h3 { font-size: 18px; line-height: 1.35; }
body[data-guided-journey] .purchase-flow__node :is(p,small) { font-size: 13px; line-height: 1.5; }
body[data-guided-journey] .purchase-flow__toggle { min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm, 12px); color: var(--accent); background: var(--surface); border: 1px solid var(--line-strong); font-size: 14px; }
@media (max-width: 1190px) {
  .flow-explorer, .architecture-explorer { grid-template-columns: minmax(0, 1fr); }
  .flow-explorer .flow-step-inspector, .architecture-inspector { position: static; }
  .flow-explorer .operation-journey-scroll { max-height: 450px; }
  .flow-explorer .flow-detail-register { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-guided-journey] .buy-simple-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .flow-explorer .flow-detail-register, .architecture-explorer .deployment-zone > ol { grid-template-columns: minmax(0, 1fr); }
  .studio-catalog-heading { display: block; }
  .connections-page .connection-card { grid-template-columns: 40px minmax(0,1fr); grid-template-areas: "mark copy" "status status" "detail detail"; padding: 18px; }
  .connections-page .connection-mark { width: 40px; height: 40px; }
  .flow-explorer .operation-journey-actions > button { flex: 1 1 auto; }
  .architecture-inspector, .workspace-access-intro { padding: 20px; }
  .pilot-page #pilot-form > .form-actions { position: static; }
  .pilot-page .evidence-actions { position: static; }
}
@media print {
  .flow-context-overview > *, .flow-text-equivalent > *, .architecture-text-equivalent > *, .workspace-session-content > *, .fixture-detail > * { display: block !important; }
  .flow-text-scroll, .architecture-explorer .deployment-flow, .flow-explorer .operation-journey-scroll { max-height: none; overflow: visible; }
  .flow-text-scroll table { min-width: 0; font-size: 9pt; }
  .flow-text-scroll :is(th,td) { min-width: 0; }
  .flow-explorer, .architecture-explorer { display: block; }
  .architecture-inspector, .flow-explorer .flow-step-inspector { position: static; }
  .pilot-form-outline, .pilot-generation { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-explorer .operation-step { animation: none; transition: none; }
  .flow-explorer .operation-step.is-selected { transform: none; }
}
.trading-page { grid-template-columns: minmax(0, 1fr); }
.trading-page > * { min-width: 0; }
.trading-page .table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.trading-page :is(.trade-workbench, .trade-post-trade, .trade-register-workspace) { min-width: 0; }
.trading-page :is(header > div, .trade-ticket-actions > *, .trade-order-actions > *) { min-width: 0; }
.trading-page :is(.trade-state, .trade-source-chip, .trade-build-stop) { max-width: 100%; overflow-wrap: anywhere; }
.trade-register-workspace, .movement-register-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 20px; align-items: start; margin-block: 24px; }
.trade-register-workspace > *, .movement-register-workspace > * { min-width: 0; margin: 0; }
.trade-register-workspace .trade-order-inspector, .movement-inspector { position: sticky; top: calc(var(--cr-suite-height, 60px) + 20px); border: 1px solid var(--line); border-radius: var(--radius-md, 16px); background: var(--surface); overflow: hidden; }
.trade-register-workspace .trade-order-facts { grid-template-columns: 1fr; }
.trade-register-workspace .trade-order-facts :is(code,dd) { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; font-size: 13px; }
.trade-register-workspace .trade-order-facts dt { font-size: 12px; }
.trade-register-workspace #trade-fill-form fieldset { grid-template-columns: repeat(2, minmax(0,1fr)); }
.trade-post-trade { display: block; }
#movements .movement-grid { display: block; }
.movement-inspector { padding: 22px; }
.movement-inspector h3 { font-size: 22px; line-height: 1.3; margin: 0; }
.movement-inspector header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.movement-inspector p { color: var(--muted); font-size: 14px; }
.movement-inspector dl { display: grid; gap: 14px; }
.movement-inspector dt { color: var(--muted); font-size: 12px; }
.movement-inspector dd { margin: 5px 0 0; overflow-wrap: anywhere; font: 13px/1.5 var(--mono); }
.movement-select, #movement-detail-close { min-height: 44px; padding: 8px 12px; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm,12px); cursor: pointer; }
.movement-select[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-3); }
.movement-create-details, .report-process-details { margin-block: 20px; border: 1px solid var(--line); border-radius: var(--radius-md,16px); background: var(--surface); }
.movement-create-details > summary, .report-process-details > summary { padding: 18px 22px; min-height: 48px; cursor: pointer; font-size: 14px; }
.movement-create-details > article { border: 0; margin: 0; }
#reports .report-grid { grid-template-columns: minmax(300px,.7fr) minmax(0,1.3fr); gap: 24px; }
#reports .report-builder { position: sticky; top: calc(var(--cr-suite-height,60px) + 20px); }
#reports .report-result-head h3 { font-size: 20px; overflow-wrap: anywhere; }
#reports .report-result-head code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1190px) {
  .trade-register-workspace, .movement-register-workspace { grid-template-columns: minmax(0,1fr); }
  .trade-register-workspace .trade-order-inspector, .movement-inspector { position: static; }
}
@media (max-width: 760px) {
  .trading-page .trade-workbench, .trade-register-workspace #trade-fill-form fieldset { grid-template-columns: minmax(0,1fr); }
  .trading-page :is(.trade-blotter, .trade-positions) > header > div:last-child { flex-wrap: wrap; }
  #reports .report-grid { grid-template-columns: minmax(0,1fr); }
  #reports .report-builder { position: static; }
}
@media print {
  .movement-create-details > article, .report-process-details > ol { display: block !important; }
  .trade-register-workspace, .movement-register-workspace { display: block; }
  .trade-register-workspace .trade-order-inspector, .movement-inspector, #reports .report-builder { position: static; }
}

/* Legacy surface aliases must follow the active palette as a complete color pair. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --cr-canvas: var(--bg); --cr-surface: var(--surface); --cr-surface-subtle: var(--surface-2); --cr-surface-strong: var(--surface-3);
  --cr-ink: var(--text); --cr-muted: var(--muted); --cr-faint: var(--muted);
  --cr-brand: var(--accent); --cr-brand-strong: #c0d8f2; --cr-brand-soft: var(--surface-3); --cr-on-brand: var(--accent-ink);
  --cr-warning: #f2c96d; --cr-warning-soft: #3b311f; --cr-danger: #ff9da6; --cr-danger-soft: #3e2934;
  --cr-success: #8cd5ab; --cr-success-soft: #193b31;
  --amber: var(--cr-warning); --amber-soft: var(--cr-warning-soft); --red: var(--cr-danger); --red-soft: var(--cr-danger-soft);
  --success: var(--cr-success); --success-soft: var(--cr-success-soft);
  --green-dark: var(--accent); --green-deep: #c0d8f2; --green-ink: var(--accent-ink);
  --accent-dark: #c0d8f2; --accent-soft: var(--surface-3); --attention: var(--amber); --danger: var(--red);
  --surface-soft: var(--surface-2); --surface-subtle: var(--surface-2);
  --color-on-accent: var(--accent-ink); --color-warning-ink: var(--amber); --color-danger-ink: var(--red);
  --color-surface-hover: var(--surface-2); --color-surface-register: var(--surface-3); --color-surface-translucent: var(--surface);
  --sales-bg: var(--bg); --sales-surface: var(--surface); --sales-surface-soft: var(--surface-2);
  --sales-text: var(--text); --sales-muted: var(--muted); --sales-line: var(--line);
  --sales-green: var(--accent); --sales-green-dark: #c0d8f2; --sales-green-soft: var(--surface-3);
  --sales-red: var(--red); --sales-red-soft: var(--red-soft); --sales-amber: var(--amber); --sales-amber-soft: var(--amber-soft);
}
:root[data-theme="dark"] .glossary-intro { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .glossary-intro strong { color: var(--text); }
:root[data-theme="dark"] body #sidebar { background: var(--sidebar); }
:root[data-theme="dark"] body.security-assurance-page { --faint: var(--muted); }
:root[data-theme="dark"] .pilot-page .truth-register > strong { color: var(--accent-ink); }
:root[data-theme="dark"] body :is(.primary-button, .button.primary, .button--primary, .journey-primary, .skip-link) { color: var(--accent-ink); background: var(--accent-fill); border-color: var(--accent-fill); }
:root[data-theme="dark"] body :is(.primary-button, .button.primary, .button--primary, .journey-primary):hover:not(:disabled) { color: var(--accent-ink); background: #c0d8f2; border-color: #c0d8f2; }
:root[data-theme="dark"] .security-assurance-page :is(.security-hero-brief > footer, .security-next-actions) { color: var(--text); background: var(--surface-3); }
:root[data-theme="dark"] .security-assurance-page .security-next-actions .button--secondary { color: var(--text); border-color: var(--line-strong); }
:root[data-theme="dark"] .security-assurance-page .security-hero-brief > footer .status { color: var(--text); }
:root[data-theme="dark"] .white-label-page .configuration-panel label { color: var(--text); }
:root[data-theme="dark"] .white-label-page .preview-panel { background: var(--surface-2); }
:root[data-theme="dark"] .white-label-page .capability-readonly output { color: var(--amber); background: var(--amber-soft); }
:root[data-theme="dark"] .white-label-page .capability-readonly output.is-missing { color: var(--red); background: var(--red-soft); }
:root[data-theme="dark"] .white-label-page .capability-readonly output.is-unavailable { color: var(--muted); background: var(--surface-3); }
:root[data-theme="dark"] .white-label-page .button:not(.button--primary) { color: var(--text); background: var(--surface); }
:root[data-theme="dark"] .white-label-page :is(.lede, .section-heading--preview, .integrity-register) .not-implemented { color: var(--red); }
:root[data-theme="dark"] .production-boundary { color: var(--muted); }
:root[data-theme="dark"] .production-boundary strong { color: var(--amber); }
:root[data-theme="dark"] .production-boundary p { color: var(--muted); }
:root[data-theme="dark"] #lab-empty > p { color: var(--muted); }
@media (max-width: 560px) {
  .topbar #theme-toggle { display: grid; width: 44px; min-width: 44px; height: 44px; }
  .topbar .top-actions { flex-wrap: wrap; }
}
/* Ready evidence remains readable during a real report request. */
body .report-preview[data-report-state="building"] > * { opacity:1; transform:scale(1); }
body .report-preview > * { transition:opacity 180ms var(--motion-enter,cubic-bezier(.22,1,.36,1)); }
body .report-preview.is-rendering::before { animation:none; transform:scaleX(1); background:var(--accent); }
body .report-preview.is-rendering::after { display:none; }
