#tab-workflows {
  padding: 24px;
  overflow: auto;
  font-family: inherit;
  background: var(--bg);
}

.wf-page {
  display: grid;
  gap: 24px;
  font-family: inherit;
  position: relative;
}

.wf-page,
.wf-page *:not(input):not(textarea):not(select):not(button) {
  font-family: inherit;
}

#tab-workflows button,
#tab-workflows input,
#tab-workflows textarea,
#tab-workflows select {
  font: inherit;
}

.wf-header,
.wf-panel,
.wf-composer,
.wf-blank {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.wf-bundles {
  background: color-mix(in srgb, var(--card-bg) 92%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.wf-header {
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.wf-eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--primary);
}

.wf-header h2,
.wf-bundles h3,
.wf-panel h3,
.wf-modal h3 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text, #111827);
}

.wf-bundles h3,
.wf-panel h3,
.wf-modal h3 {
  font-size: 18px;
}

.wf-copy,
.wf-section-head p,
.wf-prompt-card p,
.wf-blank p {
  margin: 4px 0 0;
  color: var(--text-secondary, #52607a);
  line-height: 1.5;
}

.wf-copy,
.wf-section-head p {
  font-size: 14px;
}

.wf-loading-screen {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: start center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
  border-radius: 24px;
}

.wf-loading-card {
  width: min(460px, 100%);
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  background: color-mix(in srgb, var(--card-bg) 94%, var(--bg));
  box-shadow: var(--shadow-md);
}

.wf-loading-card strong {
  color: var(--text, #111827);
  font-size: 16px;
  line-height: 1.35;
}

.wf-loading-card p {
  margin: 0;
  color: var(--text-secondary, #52607a);
  font-size: 14px;
  line-height: 1.5;
}

.wf-loading-spinner {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-top-color: var(--primary);
  animation: wf-spin 0.8s linear infinite;
}

.wf-file-meta,
.wf-bundle-card p,
.wf-save-help,
.wf-empty-card,
.wf-empty-inline {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.45;
}

.wf-modal-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary, #52607a);
}

.wf-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.wf-section-head,
.wf-composer-top,
.wf-composer-actions,
.wf-inline-actions,
.wf-file-badges,
.wf-file-top,
.wf-bundle-card,
.wf-queue-item,
.wf-modal-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.wf-section-head-actions {
  align-items: flex-start;
}

.wf-panel {
  display: grid;
  gap: 20px;
  align-content: start;
  min-height: 100%;
}

.wf-bundles {
  display: grid;
  gap: 16px;
}

.wf-upload-btn,
.wf-inline-actions button,
.wf-card-actions button,
.wf-bundle-actions button,
.wf-delete-btn,
.wf-composer-actions button,
.wf-modal-actions button,
.wf-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.wf-icon-control {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}

.wf-upload-btn:hover,
.wf-inline-actions button:hover,
.wf-card-actions button:hover,
.wf-bundle-actions button:hover,
.wf-delete-btn:hover,
.wf-composer-actions button:hover,
.wf-modal-actions button:hover,
.wf-modal-close:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.wf-upload-btn:focus-visible,
.wf-inline-actions button:focus-visible,
.wf-card-actions button:focus-visible,
.wf-bundle-actions button:focus-visible,
.wf-delete-btn:focus-visible,
.wf-composer-actions button:focus-visible,
.wf-modal-actions button:focus-visible,
.wf-file-main:focus-visible,
.wf-prompt-main:focus-visible,
.wf-bundle-main:focus-visible,
.wf-link-btn:focus-visible,
.wf-dropzone:focus-visible,
.wf-modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.wf-compact-btn,
.wf-icon-btn,
.wf-bundle-actions button,
.wf-queue-item .wf-inline-actions button {
  padding: 8px;
  font-size: 12px;
}

.wf-icon-btn {
  min-width: 38px;
  min-height: 38px;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 84%, var(--card-bg));
  color: color-mix(in srgb, var(--text-secondary) 88%, var(--text));
}

.wf-icon-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}

.wf-delete-btn {
  color: color-mix(in srgb, var(--red) 58%, var(--text-secondary));
  background: color-mix(in srgb, var(--bg) 84%, var(--card-bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 10%, transparent);
}

.wf-delete-btn:hover,
.wf-delete-btn:focus-visible {
  color: var(--red);
  background: var(--red-bg);
}

.wf-modal-actions .wf-btn-primary,
.wf-inline-actions .wf-btn-primary,
.wf-composer-actions .wf-btn-primary {
  background: var(--primary);
  color: #fff;
}

.wf-upload-btn,
.wf-inline-actions .wf-btn-secondary,
.wf-composer-actions .wf-btn-secondary,
.wf-modal-actions .wf-btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.wf-inline-actions .wf-btn-ghost,
.wf-composer-actions .wf-btn-ghost,
.wf-modal-actions .wf-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.wf-composer-actions .wf-go-btn {
  background: var(--green, #10b981);
  color: #fff;
  min-width: 112px;
  min-height: 46px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.18), 0 10px 20px rgba(16, 185, 129, 0.18);
}

.wf-composer-actions .wf-go-btn:hover {
  background: #0ea271;
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.22), 0 18px 32px rgba(16, 185, 129, 0.3);
}

.wf-composer-actions .wf-go-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.wf-search,
.wf-prompt-editor input,
.wf-prompt-editor textarea,
.wf-composer textarea,
.wf-composer-actions input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--input-bg);
  color: var(--text, #111827);
}

.wf-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--input-bg) 82%, var(--bg));
}

.wf-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6b7280);
  flex: 0 0 auto;
}

.wf-search-icon svg {
  width: 15px;
  height: 15px;
}

.wf-search-shell .wf-search {
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wf-search:focus,
.wf-prompt-editor input:focus,
.wf-prompt-editor textarea:focus,
.wf-composer textarea:focus,
.wf-composer-actions input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.wf-search-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.wf-search::placeholder,
.wf-prompt-editor input::placeholder,
.wf-prompt-editor textarea::placeholder,
.wf-composer textarea::placeholder,
.wf-composer-actions input::placeholder {
  color: color-mix(in srgb, var(--text-muted, #6b7280) 86%, transparent);
  font-style: italic;
}

.wf-dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--primary) 32%, var(--border));
  background: transparent;
  cursor: pointer;
}

.wf-dropzone.is-dragover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-light) 34%, transparent);
}

.wf-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.wf-dropzone-icon svg {
  width: 18px;
  height: 18px;
}

.wf-dropzone em {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.01em;
}

.wf-dropzone.is-compact {
  padding-block: 14px;
}

.wf-dropzone.is-compact em {
  font-size: 12px;
}

.wf-subsection {
  display: grid;
  gap: 12px;
}

.wf-subsection + .wf-subsection {
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
}

.wf-subsection-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.wf-scroll-list,
.wf-bundle-list,
.wf-queue {
  display: grid;
  gap: 14px;
  max-height: 420px;
  overflow: auto;
}

.wf-queue {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wf-file-card,
.wf-prompt-card,
.wf-bundle-card,
.wf-empty-inline {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--card-bg);
}

.wf-empty-card {
  border: 1px dashed color-mix(in srgb, var(--border) 86%, var(--primary-light));
  border-radius: 16px;
  padding: 14px;
  background: color-mix(in srgb, var(--card-bg) 94%, var(--bg));
}

.wf-file-card,
.wf-prompt-card {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.wf-bundle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: color-mix(in srgb, var(--card-bg) 90%, var(--primary-light));
}

.wf-file-card .wf-file-main {
  grid-column: 1;
}

.wf-file-card .wf-card-actions {
  grid-column: 2;
  align-self: center;
}

.wf-prompt-card .wf-prompt-main {
  grid-column: 1;
}

.wf-prompt-card .wf-card-actions {
  grid-column: 2;
  align-self: center;
}

.wf-file-card.is-selected,
.wf-prompt-card.is-selected,
.wf-bundle-card.is-loaded {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 34%, transparent);
}

.wf-file-main,
.wf-prompt-main,
.wf-bundle-main {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.wf-bundle-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.wf-bundle-actions,
.wf-card-actions,
.wf-composer-stats,
.wf-queue-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wf-bundle-actions {
  justify-content: flex-end;
}

.wf-bundle-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wf-bundle-hint svg {
  width: 14px;
  height: 14px;
}

.wf-bundle-copy {
  min-width: 0;
}

.wf-bundle-main strong {
  font-size: 15px;
  font-weight: 650;
}

.wf-pill,
.wf-composer-stat {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
}

.wf-prompt-editor,
.wf-composer {
  display: grid;
  gap: 14px;
}

.wf-field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #52607a);
}

.wf-prompt-editor {
  align-content: start;
  gap: 10px;
}

.wf-composer {
  margin-top: 8px;
  position: static;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.wf-composer-header h3 {
  margin: 0;
}

.wf-composer-header p {
  margin: 6px 0 0;
  color: var(--text-secondary, #52607a);
  line-height: 1.5;
}

.wf-composer-top {
  align-items: center;
}

.wf-composer-actions {
  align-items: stretch;
}

.wf-loaded-workflow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wf-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wf-status-banner {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  background: color-mix(in srgb, var(--surface-elevated, var(--card-bg)) 94%, var(--bg));
  color: var(--text-secondary, #52607a);
  font-size: 13px;
  line-height: 1.45;
}

.wf-status-banner.is-ok {
  background: color-mix(in srgb, var(--green, #16a34a) 8%, var(--card-bg));
  border-color: color-mix(in srgb, var(--green, #16a34a) 22%, var(--border));
  color: var(--green, #15803d);
}

.wf-status-banner.is-warn {
  background: color-mix(in srgb, var(--amber, #d97706) 8%, var(--card-bg));
  border-color: color-mix(in srgb, var(--amber, #d97706) 22%, var(--border));
  color: var(--amber, #b45309);
}

.wf-status-banner.is-danger {
  background: color-mix(in srgb, var(--red, #dc2626) 8%, var(--card-bg));
  border-color: color-mix(in srgb, var(--red, #dc2626) 22%, var(--border));
  color: var(--red, #b91c1c);
}

.wf-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-elevated, var(--card-bg)) 92%, var(--bg));
  border: 1px solid var(--border);
  color: var(--text-secondary, #52607a);
  font-size: 12px;
  font-weight: 600;
}

.wf-state-pill.is-ok {
  background: color-mix(in srgb, var(--green, #16a34a) 10%, var(--card-bg));
  border-color: color-mix(in srgb, var(--green, #16a34a) 24%, var(--border));
  color: var(--green, #15803d);
}

.wf-state-pill.is-warn {
  background: color-mix(in srgb, var(--amber, #d97706) 10%, var(--card-bg));
  border-color: color-mix(in srgb, var(--amber, #d97706) 24%, var(--border));
  color: var(--amber, #b45309);
}

.wf-state-pill.is-danger {
  background: color-mix(in srgb, var(--red, #dc2626) 10%, var(--card-bg));
  border-color: color-mix(in srgb, var(--red, #dc2626) 24%, var(--border));
  color: var(--red, #b91c1c);
}

.wf-loaded-workflow-label {
  font-size: 12px;
  color: var(--text-muted);
}

.wf-loaded-workflow-name {
  font-size: 14px;
  color: var(--text, #111827);
}

.wf-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wf-selected-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-bg) 76%, var(--primary-light));
  color: var(--primary);
  cursor: pointer;
}

.wf-selected-file-chip-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-selected-file-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wf-selected-file-chip-remove svg {
  width: 12px;
  height: 12px;
}

.wf-queue-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-bg) 94%, var(--bg));
}

.wf-queue-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.wf-queue-copy {
  min-width: 0;
}

.wf-queue-copy strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-file-title strong,
.wf-prompt-main strong,
.wf-bundle-main strong,
.wf-queue-copy strong {
  color: var(--text, #111827);
}

.wf-save-group {
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-bg) 76%, var(--primary-light));
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
}

.wf-save-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.wf-launch-group {
  flex: 0 0 260px;
  display: grid;
  gap: 8px;
  align-content: stretch;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--green-bg, #ecfdf5) 76%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--green, #10b981) 18%, var(--border));
}

.wf-launch-group .wf-save-help {
  margin-top: auto;
}

.wf-save-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wf-save-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wf-save-actions .wf-btn-secondary,
.wf-save-actions .wf-go-btn {
  min-height: 46px;
}

.wf-save-actions .wf-btn-secondary {
  padding-inline: 18px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
}

.wf-save-help {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #52607a);
}

.wf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 26%, rgba(15, 23, 42, 0.72));
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 60;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.wf-modal {
  position: relative;
  width: min(620px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 20px;
}

.wf-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 84%, var(--card-bg));
  min-width: 42px;
  min-height: 42px;
}

.wf-modal-copy {
  display: grid;
  gap: 10px;
  padding-right: 44px;
}

.wf-modal-decision-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wf-modal-actions {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.wf-modal-actions button {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}

.wf-modal-actions .wf-btn-ghost {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
}

.wf-modal-actions .wf-btn-danger {
  width: 100%;
  min-height: 46px;
  border: 1px solid color-mix(in srgb, #dc2626 28%, transparent);
  background: color-mix(in srgb, #dc2626 92%, white);
  color: white;
  box-shadow: 0 18px 36px -26px rgba(220, 38, 38, 0.72);
}

.wf-modal-actions .wf-btn-danger:hover {
  background: color-mix(in srgb, #b91c1c 94%, white);
  border-color: color-mix(in srgb, #b91c1c 34%, transparent);
}

.wf-modal-actions .wf-btn-danger:focus-visible {
  outline: 2px solid color-mix(in srgb, #dc2626 36%, white);
  outline-offset: 2px;
}

@keyframes wf-spin {
  to {
    transform: rotate(360deg);
  }
}

[data-theme="dark"] #tab-workflows .wf-copy,
[data-theme="dark"] #tab-workflows .wf-section-head p,
[data-theme="dark"] #tab-workflows .wf-prompt-card p,
[data-theme="dark"] #tab-workflows .wf-blank p,
[data-theme="dark"] #tab-workflows .wf-file-meta,
[data-theme="dark"] #tab-workflows .wf-bundle-card p,
[data-theme="dark"] #tab-workflows .wf-save-help,
[data-theme="dark"] #tab-workflows .wf-empty-card,
[data-theme="dark"] #tab-workflows .wf-empty-inline,
[data-theme="dark"] #tab-workflows .wf-modal-copy p,
[data-theme="dark"] #tab-workflows .wf-loaded-workflow-label,
[data-theme="dark"] #tab-workflows .wf-dropzone em {
  color: rgba(226, 232, 240, 0.78);
}

[data-theme="dark"] #tab-workflows .wf-file-title strong,
[data-theme="dark"] #tab-workflows .wf-prompt-main strong,
[data-theme="dark"] #tab-workflows .wf-bundle-main strong,
[data-theme="dark"] #tab-workflows .wf-queue-copy strong,
[data-theme="dark"] #tab-workflows .wf-loaded-workflow-name {
  color: rgb(248, 250, 252);
}

[data-theme="dark"] #tab-workflows .wf-upload-btn,
[data-theme="dark"] #tab-workflows .wf-inline-actions .wf-btn-secondary,
[data-theme="dark"] #tab-workflows .wf-composer-actions .wf-btn-secondary,
[data-theme="dark"] #tab-workflows .wf-modal-actions .wf-btn-secondary {
  background: color-mix(in srgb, var(--primary-light) 48%, var(--card-bg));
  color: color-mix(in srgb, var(--primary) 88%, white);
}

[data-theme="dark"] #tab-workflows .wf-search-shell {
  background: color-mix(in srgb, var(--input-bg) 92%, var(--bg));
  border-color: color-mix(in srgb, var(--border) 94%, transparent);
}

[data-theme="dark"] #tab-workflows .wf-save-group {
  background: color-mix(in srgb, var(--card-bg) 92%, var(--primary-light));
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}

[data-theme="dark"] #tab-workflows .wf-launch-group {
  background: color-mix(in srgb, var(--card-bg) 92%, var(--green-bg, rgba(16, 185, 129, 0.18)));
  border-color: color-mix(in srgb, var(--green, #10b981) 22%, var(--border));
}

[data-theme="dark"] #tab-workflows .wf-modal-actions .wf-btn-danger {
  background: color-mix(in srgb, #ef4444 82%, #7f1d1d);
  border-color: color-mix(in srgb, #ef4444 40%, transparent);
}

[data-theme="dark"] #tab-workflows .wf-selected-file-chip {
  background: color-mix(in srgb, var(--card-bg) 88%, var(--primary-light));
  border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
  color: color-mix(in srgb, var(--primary) 90%, white);
}

.wf-link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.wf-pill-selected {
  background: var(--green-bg);
  color: var(--green);
}

.wf-empty-inline {
  color: var(--text-secondary, #52607a);
  font-size: 14px;
}

.wf-prompt-body-copy {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-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;
}

.wf-upload-btn:disabled,
.wf-inline-actions button:disabled,
.wf-card-actions button:disabled,
.wf-bundle-actions button:disabled,
.wf-delete-btn:disabled,
.wf-composer-actions button:disabled,
.wf-modal-actions button:disabled,
.wf-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wf-upload-btn:disabled:hover,
.wf-inline-actions button:disabled:hover,
.wf-card-actions button:disabled:hover,
.wf-bundle-actions button:disabled:hover,
.wf-delete-btn:disabled:hover,
.wf-composer-actions button:disabled:hover,
.wf-modal-actions button:disabled:hover,
.wf-icon-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

@media (max-width: 980px) {
  .wf-grid {
    grid-template-columns: 1fr;
  }

  #tab-workflows {
    padding: 16px;
  }

  .wf-composer-actions,
  .wf-section-head,
  .wf-save-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .wf-bundle-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .wf-bundle-actions {
    justify-content: flex-start;
  }

  .wf-modal {
    width: min(100%, 480px);
    padding: 24px 20px 20px;
  }

  .wf-modal-copy {
    padding-right: 32px;
  }

  .wf-modal-decision-row {
    grid-template-columns: 1fr;
  }

  .wf-prompt-card,
  .wf-file-card {
    grid-template-columns: 1fr;
  }

  .wf-prompt-card .wf-card-actions,
  .wf-file-card .wf-card-actions {
    grid-column: 1;
    justify-content: flex-start;
  }

  .wf-queue-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .wf-scroll-list,
  .wf-bundle-list,
  .wf-queue {
    max-height: none;
  }

  .wf-go-btn {
    width: 100%;
  }

  .wf-launch-group {
    flex-basis: auto;
  }

  .wf-save-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .wf-selected-file-chip-name {
    max-width: none;
  }
}
