/* JARVIS workflow layout adapter. Materials and light come from softform.css. */

.wf-page,
.modal:has(.wf-form),
.wf-form,
.wf-builder {
  font-family: var(--sf-font);
  color: var(--sf-fg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wf-page :is(h1, h2, h3, button, input, select, textarea),
.modal:has(.wf-form) :is(h2, button, input, select, textarea) {
  font-family: var(--sf-font);
}

.wf-page .wf-header { gap: var(--sf-space-5); }
.wf-page .wf-header .wf-muted { font-size: 12px; }
.wf-page .wf-layout,
.wf-page .wf-queue-layout { gap: var(--sf-space-5); }

.wf-page :is(.wf-panel, .wf-rule-card, .wf-queue-list, .wf-queue-detail) {
  position: relative;
  isolation: isolate;
  min-width: 0;
  color: var(--sf-fg);
  border: 1px solid var(--sf-rule);
  border-radius: var(--sf-radius-lg);
  background: var(--sf-surface-fill);
  box-shadow: var(--sf-surface-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wf-page :is(.wf-panel, .wf-queue-detail) { padding: var(--sf-space-6); }
.wf-page .wf-rule-card { padding: var(--sf-space-6); }
.wf-page .wf-panel-head { gap: var(--sf-space-4); margin-bottom: var(--sf-space-5); }
.wf-page .wf-panel-head h3 { color: var(--sf-fg); font-size: 18px; font-weight: 400; letter-spacing: -.35px; line-height: 1.35; }
.wf-page :is(.wf-rule-head h3, .wf-rule-card .wf-rule-head h3) { color: var(--sf-fg); font-size: 16px; font-weight: 400; line-height: 1.4; }

/* Tabs use raised pills; compact filters share the recessed segmented well. */
.wf-page .wf-tabs {
  width: max-content;
  max-width: 100%;
  gap: var(--sf-space-1);
  margin: 0 0 var(--sf-space-6);
  padding: 5px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-well-fill);
  box-shadow: inset 2px 3px 7px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light);
}
.wf-page .wf-tabs > :is(a, button) {
  min-height: 40px;
  gap: var(--sf-space-2);
  padding: 10px 17px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  color: var(--sf-text-muted);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.15px;
  transition: color var(--sf-duration), background var(--sf-duration), box-shadow var(--sf-duration);
}
.wf-page .wf-tabs > :is(a, button):hover { color: var(--sf-fg); background: var(--sf-lens-fill); }
.wf-page .wf-tabs > .active {
  color: var(--sf-fg);
  background: var(--sf-selected-fill);
  box-shadow: inset 1px 1px 0 var(--sf-well-light), 0 2px 6px var(--sf-well-shadow);
}
.wf-page .wf-tab-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: var(--sf-well-fill);
  color: var(--sf-text-muted);
  box-shadow: inset 1px 2px 3px var(--sf-well-shadow), inset -1px -1px 2px var(--sf-well-light);
  font-size: 12px;
}
.wf-page .wf-tabs > .active .wf-tab-count { color: var(--sf-fg); }
.wf-page .wf-toolbar { gap: var(--sf-space-4); margin-bottom: var(--sf-space-5); }
.wf-page .wf-toolbar .segmented button > span { margin-left: 4px; color: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Source selection stays neutral, with the same pressed-in selected state. */
.wf-page .wf-scenario-list { gap: var(--sf-space-2); margin-bottom: var(--sf-space-5); }
.wf-page .wf-scenario {
  min-height: 36px;
  padding: 9px 13px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  color: var(--sf-text-muted);
  background: var(--sf-button-fill);
  box-shadow: inset 1px 1px 2px var(--sf-well-light), 0 2px 6px var(--sf-well-shadow);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.wf-page .wf-scenario:hover { color: var(--sf-fg); border-color: transparent; }
.wf-page .wf-scenario.active {
  color: var(--sf-fg);
  background: var(--sf-well-fill);
  box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light);
}

/* Form wells inherit the current surface, including blue result contexts. */
:is(.wf-form, .wf-context-overrides, .wf-builder) .form-label,
.wf-context-overrides label {
  color: var(--sf-text-muted);
  font-family: var(--sf-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}
:is(.wf-form, .wf-context-overrides, .wf-builder) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  width: 100%;
  min-height: 45px;
  margin-top: var(--sf-space-2);
  padding: 13px 16px;
  border: 1px solid var(--sf-rule);
  border-radius: var(--sf-radius-sm);
  color: var(--sf-fg);
  background: var(--sf-well-fill);
  box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light);
  font: 400 14px/1.55 var(--sf-font);
  transition: border-color var(--sf-duration), box-shadow var(--sf-duration);
}
:is(.wf-form, .wf-context-overrides, .wf-builder) select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23808b84' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"), var(--sf-well-fill);
  background-repeat: no-repeat;
  background-position: right 16px center, center;
}
:is(.wf-form, .wf-context-overrides, .wf-builder) select option { color: var(--sf-ink); background: var(--sf-canvas); }
:is(.wf-form, .wf-builder) :is(input, textarea)::placeholder { color: var(--sf-text-muted); opacity: .8; }
:is(.wf-form, .wf-context-overrides, .wf-builder) :is(input, select, textarea):focus,
.wf-page .wf-draft-surface:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--sf-focus) 40%, transparent);
  box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light), 0 0 0 3px color-mix(in srgb, var(--sf-focus) 8%, transparent);
}
:is(.wf-form, .wf-context-overrides, .wf-builder) :is(input, select, textarea):disabled { opacity: .5; cursor: not-allowed; }
:is(.wf-form, .wf-context-overrides, .wf-builder) :is(input, select, textarea)[aria-invalid=true] { border-color: var(--sf-danger); }
.wf-page :is(.wf-field-row, .wf-context-overrides),
.wf-builder-condition { gap: var(--sf-space-3); }
.wf-page .wf-panel-footer { gap: var(--sf-space-4); margin-top: var(--sf-space-5); }
.wf-page .wf-analysis-steps { border-color: var(--sf-rule); padding-top: var(--sf-space-4); color: var(--sf-text-muted); font-size: 12px; }

/* Context markers sit in their parent's material rather than on solid tiles. */
.wf-page .wf-context-row { gap: var(--sf-space-3); padding: 17px 0; border-color: var(--sf-rule); }
.wf-page .wf-context-icon {
  --sf-logo-size: 40px;
  position: relative;
  isolation: isolate;
  width: var(--sf-logo-size);
  height: var(--sf-logo-size);
  flex: 0 0 var(--sf-logo-size);
  border: 0;
  border-radius: 50%;
  color: var(--sf-fg);
  background: var(--sf-well-fill);
  box-shadow: inset 3px 4px 7px var(--sf-well-shadow), inset -2px -3px 6px var(--sf-well-light);
}
.wf-page .wf-context-icon > svg { width: 16px; height: 18px; stroke-width: 1.4; }
.wf-page .wf-context-copy strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; line-height: 1.5; }
.wf-page :is(.wf-muted, .wf-context-copy small, .wf-rule-title small) { color: var(--sf-text-muted); font-size: 12px; line-height: 1.6; }
.wf-page .wf-context-copy small { margin-top: var(--sf-space-1); }
.wf-page .wf-section-label {
  margin: var(--sf-space-5) 0 var(--sf-space-3);
  color: var(--sf-text-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .1px;
  text-transform: none;
}
.wf-page :is(.wf-match, .wf-chain-item, .wf-notice, .wf-draft-surface) {
  color: var(--sf-fg);
  border: 0;
  border-radius: var(--sf-radius-md);
  background: var(--sf-well-fill);
  box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light);
}
.wf-page .wf-match { padding: var(--sf-space-4); }
.wf-page .wf-match + .wf-match { margin-top: var(--sf-space-3); }
.wf-page .wf-match-top strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; }
.wf-page .wf-action-line { gap: var(--sf-space-2); margin-top: var(--sf-space-3); color: var(--sf-text-muted); font-size: 12px; }
.wf-page :is(.wf-mini-icon, .wf-chain-arrow) { color: var(--sf-text-muted); }
.wf-page .wf-text-button,
.wf-page .wf-notice a {
  min-height: 30px;
  padding: 5px 7px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  background: transparent;
  color: var(--sf-accent-strong);
  box-shadow: none;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.wf-page .wf-text-button:hover { background: var(--sf-lens-fill); }
.wf-page :is(.sf-tone-blue, .sf-tone-warm, .sf-tone-pink) :is(.wf-text-button, .wf-notice a) { color: var(--sf-fg); }
.wf-page .wf-result-footer { margin-top: var(--sf-space-5); }
.wf-page .wf-result-footer > .wf-muted { margin-bottom: var(--sf-space-3); }
.wf-page .wf-notice { gap: var(--sf-space-2); margin-top: var(--sf-space-4); padding: var(--sf-space-4); color: var(--sf-text-muted); font-size: 12px; }
.wf-page .wf-notice.warning { color: var(--sf-warning); border: 1px solid color-mix(in srgb, var(--sf-warning) 25%, transparent); }
.wf-page :is(.sf-tone-blue, .sf-tone-warm, .sf-tone-pink) .wf-notice.warning { color: var(--sf-fg); border-color: var(--sf-rule); }
.wf-page .wf-empty { gap: var(--sf-space-4); color: var(--sf-text-muted); font-size: 14px; }
.wf-page .wf-empty strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; }

/* Rule chains keep their layout; each condition is a shallow material well. */
.wf-page .wf-rule-list { gap: var(--sf-space-5); }
.wf-page .wf-rule-head { margin-bottom: var(--sf-space-5); }
.wf-page .wf-rule-title { gap: var(--sf-space-3); }
.wf-page .wf-rule-title small { margin-top: var(--sf-space-1); }
.wf-page .wf-rule-chain { gap: var(--sf-space-2); }
.wf-page .wf-chain-item { padding: var(--sf-space-3); font-size: 14px; line-height: 1.5; }
.wf-page .wf-chain-item strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; }
.wf-page .wf-chain-label,
.wf-builder-label { color: var(--sf-text-muted); font-size: 12px; font-weight: 400; letter-spacing: .1px; line-height: 1.5; text-transform: none; }
.wf-page .wf-rule-footer { gap: var(--sf-space-3); margin-top: var(--sf-space-5); padding-top: var(--sf-space-4); border-color: var(--sf-rule); color: var(--sf-text-muted); font-size: 12px; }
.wf-page .wf-rule-footer > div { gap: var(--sf-space-2); }
.wf-builder { gap: var(--sf-space-4); }
.wf-builder-row { gap: var(--sf-space-4); }
.wf-builder-label { padding-top: 22px; }
.wf-rule-options { color: var(--sf-text-muted); font-family: var(--sf-font); font-size: 12px; line-height: 1.5; }
.wf-rule-options input,
.wf-select-all input,
.wf-queue-check { accent-color: var(--sf-accent); }
.modal:has(.wf-form) .modal-footer { gap: var(--sf-space-2); border-color: var(--sf-rule); margin-top: var(--sf-space-6); padding-top: var(--sf-space-5); }

/* Quiet badges preserve the existing pending/approved/rejected semantics. */
.wf-page .wf-status {
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--sf-radius-pill);
  color: var(--sf-text-muted);
  background: var(--sf-lens-fill);
  box-shadow: none;
  font: 400 12px/1.3 var(--sf-font);
}
.wf-page .wf-status.pending { color: var(--sf-warning); background: color-mix(in srgb, var(--sf-warning) 12%, transparent); }
.wf-page .wf-status.approved { color: var(--sf-success); background: color-mix(in srgb, var(--sf-success) 12%, transparent); }
.wf-page .wf-status.rejected,
.wf-page .wf-status.neutral { color: var(--sf-text-muted); background: var(--sf-lens-fill); }
.wf-page .wf-status svg { width: 12px; height: 12px; }
.wf-page :is(.sf-tone-blue, .sf-tone-warm, .sf-tone-pink) .wf-status { color: var(--sf-fg); background: var(--sf-lens-fill); box-shadow: inset 0 1px 1px var(--sf-well-light); }

/* Queue selection is recessed. The nested row button remains frameless. */
.wf-page .wf-queue-list { padding: 0 0 var(--sf-space-2); overflow: hidden; }
.wf-page .wf-queue-list-head { padding: var(--sf-space-5); border-color: var(--sf-rule); }
.wf-page .wf-queue-list-head h3 { color: var(--sf-fg); font-size: 14px; font-weight: 400; }
.wf-page .wf-select-all { gap: var(--sf-space-2); color: var(--sf-text-muted); font-size: 12px; }
.wf-page .wf-queue-row {
  width: calc(100% - 16px);
  margin: 0 var(--sf-space-2);
  gap: var(--sf-space-3);
  padding: 18px 12px;
  border: 0;
  border-bottom: 1px solid var(--sf-rule);
  border-radius: var(--sf-radius-md);
  color: var(--sf-fg);
  background: transparent;
  box-shadow: none;
}
.wf-page .wf-queue-row:hover { background: var(--sf-lens-fill); }
.wf-page .wf-queue-row.selected { background: var(--sf-well-fill); box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light); }
.wf-page .wf-queue-row .wf-queue-item {
  width: 100%;
  min-height: 0;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--sf-space-3);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: var(--sf-fg);
  background: transparent;
  box-shadow: none;
  text-align: left;
  white-space: normal;
}
.wf-page .wf-queue-copy strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; line-height: 1.5; }
.wf-page .wf-queue-copy small { color: var(--sf-text-muted); font-size: 12px; line-height: 1.55; }
.wf-page .wf-queue-item > .wf-status { flex-shrink: 0; }
.wf-page .wf-queue-check { width: 17px; height: 17px; margin-top: 3px; }
.wf-page .wf-detail-title { color: var(--sf-fg); font-size: 22px; font-weight: 400; line-height: 1.35; letter-spacing: -.45px; }
.wf-page .wf-detail-meta { gap: var(--sf-space-4); margin: var(--sf-space-5) 0; }
.wf-page .wf-detail-meta > div,
.wf-page .wf-detail-meta strong { color: var(--sf-fg); font-size: 14px; font-weight: 400; line-height: 1.6; }
.wf-page .wf-detail-meta :is(label, small),
.wf-page .wf-detail-meta > div > span { color: var(--sf-text-muted); font-size: 12px; }
.wf-page .wf-context-chips { gap: var(--sf-space-2); margin: var(--sf-space-4) 0; }
.wf-page .wf-context-chips > span { padding: 6px 10px; border: 0; border-radius: var(--sf-radius-pill); color: var(--sf-text-muted); background: var(--sf-lens-fill); font-size: 12px; }
.wf-page .wf-draft-surface { padding: var(--sf-space-5); color: var(--sf-fg); font: 400 14px/1.8 var(--sf-font); }
.wf-page .wf-draft-surface strong { font-weight: 500; }
.wf-page .wf-detail-actions { gap: var(--sf-space-2); margin-top: var(--sf-space-5); }
.wf-page .wf-source-rule { gap: var(--sf-space-2); margin-top: var(--sf-space-4); color: var(--sf-text-muted); font-size: 12px; }
.wf-page .wf-decision-note { color: var(--sf-text-muted); font-size: 12px; line-height: 1.7; }
.wf-page .wf-bulk-bar { gap: var(--sf-space-3); padding: var(--sf-space-3) var(--sf-space-4); border: 0; border-radius: var(--sf-radius-md); color: var(--sf-fg); background: var(--sf-well-fill); box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light); font-size: 14px; }
.wf-page .wf-bulk-bar > div { gap: var(--sf-space-2); }
.wf-page .wf-search { min-height: 44px; gap: var(--sf-space-2); padding: 11px 15px; border: 1px solid var(--sf-rule); border-radius: var(--sf-radius-pill); background: var(--sf-well-fill); box-shadow: inset 2px 3px 6px var(--sf-well-shadow), inset -2px -2px 5px var(--sf-well-light); }
.wf-page .wf-search svg { color: var(--sf-text-muted); }
.wf-page .wf-search input { min-height: 20px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--sf-fg); box-shadow: none; font: 400 14px/1.4 var(--sf-font); }
.wf-page .wf-search input::placeholder { color: var(--sf-text-muted); opacity: .8; }
.wf-page .wf-search:focus-within { border-color: color-mix(in srgb, var(--sf-focus) 40%, transparent); }

.wf-page :is(.wf-tabs > a, .wf-scenario, .wf-text-button, .wf-queue-item):focus-visible,
.wf-page .wf-toolbar .segmented button:focus-visible {
  outline: 2px solid var(--sf-focus);
  outline-offset: 4px;
}
.wf-page :is(button, a)[aria-disabled=true],
.wf-page button:disabled { opacity: .43; cursor: not-allowed; }
.wf-page .button.small,
.modal:has(.wf-form) .button.small { min-height: 35px; font-size: 12px; }

@media (min-width: 1200px) {
  .wf-page .wf-rule-card .wf-rule-chain { gap: var(--sf-space-2); }
  .wf-page .wf-rule-card .wf-chain-item { padding: var(--sf-space-3); }
}
@media (max-width: 960px) {
  .wf-page .wf-queue-list { overflow-y: auto; }
}
@media (max-width: 700px) {
  .wf-page .wf-tabs { gap: 3px; margin-bottom: var(--sf-space-5); padding: 4px; }
  .wf-page .wf-tabs > :is(a, button) { min-height: 38px; gap: 6px; padding: 9px 12px; font-size: 13px; }
  .wf-page :is(.wf-panel, .wf-rule-card, .wf-queue-detail) { padding: var(--sf-space-5); border-radius: var(--sf-radius-md); }
  .wf-page .wf-queue-list { border-radius: var(--sf-radius-md); }
  .wf-page .wf-panel-head h3 { font-size: 18px; }
  .wf-page .wf-context-row { gap: var(--sf-space-3); }
  .wf-page .wf-scenario { padding: 8px 11px; font-size: 12px; }
  .wf-page .wf-analysis-steps { gap: var(--sf-space-2); font-size: 12px; }
  .wf-page .wf-rule-chain { gap: var(--sf-space-2); }
  .wf-page .wf-rule-chain .wf-chain-arrow { min-height: 12px; }
  .wf-page .wf-rule-footer { gap: var(--sf-space-3); }
  .wf-page .wf-queue-row { gap: var(--sf-space-2); padding: 16px 10px; }
  .wf-page .wf-queue-row .wf-status { padding: 5px 8px; font-size: 12px; }
  .wf-page .wf-queue-item { gap: var(--sf-space-2); flex-wrap: wrap; }
  .wf-page .wf-queue-copy { flex: 1; min-width: 120px; }
  .wf-page .wf-queue-item > .wf-status { margin-left: auto; }
  .wf-page .wf-detail-title { font-size: 21px; }
  .wf-page .wf-draft-surface { padding: var(--sf-space-4); }
  .wf-page .wf-bulk-bar > span { font-size: 14px; }
  .wf-builder-label { padding-top: var(--sf-space-1); }
}
@media (max-width: 370px) {
  .wf-page .wf-tabs > :is(a, button) { padding-right: 9px; padding-left: 9px; font-size: 12px; }
  .wf-page .wf-analysis-steps { font-size: 12px; letter-spacing: -.15px; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-page .wf-tabs > :is(a, button),
  :is(.wf-form, .wf-context-overrides, .wf-builder) :is(input, select, textarea) { transition: none; }
}
