/* Business workspace. Keep these styles local to the workspace and its dialogs. */
.bw {
  --bw-canvas: #fafbf8;
  --bw-surface: #ffffff;
  --bw-surface-soft: #f4f6f1;
  --bw-ink: #253d33;
  --bw-muted: #617269;
  --bw-line: #dfe6dc;
  --bw-line-strong: #c3d2c5;
  --bw-green: #155c47;
  --bw-green-hover: #104735;
  --bw-green-soft: #edf4ee;
  --bw-danger: #9d3536;
  --bw-radius: 13px;
  color-scheme: light;
  width: 100%;
  max-width: 1380px;
  min-width: 0;
  margin: 0 auto;
  padding: 36px 40px 56px;
  color: var(--bw-ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.bw *,
.bw *::before,
.bw *::after {
  box-sizing: border-box;
}

.bw :where(h1, h2, h3, h4, p, dl, dd, pre) { margin: 0; }
.bw :where(h1, h2, h3, h4) { color: var(--bw-ink); }
.bw :where(button, input, select, textarea) { font: inherit; }
.bw :where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid #2e785d;
  outline-offset: 3px;
}
.bw [hidden] { display: none !important; }
.view.business-view { max-width:none; padding:0; }
.bw.bw-scope { padding-bottom:0; }
.bw.bw-scope + .bw { padding-top:22px; }
.business-context-note { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:0 0 16px; color:#617269; font-size:12px; }
.business-context-note strong { color:#253d33; font-weight:600; }
.business-context-note .text-button { margin-left:auto; font-size:12px; }
.bw.bw-task-browser { padding:14px 16px; margin:0 0 16px; border:1px solid #dfe6dc; border-radius:10px; background:#fff; }
.bw .bw-task-browser-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.bw .bw-task-browser-list { display:grid; gap:8px; margin-top:10px; }
.bw .bw-task-browser-option { display:flex; align-items:flex-start; gap:10px; border:1px solid var(--bw-line); padding:10px; border-radius:8px; }
.bw .bw-task-browser-option input { width:auto; margin-top:5px; }
.bw .bw-task-browser-option.is-selected { border-color:var(--bw-green); background:var(--bw-green-soft); }
.bw .bw-task-browser-option.is-unavailable { color:var(--bw-muted); }
.bw .bw-task-browser-id { display:block; color:var(--bw-muted); font-size:11px; overflow-wrap:anywhere; }
.bw .bw-screenshot { display:block; width:100%; height:auto; margin-top:12px; border:1px solid var(--bw-line); border-radius:8px; }

.bw .bw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.bw .bw-header > div:first-child { min-width: 0; }
.bw .bw-eyebrow,
.bw .bw-kicker {
  display: block;
  color: var(--bw-muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.bw .bw-eyebrow { margin-bottom: 9px; }
.bw .bw-header h1 {
  margin: 0;
  font-size: clamp(27px, 2.5vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.bw .bw-subtitle {
  max-width: 640px;
  margin-top: 11px;
  color: var(--bw-muted);
  font-size: 13px;
  line-height: 1.8;
}
.bw .bw-header-actions,
.bw .bw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bw .bw-header-actions { justify-content: flex-end; padding-top: 22px; }

.bw .bw-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 30px;
  padding: 5px;
  border: 1px solid var(--bw-line);
  border-radius: 12px;
  background: #f0f3ed;
}
.bw .bw-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5b6e60;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.bw .bw-nav-button:hover:not(:disabled) { color: var(--bw-green); background: #e7eee2; }
.bw .bw-nav-button[aria-current="page"] {
  border-color: #dce6d6;
  background: var(--bw-surface);
  color: var(--bw-green);
  font-weight: 650;
  box-shadow: 0 1px 3px #29432b08;
}
.bw .bw-content { min-width: 0; }
.bw .bw-content > * + * { margin-top: 22px; }
.bw .bw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 18px;
}
.bw .bw-toolbar > div:first-child { min-width: 0; }
.bw .bw-toolbar h2 { font-size: 18px; font-weight: 600; line-height: 1.4; letter-spacing: -.025em; }
.bw .bw-toolbar p { margin-top: 5px; }
.bw .bw-toolbar .bw-actions { margin-left: auto; }

.bw .bw-grid,
.bw .bw-grid-two,
.bw .bw-detail-grid {
  display: grid;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}
.bw .bw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bw .bw-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bw .bw-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bw .bw-card,
.bw .bw-node-card {
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--bw-line);
  border-radius: var(--bw-radius);
  background: var(--bw-surface);
  box-shadow: 0 2px 8px #233d2803;
}
.bw .bw-card > h2,
.bw .bw-card > h3,
.bw .bw-node-card > h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.02em;
}
.bw .bw-card > p,
.bw .bw-node-card > p { margin-top: 9px; }
.bw .bw-card > .bw-kicker:first-child { margin-bottom: 10px; }
.bw .bw-card > .bw-list { margin-top: 8px; }
.bw .bw-card > .bw-actions:last-child,
.bw .bw-node-card > .bw-actions:last-child { margin-top: 20px; }
.bw .bw-card .bw-toolbar { margin-bottom: 13px; }
.bw .bw-card .bw-toolbar h2 { font-size: 15px; }
.bw .bw-card > :last-child { margin-bottom: 0; }
.bw .bw-metric { min-width: 0; text-align: left; }
.bw button.bw-card:hover:not(:disabled) { border-color: #b1c8ac; background: #fcfdf9; }
.bw .bw-metric-value {
  display: block;
  margin: 12px 0 7px;
  color: var(--bw-ink);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 550;
  line-height: 1.1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.bw .bw-metric .bw-muted { font-size: 12px; }
.bw .bw-muted { color: var(--bw-muted); font-size: 12px; line-height: 1.7; }
.bw .bw-stack { display: grid; gap: 16px; min-width: 0; }

.bw .bw-list { display: flex; flex-direction: column; min-width: 0; }
.bw .bw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 18px 0;
  border-bottom: 1px solid #e9eee5;
}
.bw .bw-row:first-child { padding-top: 8px; }
.bw .bw-row:last-child { border-bottom: 0; padding-bottom: 8px; }
.bw .bw-row-main { flex: 1; min-width: 0; }
.bw .bw-row-main > p { margin-top: 6px; }
.bw .bw-row > .bw-actions { flex: 0 0 auto; justify-content: flex-end; }
.bw .bw-title {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--bw-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -.015em;
  text-align: left;
  overflow-wrap: anywhere;
}
.bw button.bw-title,
.bw a.bw-title { cursor: pointer; text-decoration: underline; text-decoration-color: #b6cdbb; text-underline-offset: 4px; }
.bw button.bw-title:hover,
.bw a.bw-title:hover { color: var(--bw-green); text-decoration-color: currentColor; }
.bw .bw-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin-top: 7px;
  color: var(--bw-muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.bw .bw-meta > * { min-width: 0; }
.bw .bw-meta small { font-size: inherit; }
.bw .bw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #dfe5dc;
  border-radius: 6px;
  background: #f3f5f0;
  color: #566758;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.bw .bw-badge[data-tone="good"] { border-color: #d0e3d3; background: #edf6ed; color: #2b663c; }
.bw .bw-badge[data-tone="warn"] { border-color: #ebddbe; background: #fcf5e5; color: #7d5a1c; }
.bw .bw-badge[data-tone="bad"] { border-color: #ecd4ce; background: #fbefeb; color: #973a30; }
.bw .bw-badge[data-tone="muted"] { border-color: #dfe5dc; background: #f3f5f0; color: #566758; }
.bw .bw-badge[data-tone="info"] { border-color: #cfe2de; background: #edf5f3; color: #2f6660; }

.bw :where(.bw-button, .bw-button-secondary, .bw-button-quiet, .bw-button-danger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms, border-color 140ms, color 140ms;
}
.bw .bw-button { border-color: var(--bw-green); background: var(--bw-green); color: #fff; }
.bw .bw-button:hover:not(:disabled) { border-color: var(--bw-green-hover); background: var(--bw-green-hover); }
.bw .bw-button-secondary { border-color: var(--bw-line-strong); background: #fff; color: #365744; }
.bw .bw-button-secondary:hover:not(:disabled) { border-color: #a8beaa; background: #f3f7ef; }
.bw .bw-button-quiet { border-color: transparent; background: transparent; color: var(--bw-green); }
.bw .bw-button-quiet:hover:not(:disabled) { border-color: transparent; background: #edf3e8; }
.bw .bw-button-danger { border-color: #e4c6c1; background: #fff; color: var(--bw-danger); }
.bw .bw-button-danger:hover:not(:disabled) { border-color: #d6aaa3; background: #fbefec; }
.bw :where(.bw-button, .bw-button-secondary, .bw-button-quiet, .bw-button-danger, .bw-nav-button):disabled,
.bw :where(.bw-button, .bw-button-secondary, .bw-button-quiet, .bw-button-danger)[aria-disabled="true"] {
  opacity: .55;
  box-shadow: none;
  cursor: not-allowed;
}
.bw .bw-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  vertical-align: middle;
  object-fit: contain;
}
.bw .bw-icon > svg,
.bw svg.bw-icon,
.bw .bw-icon > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bw .bw-link { color: var(--bw-green); font-weight: 600; text-decoration: underline; text-decoration-color: #9ebea8; text-underline-offset: 3px; overflow-wrap: anywhere; }
.bw .bw-link:hover { color: var(--bw-green-hover); text-decoration-color: currentColor; }
.bw .bw-separator { width: 100%; height: 1px; margin: 22px 0; border: 0; background: var(--bw-line); }

.bw .bw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 40px 24px;
  text-align: center;
}
.bw .bw-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  border: 1px solid #e0e8d8;
  border-radius: 12px;
  background: #f3f7ee;
  color: #54723f;
}
.bw .bw-empty-icon .bw-icon,
.bw .bw-empty-icon svg { width: 22px; height: 22px; flex-basis: 22px; }
.bw .bw-empty h2,
.bw .bw-empty h3 { font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.bw .bw-empty p { max-width: 440px; color: var(--bw-muted); font-size: 12px; line-height: 1.85; }
.bw .bw-empty .bw-actions { justify-content: center; margin-top: 6px; }
.bw .bw-notice,
.bw .bw-error,
.bw .bw-toast {
  padding: 14px 16px;
  border: 1px solid #d8e4d3;
  border-radius: 9px;
  background: #f2f6ee;
  color: #45603c;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.bw .bw-notice p + p { margin-top: 7px; }
.bw .bw-notice .bw-actions { margin-top: 12px; }
.bw .bw-notice[data-tone="good"] { border-color: #d0e3d3; background: #edf6ed; color: #2b663c; }
.bw .bw-notice[data-tone="warn"] { border-color: #ebddbe; background: #fcf5e5; color: #765721; }
.bw .bw-notice[data-tone="bad"],
.bw .bw-error { border-color: #ebd1cb; background: #fcf1ed; color: #913b31; }
.bw .bw-notice[data-tone="muted"] { border-color: var(--bw-line); background: var(--bw-surface-soft); color: #55665c; }
.bw .bw-notice[data-tone="info"] { border-color: #cfe2de; background: #edf5f3; color: #2f6660; }
.bw .bw-loading { display: grid; gap: 16px; min-height: 150px; padding: 16px 0; color: var(--bw-muted); }
.bw .bw-skeleton { min-height: 18px; border-radius: 6px; background: #eaf0e4; }
.bw .bw-skeleton + .bw-skeleton { width: 72%; }
.bw .bw-toast { margin-bottom: 20px; border-color: #cbdcc8; background: #edf5e8; color: #34582f; }
.bw .bw-toast:empty { display: none; }

.bw .bw-form { display: grid; gap: 20px; min-width: 0; }
.bw .bw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 18px; min-width: 0; }
.bw .bw-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bw .bw-field-wide { grid-column: 1 / -1; }
.bw .bw-field label { margin: 0; color: #37533f; font-size: 12px; font-weight: 600; line-height: 1.6; }
.bw .bw-field :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #809580;
  border-radius: 8px;
  background: #fff;
  color: var(--bw-ink);
  font-size: 12px;
  line-height: 1.7;
}
.bw .bw-field textarea { min-height: 104px; resize: vertical; }
.bw .bw-field :where(input, textarea)::placeholder { color: #667760; opacity: 1; }
.bw .bw-field :where(input, textarea, select):focus { border-color: #568267; outline: 2px solid #b8d2bc; outline-offset: 1px; }
.bw .bw-field :where(input, textarea, select):focus-visible { outline: 3px solid #2e785d; outline-offset: 2px; }
.bw .bw-field :where(input, textarea, select)[aria-invalid="true"] { border-color: #b95044; }
.bw .bw-field :where(input, textarea, select):disabled { background: #f1f4ed; color: #697b62; cursor: not-allowed; }
.bw .bw-help { color: var(--bw-muted); font-size: 11px; line-height: 1.75; }
.bw .bw-checkbox { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 3px 0; color: #45613f; font-size: 12px; font-weight: 500; line-height: 1.7; cursor: pointer; }
.bw .bw-checkbox input { width: 17px; height: 17px; min-height: 0; flex: 0 0 17px; margin: 2px 0 0; padding: 0; accent-color: var(--bw-green); }

/* Named resources and dependency choices stay usable inside workspace dialogs. */
.bw :where(.bw-resource-picker, .bw-dependencies) {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--bw-line);
  border-radius: 10px;
  background: var(--bw-surface);
}
.bw :where(.bw-resource-picker, .bw-dependencies) > legend {
  max-width: 100%;
  padding: 0 6px;
  color: var(--bw-ink);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.bw .bw-resource-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  min-width: 0;
  margin-bottom: 10px;
}
.bw .bw-resource-header > * { min-width: 0; }
.bw .bw-resource-header :where(h3, h4, label) { font-size: 12px; font-weight: 600; line-height: 1.6; }
.bw .bw-resource-search {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #809580;
  border-radius: 8px;
  background: var(--bw-surface);
  color: var(--bw-ink);
  font-size: 12px;
  line-height: 1.7;
}
.bw .bw-resource-search::placeholder { color: #667760; opacity: 1; }
.bw .bw-resource-search:disabled { background: var(--bw-surface-soft); color: var(--bw-muted); cursor: not-allowed; }
.bw .bw-resource-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  max-height: 260px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  list-style: none;
}
.bw .bw-resource-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--bw-line);
  border-radius: 8px;
  background: var(--bw-surface);
  color: var(--bw-ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}
.bw .bw-resource-option > :not(input) { min-width: 0; }
.bw .bw-resource-option input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-height: 0;
  flex: 0 0 19px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--bw-green);
  cursor: inherit;
}
.bw .bw-resource-option:hover:not(.is-unavailable) { border-color: var(--bw-line-strong); background: #fafcf7; }
.bw .bw-resource-option.is-selected,
.bw .bw-resource-option:has(input:checked) { border-color: var(--bw-green); background: var(--bw-green-soft); }
.bw .bw-resource-option:focus-within { border-color: var(--bw-green); }
.bw .bw-resource-name { display: block; color: var(--bw-ink); font-weight: 600; overflow-wrap: anywhere; }
.bw .bw-resource-meta { display: block; margin-top: 3px; color: var(--bw-muted); font-size: 11px; font-weight: 400; line-height: 1.7; overflow-wrap: anywhere; }
.bw .bw-resource-selected { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; min-width: 0; margin-top: 10px; color: var(--bw-muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.bw .bw-resource-option.is-unavailable { border-style: dashed; background: var(--bw-surface-soft); color: var(--bw-muted); }
.bw .bw-resource-option.is-unavailable .bw-resource-name { color: var(--bw-muted); }
.bw .bw-resource-option:has(input:disabled) { cursor: not-allowed; }
.bw .bw-resource-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--bw-line);
  border-radius: 8px;
  background: var(--bw-surface-soft);
  color: var(--bw-muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.bw .bw-resource-state > :first-child { min-width: 0; }
.bw .bw-resource-state:empty { display: none; }
.bw .bw-resource-state:is(.is-error, [data-state="error"], [role="alert"]) { border-color: #ebd1cb; background: #fcf1ed; color: #913b31; }
.bw .bw-dependencies > .bw-resource-option + .bw-resource-option { margin-top: 7px; }
.bw .bw-dependencies > .bw-help { margin-bottom: 8px; }

/* Stage arrows describe reading order; node text carries exact dependencies. */
.bw .bw-workflow-graph {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  border: 1px solid var(--bw-line);
  border-radius: 10px;
  background: var(--bw-surface-soft);
}
.bw .bw-workflow-graph > :where(h3, h4) { font-size: 13px; font-weight: 600; line-height: 1.6; }
.bw .bw-workflow-graph > .bw-help { margin-top: 5px; }
.bw .bw-graph-empty { padding: 16px 0; color: var(--bw-muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.bw .bw-graph-layers {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  align-items: stretch;
  gap: 30px;
  min-width: 0;
  margin: 12px 0 0;
  padding: 7px 7px 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  list-style: none;
}
.bw .bw-graph-layer { position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.bw .bw-graph-layer:not(:last-child)::before,
.bw .bw-graph-layer:not(:last-child)::after { position: absolute; top: 42px; content: ""; pointer-events: none; }
.bw .bw-graph-layer:not(:last-child)::before { right: -23px; width: 16px; border-top: 1px solid #819b86; }
.bw .bw-graph-layer:not(:last-child)::after { right: -23px; width: 6px; height: 6px; margin-top: -3px; border-top: 1px solid #819b86; border-right: 1px solid #819b86; transform: rotate(45deg); }
.bw .bw-graph-layer > :where(h3, h4, .bw-graph-layer-label) { margin: 0 0 2px; color: var(--bw-muted); font-size: 10px; font-weight: 650; line-height: 1.6; letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.bw .bw-graph-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--bw-line-strong);
  border-radius: 8px;
  background: var(--bw-surface);
  color: var(--bw-ink);
  font: inherit;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 3px #233d2806;
}
.bw button.bw-graph-node { cursor: pointer; }
.bw button.bw-graph-node:hover:not(:disabled) { border-color: var(--bw-green); background: #fafcf7; }
.bw .bw-graph-node:is(.is-selected, [aria-current="true"]) { border-color: var(--bw-green); background: var(--bw-green-soft); }
.bw .bw-graph-node:disabled { color: var(--bw-muted); cursor: not-allowed; }
.bw .bw-graph-node-title { display: block; min-width: 0; max-width: 100%; color: inherit; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.bw .bw-graph-meta { display: block; min-width: 0; max-width: 100%; color: var(--bw-muted); font-size: 11px; font-weight: 400; line-height: 1.7; overflow-wrap: anywhere; }
.bw :where(.bw-graph-error, .bw-graph-cycle) { margin-top: 12px; padding: 12px; border: 1px solid #ebd1cb; border-radius: 8px; background: #fcf1ed; color: #913b31; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.bw :where(.bw-graph-error, .bw-graph-cycle):first-child { margin-top: 0; }
.bw .bw-graph-node.bw-graph-cycle { margin-top: 0; border-color: #ce998f; background: #fff7f4; }
.bw .bw-node-card[data-node-index]:focus-within { border-color: var(--bw-green); }

.bw .bw-dialog {
  position: fixed;
  inset: 0;
  width: min(620px, calc(100vw - 40px));
  max-width: none;
  max-height: min(840px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d3dfce;
  border-radius: 16px;
  background: #fff;
  color: var(--bw-ink);
  box-shadow: 0 24px 80px #203a252b;
}
.bw .bw-dialog[open] { display: flex; flex-direction: column; }
.bw .bw-dialog > .bw-form { display: flex; flex: 1; flex-direction: column; gap: 0; min-height: 0; overflow: hidden; }
.bw .bw-dialog::backdrop { background: #233a2d59; }
.bw .bw-dialog-wide { width: min(920px, calc(100vw - 40px)); }
.bw .bw-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 28px 22px; border-bottom: 1px solid var(--bw-line); }
.bw .bw-dialog-header h2 { margin: 0; color: var(--bw-ink); font-size: 21px; font-weight: 600; line-height: 1.35; letter-spacing: -.035em; overflow-wrap: anywhere; }
.bw .bw-dialog-header p { margin-top: 7px; color: var(--bw-muted); font-size: 12px; }
.bw .bw-dialog-header > :last-child:not(:first-child) { flex-shrink: 0; }
.bw .bw-dialog-header .bw-button-quiet { min-width: 36px; min-height: 36px; padding: 8px; margin: -4px -8px -4px 0; }
.bw .bw-dialog-body { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 25px 28px; scrollbar-gutter: stable; }
.bw .bw-dialog-body > * + * { margin-top: 20px; }
.bw .bw-dialog-body > .bw-form { margin-top: 0; }
.bw .bw-dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--bw-line); background: #fafbf8; }
.bw .bw-dialog-footer .bw-help { margin-right: auto; max-width: 360px; }

.bw .bw-node-card { position: relative; padding: 20px; }
.bw .bw-node-card .bw-kicker { margin-bottom: 10px; }
.bw .bw-node-card .bw-meta { margin-top: 12px; }
.bw .bw-code,
.bw .bw-evidence-text {
  max-width: 100%;
  max-height: 360px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #dce5d5;
  border-radius: 8px;
  background: #f5f8f0;
  color: #40523a;
  font: 12px/1.85 Consolas, "SFMono-Regular", monospace;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bw .bw-code code { font: inherit; color: inherit; }
.bw .bw-evidence-text { max-height: 440px; background: #fcfdf9; }
.bw .bw-stat { min-width: 0; padding: 15px 16px; border: 1px solid var(--bw-line); border-radius: 9px; background: #f8faf5; }
.bw .bw-stat > span,
.bw .bw-stat > dt { display: block; color: var(--bw-muted); font-size: 10px; font-weight: 550; line-height: 1.6; }
.bw .bw-stat > strong,
.bw .bw-stat > dd { display: block; margin-top: 7px; color: #355336; font-size: 16px; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bw .bw-progress { display: block; width: 100%; height: 6px; margin-top: 14px; overflow: hidden; border: 0; border-radius: 4px; background: #e8efdf; accent-color: #527d4b; }
.bw .bw-progress > span,
.bw .bw-progress > div { display: block; height: 100%; border-radius: inherit; background: #527d4b; }
.bw progress.bw-progress::-webkit-progress-bar { border-radius: 4px; background: #e8efdf; }
.bw progress.bw-progress::-webkit-progress-value { border-radius: 4px; background: #527d4b; }
.bw progress.bw-progress::-moz-progress-bar { border-radius: 4px; background: #527d4b; }
.bw .bw-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 30px; border: 1px solid #dce6d3; border-radius: var(--bw-radius); background: #f0f5e9; }
.bw .bw-hero > div:first-child { min-width: 0; max-width: 710px; }
.bw .bw-hero .bw-kicker { margin-bottom: 10px; color: #587049; }
.bw .bw-hero h2 { font-size: 23px; font-weight: 550; line-height: 1.35; letter-spacing: -.035em; }
.bw .bw-hero p { margin-top: 10px; color: #5f7355; font-size: 12px; line-height: 1.85; }
.bw .bw-hero .bw-actions { flex-shrink: 0; }
.bw .bw-setup-options { padding: 15px 3px; color: var(--bw-muted); }
.bw .bw-setup-options summary { width: fit-content; cursor: pointer; font-size: 12px; }
.bw .bw-setup-options[open] summary { margin-bottom: 10px; }
.bw .bw-setup-options .bw-button { margin-top: 8px; }
.bw .bw-definition { display: grid; grid-template-columns: minmax(100px, .38fr) minmax(0, 1fr); gap: 13px 20px; min-width: 0; }
.bw .bw-definition > div { display: contents; }
.bw .bw-definition dt { color: var(--bw-muted); font-size: 12px; line-height: 1.8; }
.bw .bw-definition dd { margin: 0; color: var(--bw-ink); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.bw .bw-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.bw .bw-tabs button { min-height: 34px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--bw-muted); font-size: 11px; font-weight: 550; line-height: 1.6; }
.bw .bw-tabs button:hover:not(:disabled) { background: #eef3e8; color: var(--bw-green); }
.bw .bw-tabs button[aria-selected="true"],
.bw .bw-tabs button[aria-current="page"],
.bw .bw-tabs button.is-active { border-color: #d8e4cf; background: #edf4e7; color: #305e2c; font-weight: 650; }

@media (max-width: 1160px) {
  .bw { padding: 30px 30px 44px; }
  .bw .bw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bw .bw-grid .bw-metric:last-child:nth-child(3) { grid-column: 1 / -1; }
  .bw .bw-nav-button { padding-inline: 11px; }
  .bw .bw-hero { align-items: flex-start; }
  .bw .bw-hero .bw-actions { flex-shrink: 1; }
}

@media (max-width: 900px) {
  .bw .bw-header { gap: 20px; }
  .bw .bw-header-actions { max-width: 220px; }
  .bw .bw-grid-two { grid-template-columns: 1fr; }
  .bw .bw-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bw .bw-row { flex-wrap: wrap; gap: 12px; }
  .bw .bw-row > .bw-actions { flex: 1 1 100%; justify-content: flex-start; }
  .bw .bw-hero { flex-direction: column; gap: 20px; }
}

@media (max-width: 600px) {
  .bw { padding: 25px 20px 38px; }
  .bw .bw-header { flex-direction: column; gap: 17px; margin-bottom: 22px; }
  .bw .bw-header h1 { font-size: 28px; }
  .bw .bw-subtitle { font-size: 12px; line-height: 1.85; }
  .bw .bw-header-actions { max-width: none; padding-top: 0; justify-content: flex-start; }
  .bw .bw-nav { gap: 4px; padding: 4px; margin-bottom: 24px; }
  .bw .bw-nav-button { flex: 1 1 auto; min-height: 41px; padding: 10px; font-size: 11px; }
  .bw .bw-toolbar { align-items: flex-start; gap: 12px; }
  .bw .bw-toolbar h2 { font-size: 17px; }
  .bw .bw-toolbar .bw-actions { margin-left: 0; }
  .bw .bw-grid { grid-template-columns: 1fr; gap: 14px; }
  .bw .bw-grid .bw-metric:last-child:nth-child(3) { grid-column: auto; }
  .bw .bw-grid-two { gap: 14px; }
  .bw .bw-card { padding: 20px; }
  .bw .bw-row { padding: 17px 0; }
  .bw .bw-row-main { flex-basis: 100%; }
  .bw .bw-row > .bw-badge { margin-top: -3px; }
  .bw .bw-row > .bw-actions { flex-basis: auto; }
  .bw .bw-row > .bw-badge + .bw-actions { flex: 1; justify-content: flex-end; }
  .bw .bw-meta { gap: 5px 8px; font-size: 11px; }
  .bw :where(.bw-button, .bw-button-secondary, .bw-button-quiet, .bw-button-danger) { min-height: 43px; padding: 10px 12px; }
  .bw .bw-empty { min-height: 210px; padding: 30px 8px; }
  .bw .bw-form-grid { grid-template-columns: 1fr; gap: 17px; }
  .bw .bw-field-wide { grid-column: auto; }
  .bw .bw-field :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) { font-size: 16px; }
  .bw :where(.bw-resource-picker, .bw-dependencies) { padding: 12px; }
  .bw .bw-resource-search { font-size: 16px; }
  .bw .bw-resource-list { max-height: 230px; }
  .bw .bw-resource-option { padding: 11px 10px; }
  .bw .bw-workflow-graph { padding: 14px; }
  .bw .bw-graph-layers { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); gap: 27px; overflow-x: visible; }
  .bw .bw-graph-layer:not(:last-child)::before { top: auto; right: auto; bottom: -20px; left: 50%; width: 0; height: 13px; border-top: 0; border-left: 1px solid #819b86; }
  .bw .bw-graph-layer:not(:last-child)::after { top: auto; right: auto; bottom: -20px; left: calc(50% - 3px); margin-top: 0; transform: rotate(135deg); }
  .bw .bw-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bw .bw-stat { padding: 12px; }
  .bw .bw-stat > strong,
  .bw .bw-stat > dd { font-size: 14px; }
  .bw .bw-dialog,
  .bw .bw-dialog-wide { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 13px; }
  .bw .bw-dialog-header { gap: 12px; padding: 21px 20px 18px; }
  .bw .bw-dialog-header h2 { font-size: 19px; }
  .bw .bw-dialog-body { padding: 21px 20px; }
  .bw .bw-dialog-footer { padding: 16px 20px; }
  .bw .bw-dialog-footer .bw-help { flex-basis: 100%; max-width: none; }
  .bw .bw-hero { padding: 23px; }
  .bw .bw-hero h2 { font-size: 21px; }
  .bw .bw-definition { grid-template-columns: 1fr; gap: 4px; }
  .bw .bw-definition dd + dt,
  .bw .bw-definition > div + div > dt { margin-top: 11px; }
  .bw .bw-tabs button { min-height: 40px; }
}

@media (max-width: 380px) {
  .bw { padding-inline: 15px; }
  .bw .bw-card { padding: 17px; }
  .bw .bw-detail-grid { grid-template-columns: 1fr; }
  .bw .bw-header-actions,
  .bw .bw-header-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bw *,
  .bw *::before,
  .bw *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .bw button:active:not(:disabled) { transform: none; }
}

.bw .bw-page-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.7; padding: 20px; border: 1px solid var(--bw-line, #dfe5df); border-radius: 12px; background: #fafbf8; max-height: 55vh; overflow-y: auto; }
.bw .bw-version-changes { display: grid; gap: 16px; }
.bw .bw-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bw .bw-compare-grid > div { min-width: 0; }
.bw .bw-compare-grid pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow-y: auto; }
.bw .bw-header-actions { flex-wrap: wrap; }
.bw .bw-insight-monitoring { display: grid; gap: 12px; margin: 18px 0; }
.bw .bw-insight-monitoring > .bw-badge { justify-self: start; }
.bw .bw-schedule-toggle { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 0; font-size: 13px; }
.bw .bw-schedule-toggle input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--bw-green); }
@media (max-width: 600px) { .bw .bw-compare-grid { grid-template-columns: minmax(0, 1fr); } .bw .bw-page-preview { padding: 14px; } }

@media (forced-colors: active) {
  .bw .bw-badge,
  .bw .bw-progress,
  .bw .bw-nav-button[aria-current="page"] { border: 1px solid CanvasText; }
  .bw .bw-progress > span,
  .bw .bw-progress > div { background: Highlight; }
  .bw .bw-nav-button[aria-current="page"] { color: Highlight; }
  .bw .bw-resource-option:is(.is-selected, :has(input:checked)),
  .bw .bw-graph-node:is(.is-selected, [aria-current="true"]) { border-color: Highlight; }
  .bw .bw-graph-layer:not(:last-child)::before,
  .bw .bw-graph-layer:not(:last-child)::after { border-color: CanvasText; }
}
