:root {
  color-scheme: light;
  --cw-ink: var(--legacy-ink, #232323);
  --cw-muted: var(--legacy-ink-soft, #6b6560);
  --cw-line: var(--legacy-line, #e7e4e0);
  --cw-surface: #ffffff;
  --cw-canvas: var(--legacy-paper, #f6f4f1);
  --cw-blue: var(--legacy-blue, #1300ff);
  --cw-blue-dark: var(--legacy-blue-hover, #0f00cc);
  --cw-red: #c0364f;
  --cw-amber: #a76505;
  --cw-green: #1a7959;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cw-canvas); color: var(--cw-ink); font-family: var(--font-body); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(59, 54, 242, .24); outline-offset: 2px; }

.cw-app { min-height: 100vh; }
/* The topbar this screen used to render is gone: both authored screens now
   share `renderAuthoredShell`, so navigation is identical between them. Only
   its placement inside this layout belongs here. */
.cw-app > .ashell { padding: 18px 30px 14px; }
.cw-app .ashell__nav a { min-height: 44px; display: inline-flex; align-items: center; }
/* Flat brand mark. The brand system is six flat colours with no gradients. */
.cw-denied > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--cw-blue, #1300ff); font-family: var(--font-display); font-weight: 800; }
.cw-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.cw-main { max-width: 1680px; margin: 0 auto; padding: 34px 30px 60px; }
.cw-hero { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 24px; }
.cw-eyebrow { margin: 0 0 6px; color: var(--cw-blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.cw-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.04em; margin: 0 0 10px; }
.cw-hero p:last-child { max-width: 740px; color: var(--cw-muted); margin: 0; }
.cw-hero__actions, .cw-action-strip, .cw-inline-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.cw-hero__actions { align-items: flex-start; justify-content: flex-end; }
.cw-button { border: 0; border-radius: 11px; min-width: 44px; min-height: 44px; padding: 10px 16px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.cw-button:hover:not(:disabled) { transform: translateY(-1px); }
.cw-button:disabled { cursor: not-allowed; opacity: .48; }
.cw-button--primary { background: var(--cw-blue); color: white; box-shadow: 0 10px 24px rgba(59,54,242,.19); }
.cw-button--primary:hover:not(:disabled) { background: var(--cw-blue-dark); }
.cw-button--secondary { color: var(--cw-ink); background: white; border: 1px solid var(--cw-line); }
.cw-button--danger { color: #9d233b; background: #fff0f3; border: 1px solid #f7ccd5; }
.cw-workflow-disposition { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cw-line); }
.cw-workflow-disposition .cw-button,
#cw-workflow-cancellation-dialog .cw-button,
#cw-action-dialog .cw-button { min-height: 44px; }

.cw-feedback { margin: 0 0 18px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; border-radius: 13px; border: 1px solid; background: white; }
.cw-feedback strong { grid-row: span 2; }
.cw-feedback button { border: 0; background: transparent; cursor: pointer; font-weight: 800; }
.cw-feedback--success { border-color: #bbe2d3; color: #155d47; }
.cw-feedback--error { border-color: #f0bcc6; color: #92243a; }
.cw-feedback--warning { border-color: #e8cb86; color: #6f4b08; background: #fffaf0; }
.cw-command-retry .cw-button { min-height: 44px; padding: 9px 13px; border: 1px solid currentColor; background: #fff; }

.cw-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cw-metric { background: var(--cw-surface); border: 1px solid var(--cw-line); border-radius: 15px; padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; box-shadow: 0 7px 22px rgba(25,24,52,.035); }
.cw-metric span { color: var(--cw-muted); font-size: 13px; font-weight: 700; }
.cw-metric strong { font-size: 25px; }
.cw-metric--blue strong { color: var(--cw-blue); }
.cw-metric--amber strong { color: var(--cw-amber); }
.cw-metric--red strong { color: var(--cw-red); }
.cw-metric--green strong { color: var(--cw-green); }
.cw-lifecycle-strip { grid-column: 1 / -1; padding: 10px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; border: 1px solid var(--cw-line); border-radius: 12px; background: #f8f8fc; }
.cw-lifecycle-strip > strong { font-size: 13px; }
.cw-lifecycle-strip dl { min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.cw-lifecycle-strip dl div { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cw-lifecycle-strip dt, .cw-lifecycle-strip small { color: var(--cw-muted); font-size: 11px; }
.cw-lifecycle-strip dd { margin: 0; font-size: 12px; font-weight: 850; white-space: nowrap; }
.cw-lifecycle-strip small { white-space: nowrap; }

.cw-workspace { min-height: 610px; display: grid; grid-template-columns: minmax(190px, 235px) minmax(340px, .86fr) minmax(460px, 1.3fr); gap: 14px; align-items: start; }
.cw-filters, .cw-case-list, .cw-detail { background: var(--cw-surface); border: 1px solid var(--cw-line); border-radius: 17px; box-shadow: 0 9px 30px rgba(25,24,52,.045); }
.cw-filters { padding: 17px; position: sticky; top: 90px; }
.cw-filters > summary { display: none; }
.cw-filters form, .cw-compact-form { display: grid; gap: 13px; }
.cw-filters label, .cw-form-grid label, .cw-compact-form label, #cw-decision-note-field { display: grid; gap: 6px; color: #4e556c; font-size: 12px; font-weight: 800; }
.cw-filters input, .cw-filters select, .cw-form-grid input, .cw-form-grid select, .cw-form-grid textarea, .cw-compact-form input, #cw-decision-note-field textarea { width: 100%; border: 1px solid #dfe1eb; border-radius: 9px; background: white; color: var(--cw-ink); padding: 9px 10px; font-weight: 500; }
.cw-filters form > div { display: grid; gap: 8px; }
.cw-filters > p { margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--cw-line); color: var(--cw-muted); font-size: 12px; }
.cw-link-button { appearance: none; padding: 4px 0; border: 0; background: transparent; color: var(--cw-blue); font-size: 12px; font-weight: 800; cursor: pointer; }
.cw-link-button--danger { color: var(--cw-red); }

.cw-case-list { min-height: 610px; overflow: hidden; }
.cw-case-list > header, .cw-detail__header { padding: 18px 19px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--cw-line); }
.cw-case-list h2, .cw-detail h2 { margin: 0; font-family: var(--font-display); letter-spacing: -.025em; }
.cw-case-list > header > span { min-width: 29px; height: 29px; padding: 0 8px; border-radius: 15px; display: grid; place-items: center; background: #eeedff; color: var(--cw-blue-dark); font-weight: 800; font-size: 12px; }
.cw-case-list ol { list-style: none; padding: 8px; margin: 0; max-height: 690px; overflow: auto; }
.cw-case-list li + li { margin-top: 5px; }
.cw-case-list__pagination { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--cw-line); color: var(--cw-muted); font-size: 12px; }
.cw-case { width: 100%; padding: 14px; text-align: left; border: 1px solid transparent; border-radius: 12px; background: transparent; display: grid; gap: 6px; cursor: pointer; color: var(--cw-ink); }
.cw-case:is(button):hover { background: #f8f8fd; }
.cw-case.is-selected { background: #f0efff; border-color: #cfccff; box-shadow: inset 3px 0 var(--cw-blue); }
.cw-case strong { font-size: 15px; }
.cw-case > span:not(.cw-case__topline), .cw-case small { color: var(--cw-muted); }
.cw-case small { font-size: 11px; }
.cw-case__topline { display: flex; justify-content: space-between; align-items: center; }
.cw-case__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 3px; }
.cw-case__facts > span { min-width: 0; display: grid; gap: 2px; }
.cw-case__facts small, .cw-case__guidance small, .cw-case__blocker small { color: var(--cw-muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cw-case__facts b, .cw-case__guidance b, .cw-case__blocker b { color: var(--cw-ink); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.cw-case__facts .is-overdue b { color: var(--cw-red); }
.cw-case__guidance, .cw-case__blocker { display: grid; gap: 3px; padding: 9px 10px; border-radius: 9px; text-align: left; }
.cw-case__guidance { border: 1px solid #d5d2ff; background: #f7f6ff; }
.cw-case__guidance--outcome { border-color: #c8e5da; background: #eef9f5; }
.cw-case__blocker { border: 1px solid #efd49d; background: #fff9ec; }
.cw-case__blocker b { color: #754a08; }
.cw-case__open { justify-self: end; color: var(--cw-blue) !important; font-size: 12px; font-weight: 850; }
.cw-case__open--unavailable { color: var(--cw-muted) !important; }
.cw-pill, .cw-state { display: inline-flex; width: max-content; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 850; letter-spacing: .02em; }
.cw-pill--low { color: #28715b; background: #e5f7ef; }
.cw-pill--normal { color: #526079; background: #eef0f5; }
.cw-pill--high { color: #a35b00; background: #fff1d9; }
.cw-pill--critical { color: #a3213a; background: #ffe8ed; }
.cw-state { color: #3f4962; background: #eceef4; }
.cw-state--in_progress { color: var(--legacy-blue, #1300ff); background: var(--legacy-blue-soft, #eceaff); }
.cw-state--active, .cw-state--current { color: var(--legacy-blue, #1300ff); background: var(--legacy-blue-soft, #eceaff); }
.cw-state--blocked, .cw-state--manual_review { color: #855000; background: #fdf1dc; }
.cw-state--completed { color: #197054; background: #e2f5ed; }
.cw-state--failed { color: #9b1c1c; background: #fbe4e4; }
.cw-state--pending { color: #526079; background: #eef0f5; }
.cw-state--skipped { color: #545a68; background: #e6e7eb; }
.cw-state--waiting { color: #996000; background: #fff0d4; }
.cw-state--exception { color: #a5223c; background: #ffe5ea; }
.cw-state--resolved { color: #197054; background: #e2f5ed; }
.cw-state--cancelled { color: #545a68; background: #e6e7eb; }

.cw-detail { min-height: 610px; overflow: hidden; }
.cw-detail--empty { display: grid; place-items: center; padding: 50px; text-align: center; }
.cw-detail--empty > div { max-width: 370px; }
.cw-detail--empty span, .cw-empty > span { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 15px; border-radius: 16px; background: #ecebff; color: var(--cw-blue); font-size: 24px; }
.cw-detail--empty p, .cw-empty p { color: var(--cw-muted); line-height: 1.55; }
.cw-detail__header > div { min-width: 0; }
.cw-detail__header h2 { overflow-wrap: anywhere; }
.cw-detail__header p:last-child { color: var(--cw-muted); margin: 5px 0 0; }
.cw-icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--cw-line); background: white; color: var(--cw-muted); cursor: pointer; font-size: 21px; }
.cw-detail__badges { padding: 13px 19px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cw-detail__badges > span:last-child { margin-left: auto; color: var(--cw-muted); font-size: 11px; }
.cw-alert { margin: 14px 19px 0; padding: 12px 14px; border-radius: 11px; background: #fff0f3; color: #93223a; border: 1px solid #f3c4ce; }
.cw-alert p { margin: 4px 0 0; }
.cw-facts { margin: 14px 19px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cw-facts div { padding: 10px 12px; border-radius: 10px; background: #f8f8fb; }
.cw-facts dt, .cw-next span { color: var(--cw-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.cw-facts dd { margin: 4px 0 0; font-size: 13px; font-weight: 750; }
/* Full border, not a left stripe: the accent belongs to the whole callout. */
.cw-next { margin: 0 19px 14px; padding: 12px 14px; border: 1px solid var(--cw-blue); background: #f5f4ff; border-radius: 10px; }
.cw-next p { margin: 4px 0 0; }
.cw-case-flow { margin: 0 19px 16px; overflow: hidden; border: 1px solid #dcdbfb; border-radius: 13px; background: #fbfaff; }
.cw-case-flow > header, .cw-case-flow > footer { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cw-case-flow > header { border-bottom: 1px solid #e7e5ff; }
.cw-case-flow > header h3 { margin: 0; font-family: var(--font-display); font-size: 16px; letter-spacing: -.02em; }
.cw-case-flow > footer { border-top: 1px solid #e7e5ff; }
.cw-case-flow .cw-button, .cw-case-flow > footer .cw-link-button { min-height: 44px; }
.cw-case-flow > footer .cw-link-button { display: inline-flex; align-items: center; }
.cw-case-flow__lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; background: #e7e5ff; }
.cw-case-flow__lanes > li { min-width: 0; padding: 13px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; background: white; }
.cw-case-flow__lanes > li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #eeedff; color: var(--cw-blue-dark); font-size: 10px; font-weight: 850; }
.cw-case-flow__lanes div { min-width: 0; }
.cw-case-flow__lanes small { display: block; margin-bottom: 4px; color: var(--cw-muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cw-case-flow__lanes strong, .cw-case-flow__lanes p { overflow-wrap: anywhere; }
.cw-case-flow__lanes strong { display: block; font-size: 12px; line-height: 1.35; }
.cw-case-flow__lanes p { margin: 4px 0 0; color: var(--cw-muted); font-size: 11px; line-height: 1.4; }
.cw-case-flow__action--blocked { box-shadow: inset 0 3px #d78814; }
.cw-case-flow__action--ready { box-shadow: inset 0 3px var(--cw-green); }
.cw-case-flow__action--complete { box-shadow: inset 0 3px var(--cw-blue); }
.cw-case-flow__action--cancelled { box-shadow: inset 0 3px var(--cw-amber); background: #fff9e9 !important; }
.cw-case-flow__action--failed,
.cw-case-flow__action--conflict { box-shadow: inset 0 3px var(--cw-red); background: #fff7f8 !important; }
.cw-case-flow__blocked { margin: 12px 0 0; padding: 13px 15px; border: 1px solid #eccf8a; border-radius: 12px; background: #fdf6e7; }
.cw-case-flow__blocked--provider { border-color: #c9d4f2; background: #eff2fd; }
.cw-case-flow__blocked--human { border-color: #eccf8a; background: #fdf6e7; }
.cw-case-flow__blocked--data { border-color: #d9d5ea; background: #f6f5fb; }
.cw-case-flow__blocked-head { margin: 0 0 7px; color: #5c4a2e; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.cw-case-flow__blocked--provider .cw-case-flow__blocked-head { color: #232063; }
.cw-case-flow__blocked-kind { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #6f4b08; background: #f7e6c0; }
.cw-case-flow__blocked--provider .cw-case-flow__blocked-kind { color: #232063; background: #dcdcff; }
.cw-case-flow__blocked--data .cw-case-flow__blocked-kind { color: #45407a; background: #e6e3f5; }
.cw-case-flow__blocked-list { margin: 0; padding-left: 18px; color: #5c4a2e; font-size: 13px; line-height: 1.5; }
.cw-case-flow__blocked--provider .cw-case-flow__blocked-list { color: #2f2c55; }
.cw-case-flow__blocked-list li + li { margin-top: 3px; }
.cw-case-flow__blocked-hint { margin: 9px 0 0; color: var(--cw-muted); font-size: 12px; line-height: 1.5; }
.cw-case-flow__blocked-actions { margin: 11px 0 0; }
.cw-case-flow__blocked-actions .cw-button { min-height: 40px; padding: 9px 15px; font-size: 13px; }
/* Ready-step advance: a calm, positive affordance (not the amber block tone) —
   the step is workable and one click carries it forward. */
.cw-case-flow__advance { margin: 12px 0 0; padding: 13px 15px; border: 1px solid #c9d4f2; border-radius: 12px; background: #eff2fd; }
.cw-case-flow__advance-hint { margin: 0; color: #2f2c55; font-size: 12px; line-height: 1.5; }
.cw-case-flow__advance-actions { margin: 11px 0 0; }
.cw-case-flow__advance-actions .cw-button { min-height: 40px; padding: 9px 15px; font-size: 13px; }
.cw-case-flow__message { padding: 16px 14px; color: var(--cw-muted); font-size: 12px; line-height: 1.5; }
.cw-case-flow__message p { margin: 4px 0 12px; }
.cw-case-flow-note { margin: 0 19px 14px; min-height: 44px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--cw-line); border-radius: 10px; color: var(--cw-muted); background: #f8f8fb; font-size: 12px; }
.cw-case-flow__siblings { padding: 11px 14px; border-top: 1px solid #ecebfa; }
.cw-case-flow__siblings > p { margin: 0 0 8px; color: var(--cw-muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cw-case-flow__siblings ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cw-case-flow__siblings button { width: 100%; min-height: 44px; padding: 8px 10px; display: grid; gap: 2px; text-align: left; border: 1px solid var(--cw-line); border-radius: 10px; background: white; color: var(--cw-ink); cursor: pointer; }
.cw-case-flow__siblings button:hover { border-color: #bbb8ff; background: #f7f6ff; }
.cw-case-flow__siblings button[aria-current="true"] { border-color: #9d99ff; box-shadow: inset 3px 0 var(--cw-blue); background: #f3f2ff; }
.cw-case-flow__siblings button span { font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.cw-case-flow__siblings button small { color: var(--cw-muted); font-size: 10px; }
.cw-case-flow__conflict { margin: 0; color: var(--cw-red); font-size: 12px; font-weight: 750; line-height: 1.4; }
.cw-terminal-evidence { margin: 12px 14px; padding: 12px 13px; border: 1px solid #f0c7d0; border-radius: 10px; background: #fff7f8; color: var(--cw-ink); }
.cw-terminal-evidence > strong { color: #92243a; }
.cw-terminal-evidence dl { display: grid; gap: 7px; margin: 8px 0 0; }
.cw-terminal-evidence dl div { display: grid; grid-template-columns: minmax(80px, .35fr) minmax(0, 1fr); gap: 8px; }
.cw-terminal-evidence dt { color: var(--cw-muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.cw-terminal-evidence dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.cw-terminal-evidence--missing { color: #92243a; }
.cw-terminal-evidence--missing p { margin: 5px 0 0; font-size: 12px; line-height: 1.45; }
.cw-action-strip { padding: 0 19px 16px; }
.cw-action-strip .cw-button { min-height: 44px; padding: 8px 11px; font-size: 11px; }
.cw-action-strip--terminal .cw-button { min-height: 44px; }
.cw-more-actions { flex: 1 1 100%; }
.cw-more-actions summary { width: max-content; min-height: 44px; display: inline-flex; align-items: center; color: var(--cw-muted); cursor: pointer; font-size: 12px; font-weight: 800; }
.cw-more-actions > div { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 2px; }
.cw-commitment-fulfill { min-height: 44px; }
.cw-readonly-note { margin: 10px 0 0; color: var(--cw-muted); font-size: 13px; }

.cw-panel { border-top: 1px solid var(--cw-line); }
.cw-panel summary { padding: 14px 19px; cursor: pointer; font-weight: 800; }
.cw-panel summary span { float: right; min-width: 24px; padding: 2px 6px; text-align: center; border-radius: 10px; background: #efeff5; color: var(--cw-muted); font-size: 10px; }
.cw-panel__body { padding: 0 19px 18px; }
.cw-empty-inline { color: var(--cw-muted); font-size: 12px; }
.cw-record-list, .cw-timeline { list-style: none; padding: 0; margin: 0 0 14px; }
.cw-record-list li { padding: 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f0f1f5; }
.cw-record-list div:first-child { display: grid; gap: 2px; }
.cw-record-list small { color: var(--cw-muted); }
.cw-timeline li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; position: relative; padding-bottom: 13px; }
.cw-timeline li > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #eeedff; color: var(--cw-blue); font-size: 10px; font-weight: 850; }
.cw-timeline li > div { display: grid; }
.cw-timeline small { color: var(--cw-muted); }
.cw-compact-form { margin-top: 12px; padding: 13px; background: #f8f8fb; border-radius: 11px; }
.cw-confirm, .cw-checkbox { display: flex !important; grid-column: 1 / -1; flex-direction: row !important; align-items: flex-start; gap: 9px !important; color: var(--cw-ink) !important; line-height: 1.45; }
.cw-confirm input, .cw-checkbox input { width: 17px !important; height: 17px; margin: 1px 0 0; accent-color: var(--cw-blue); }

.cw-loading { min-height: 0; padding: 18px 22px; color: var(--cw-muted); font-size: 12px; }
.cw-empty { min-height: 0; padding: 26px 22px; display: grid; place-content: center; text-align: center; color: var(--cw-muted); }
.cw-empty--error .cw-button { justify-self: center; margin-top: 6px; }
.cw-denied { min-height: 100vh; max-width: 640px; margin: auto; padding: 60px 25px; display: grid; place-content: center; justify-items: start; }
.cw-denied h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.04; letter-spacing: -.04em; }
.cw-denied > span { width: 50px; height: 50px; }

.cw-dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 36px); padding: 0; border: 1px solid var(--cw-line); border-radius: 18px; color: var(--cw-ink); box-shadow: 0 30px 90px rgba(20,20,50,.25); }
.cw-dialog [hidden] { display: none !important; }
.cw-dialog::backdrop { background: rgba(14,15,31,.56); backdrop-filter: blur(4px); }
.cw-dialog form > header { position: sticky; top: 0; z-index: 2; padding: 19px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--cw-line); background: rgba(255,255,255,.96); }
.cw-dialog h2 { margin: 0; font-family: var(--font-display); }
.cw-form-grid { padding: 19px 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cw-form-grid__wide { grid-column: 1 / -1; }
.cw-evidence { margin: 0 22px 18px; padding: 14px; border: 1px solid #deddf9; border-radius: 12px; background: #f7f6ff; }
.cw-evidence p { margin: 5px 0; color: var(--cw-muted); font-size: 12px; }
.cw-evidence details { margin-top: 10px; }
.cw-evidence .cw-form-grid { padding: 12px 0 0; }
.cw-dialog form > #cw-decision-note-field, .cw-dialog form > #cw-action-copy { margin: 0 22px 18px; }
.cw-dialog footer { position: sticky; bottom: 0; padding: 15px 22px; display: flex; justify-content: flex-end; gap: 9px; background: rgba(255,255,255,.97); border-top: 1px solid var(--cw-line); }
.cw-dialog--action { width: min(610px, calc(100vw - 28px)); }
html[data-cw-pending="true"] button, html[data-cw-pending="true"] input, html[data-cw-pending="true"] select, html[data-cw-pending="true"] textarea { pointer-events: none; }

@media (max-width: 1180px) {
  .cw-workspace { grid-template-columns: 210px minmax(330px, 1fr); }
  .cw-detail { grid-column: 1 / -1; }
  .cw-filters { position: static; }
}

@media (max-width: 760px) {
  .cw-app > .ashell { padding: 14px 14px 12px; }
  .cw-main { padding: 24px 14px 45px; }
  .cw-hero { align-items: start; flex-direction: column; }
  .cw-hero__actions { width: 100%; }
  .cw-hero__actions .cw-button { flex: 1; }
  .cw-recovery-actions { flex: 1 1 100%; }
  .cw-recovery-actions > summary { width: 100%; }
  .cw-recovery-actions > div { position: static; width: 100%; margin-top: 8px; }
  .cw-case__facts { grid-template-columns: 1fr; }
  .cw-metrics { grid-template-columns: repeat(2, 1fr); }
  .cw-metric:first-child { grid-column: span 2; }
  .cw-lifecycle-strip { grid-template-columns: 1fr; gap: 8px; }
  .cw-lifecycle-strip dl { grid-template-columns: 1fr; gap: 6px; }
  .cw-lifecycle-strip small { white-space: normal; }
  .cw-workspace { grid-template-columns: 1fr; }
  .cw-filters { padding: 0; position: static; }
  .cw-filters > summary { min-height: 48px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 800; list-style: none; }
  .cw-filters > summary::-webkit-details-marker { display: none; }
  .cw-filters > summary::after { content: "+"; color: var(--cw-blue); font-size: 20px; line-height: 1; }
  .cw-filters[open] > summary { border-bottom: 1px solid var(--cw-line); }
  .cw-filters[open] > summary::after { content: "−"; }
  .cw-filters > form { padding: 16px; }
  .cw-filters > p { margin: 0 16px 16px; }
  .cw-case-list, .cw-detail { min-height: 0; }
  .cw-case-list__pagination { align-items: stretch; flex-direction: column; }
  .cw-case-list__pagination .cw-button { width: 100%; }
  .cw-detail { grid-column: auto; }
  .cw-facts, .cw-form-grid { grid-template-columns: 1fr; }
  .cw-case-flow__lanes { grid-template-columns: 1fr; }
  .cw-case-flow__siblings ul { grid-template-columns: 1fr; }
  .cw-case-flow > footer { align-items: stretch; flex-direction: column; }
  .cw-form-grid__wide { grid-column: auto; }
  .cw-dialog form > header, .cw-form-grid, .cw-dialog footer { padding-left: 16px; padding-right: 16px; }
  .cw-evidence, .cw-dialog form > #cw-decision-note-field, .cw-dialog form > #cw-action-copy { margin-left: 16px; margin-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* --- Wave D: the verification queue over review-pending automation dispatches -------------
   A second list panel in the same middle column, so the Leitstand keeps one workspace grid
   instead of growing a fourth column that would squeeze the case list on laptops. */
.cw-workspace__lists { display: grid; gap: 10px; align-content: start; min-width: 0; }
.cw-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--cw-line); border-radius: 14px; background: var(--cw-surface); box-shadow: 0 9px 30px rgba(25,24,52,.045); }
.cw-tab { flex: 1; min-width: 44px; min-height: 44px; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--cw-muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.cw-tab:hover { color: var(--cw-ink); background: #f4f4fb; }
.cw-tab.is-active { color: var(--cw-blue-dark); background: #eeedff; border-color: #dcdbfb; }
.cw-tab > span { min-width: 24px; height: 21px; padding: 0 7px; display: grid; place-items: center; border-radius: 11px; background: #eeedff; color: var(--cw-blue-dark); font-size: 12px; font-weight: 800; }
.cw-tab.is-active > span { background: var(--cw-surface); }
/* Severity is never colour alone: the badge shows an explicit exclamation mark on failure. */
.cw-tab__badge--error { background: #fbe9ec !important; color: var(--cw-red) !important; }
.cw-specialist-return { display: flex; }
.cw-recovery-actions { position: relative; }
.cw-recovery-actions > summary { list-style: none; }
.cw-recovery-actions > summary::-webkit-details-marker { display: none; }
.cw-recovery-actions[open] > summary { border-color: #bbb8ff; background: #f4f3ff; }
.cw-recovery-actions > div { position: absolute; z-index: 5; right: 0; top: calc(100% + 8px); width: min(330px, calc(100vw - 28px)); padding: 12px; border: 1px solid var(--cw-line); border-radius: 12px; background: var(--cw-surface); box-shadow: 0 16px 40px rgba(25,24,52,.14); }
.cw-recovery-actions > div p { margin: 8px 2px 0; color: var(--cw-muted); font-size: 12px; line-height: 1.45; }
.cw-workflow-list-actions { padding: 12px 19px; border-bottom: 1px solid var(--cw-line); }
.cw-workflow-progress { color: var(--cw-muted); font-size: 12px; font-weight: 800; }
.cw-workflow-meter { padding: 13px 19px 0; }
.cw-workflow-meter progress { width: 100%; height: 9px; accent-color: var(--cw-blue); }
.cw-workflow-milestones { padding: 16px 19px 20px; }
.cw-workflow-milestones h3 { margin: 0 0 13px; font-family: var(--font-display); }
.cw-workflow-milestones ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cw-workflow-milestones li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 11px; border: 1px solid var(--cw-line); border-radius: 11px; }
.cw-workflow-milestones li.is-current { border-color: #bbb8ff; background: #f7f6ff; }
.cw-workflow-milestones p { margin: 5px 0 7px; color: var(--cw-muted); line-height: 1.45; }
.cw-workflow-milestone-meta { font-size: 12px; }
.cw-blocker-list { display: grid; gap: 8px; margin: 9px 0 0; padding: 0; list-style: none; }
.cw-blocker-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cw-dialog-copy { margin: 0 22px 18px; color: var(--cw-muted); line-height: 1.5; }
.cw-queue-panel .cw-queue__lead { margin: 0; padding: 11px 19px; border-bottom: 1px solid var(--cw-line); color: var(--cw-muted); font-size: 12px; }
.cw-queue-panel .cw-feedback { margin: 14px; }
.cw-queue { list-style: none; padding: 8px; margin: 0; max-height: 690px; overflow: auto; }
.cw-queue__item { padding: 13px 14px; border: 1px solid var(--cw-line); border-radius: 13px; background: var(--cw-surface); }
.cw-queue__item + .cw-queue__item { margin-top: 7px; }
.cw-queue__item > strong { display: block; margin: 9px 0 2px; font-size: 15px; letter-spacing: -.01em; }
.cw-queue__topline { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.cw-queue__topline small { margin-left: auto; color: var(--cw-muted); font-size: 12px; }
.cw-queue__params { margin: 0 0 9px; color: var(--cw-muted); font-size: 12px; font-family: var(--font-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.cw-queue__facts { margin: 0 0 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.cw-queue__facts div { min-width: 0; }
.cw-queue__facts dt { color: var(--cw-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cw-queue__facts dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.cw-queue__evidence { margin: 0 0 11px; padding: 9px 11px; border-left: 3px solid #dcdbfb; border-radius: 0 9px 9px 0; background: #f7f6ff; color: var(--cw-ink); font-size: 12px; }
.cw-queue .cw-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.cw-ai-suggestion { padding: 18px 19px 20px; background: #fbfbff; }
.cw-ai-suggestion > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.cw-ai-suggestion > header h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.cw-ai-source { margin-top: 14px; padding: 13px 14px; border: 1px solid #e0e1ec; border-radius: 11px; background: white; }
.cw-ai-source > p { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cw-ai-source > p span { color: var(--cw-muted); font-size: 12px; }
.cw-ai-source blockquote { margin: 10px 0 0; padding: 0; color: #3d4558; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.cw-ai-suggestion__body { margin-top: 12px; display: grid; gap: 12px; }
.cw-ai-suggestion__facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cw-ai-suggestion__facts div { min-width: 0; padding: 10px 11px; border-radius: 9px; background: #f0f1f7; }
.cw-ai-suggestion__facts dt, .cw-ai-proposal > span, .cw-ai-guidance > span, .cw-ai-owner > span { color: var(--cw-muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cw-ai-suggestion__facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.cw-ai-proposal { padding: 12px 13px; border: 1px solid #d8d6fb; border-radius: 10px; background: #f5f4ff; }
.cw-ai-proposal strong { display: block; margin-top: 4px; line-height: 1.45; }
.cw-ai-proposal p { margin: 6px 0 0; color: var(--cw-muted); font-size: 12px; line-height: 1.45; }
.cw-ai-draft { border: 1px solid #e0e1ec; border-radius: 10px; background: white; }
.cw-ai-draft summary { min-height: 44px; padding: 11px 13px; display: flex; align-items: center; }
.cw-ai-draft > div { padding: 0 13px 13px; }
.cw-ai-draft p { margin: 6px 0 0; color: #3d4558; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.cw-ai-provenance { margin: 12px 0 0; color: var(--cw-muted); font-size: 11px; overflow-wrap: anywhere; }
.cw-ai-outcome { margin: 12px 0 0; color: #245f4b; font-weight: 750; line-height: 1.5; }
.cw-ai-guidance { margin: 13px 0; padding: 12px 13px; display: grid; gap: 4px; border: 1px solid var(--cw-blue); border-radius: 10px; background: white; }
.cw-ai-guidance strong { line-height: 1.4; }
.cw-ai-suggestion > .cw-alert { margin: 12px 0; }
.cw-ai-suggestion > .cw-action-strip { padding: 0; }
.cw-ai-review-actions .cw-button { flex: 1 1 120px; }
.cw-ai-classification-form { margin-top: 15px; padding-top: 15px; border-top: 1px solid #dcdeea; }
.cw-ai-classification-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.cw-ai-classification-form legend { padding: 0; font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.cw-ai-classification-form fieldset > p { margin: 6px 0 0; color: var(--cw-muted); font-size: 12px; line-height: 1.5; }
.cw-ai-classification-form .cw-form-grid { padding: 14px 0; }
.cw-ai-classification-form .cw-action-strip { padding: 0; }
.cw-ai-classification-form .cw-action-strip .cw-button { min-height: 44px; }
.cw-ai-owner { min-height: 64px; padding: 10px 11px; display: grid; align-content: center; gap: 4px; border: 1px solid #e0e1ec; border-radius: 9px; background: #f8f8fb; }
.cw-ai-owner strong { font-size: 13px; }

@media (max-width: 1180px) {
  .cw-workspace__lists { grid-column: 2 / 3; }
}

@media (max-width: 760px) {
  .cw-workspace__lists { grid-column: auto; }
  .cw-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cw-tab { min-width: 44px; }
  .cw-queue__facts { grid-template-columns: 1fr; }
  .cw-queue-panel { min-height: 0; }
  .cw-ai-suggestion { padding-left: 16px; padding-right: 16px; }
  .cw-ai-suggestion > header, .cw-ai-source > p { align-items: flex-start; flex-direction: column; }
  .cw-ai-suggestion__facts { grid-template-columns: 1fr; }
  .cw-ai-review-actions { align-items: stretch; flex-direction: column; }
  .cw-ai-review-actions .cw-button { flex-basis: 44px; width: 100%; }
}

/* Kennzahlen strip: same chrome as the lifecycle strip, but its notes are
   sentences — each tile stacks label over value over a wrapping note instead
   of inheriting the lifecycle row's nowrap number layout. */
.cw-kennzahlen-strip { align-items: start; }
.cw-kennzahlen-strip dl div { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; }
.cw-kennzahlen-strip dd { white-space: normal; }
.cw-kennzahlen-strip dd small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--cw-muted); line-height: 1.4; white-space: normal; }

/* Takeover reconciliation panel (goal-14 read surface). */
.cw-takeover { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.cw-takeover__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.cw-takeover__head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.cw-takeover__run { padding: 14px 16px; border: 1px solid var(--cw-line); border-radius: 12px; background: #fbfbfe; }
.cw-takeover__run > header { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 6px; }
.cw-takeover__run > header span { color: var(--cw-muted); font-size: 13px; }
.cw-takeover__run h4 { margin: 10px 0 4px; font-size: 13px; }
.cw-takeover__run ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; }
.cw-takeover__run p { margin: 0; color: var(--cw-muted); font-size: 13.5px; }
