/* MeshFlows Dashboard — stylesheet */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2129;
  --surface-raised: #21262d;
  --background: var(--surface);
  --background-alt: var(--surface-raised);
  --bg-alt: var(--surface-raised);
  --canvas: #111823;
  --canvas-alt: #0f1622;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
  --purple: #bc8cff;
  --blue: #58a6ff;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="light"] {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-hover: #f1f5fb;
  --surface-raised: #eef3fb;
  --background: var(--surface);
  --background-alt: var(--surface-raised);
  --bg-alt: var(--surface-raised);
  --canvas: #eaf2ff;
  --canvas-alt: #edf3ff;
  --border: #d0dae8;
  --text: #152238;
  --text-muted: #5e708c;
  --accent: #155eef;
  --green: #1f9d53;
  --red: #d83933;
  --orange: #b25c00;
  --purple: #7a3de0;
  --blue: #155eef;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

#app { display: flex; flex-direction: column; height: 100vh; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(21, 94, 239, 0.15), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(122, 61, 224, 0.12), transparent 45%),
    var(--bg);
}

.auth-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.auth-logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 12px;
  object-fit: contain;
}

.auth-card h1 {
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 13px;
}

.auth-form-row {
  margin-bottom: 10px;
}

.auth-form-row input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.auth-status {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-status.error {
  color: var(--red);
}

.auth-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  flex-shrink: 0;
}

.auth-link:hover {
  text-decoration: underline;
}

/* ----- Top bar ----- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar.topbar-has-env-mark {
  padding-left: 36px;
}
.topbar-env-mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.topbar-env-mark span {
  position: absolute;
  display: block;
  top: 10px;
  left: -14px;
  width: 72px;
  padding: 2px 0;
  transform: rotate(-45deg);
  transform-origin: center;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--env-mark-color, #d97706);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.topbar-env-mark.env-lab { --env-mark-color: #2563eb; }
.topbar-env-mark.env-dev { --env-mark-color: #059669; }
.topbar-env-mark.env-tst { --env-mark-color: #d97706; }
.topbar-env-mark.env-stg { --env-mark-color: #7c3aed; }
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  background: none;
  border: none;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}
.topbar-brand:hover {
  background: var(--surface-raised);
}
.topbar-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.theme-switch {
  display: flex;
  align-items: center;
}
.topbar-theme-select {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 500; }
.topbar-status { font-size: 12px; color: var(--text-muted); }
.topbar-status.ok { color: var(--green); }
.topbar-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-status-probe {
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-raised);
}
.topbar-status-probe.ok {
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.15);
}
.topbar-status-probe.fail {
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.15);
}
.topbar-right #btnSignOut {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-cluster-health {
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-cluster-health:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ----- Main layout ----- */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ----- Sidebar ----- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-section { padding: 0 12px; margin-bottom: 12px; }
.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 0 4px;
}

.sidebar-section-toggle {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 4px;
  cursor: pointer;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-section-header .sidebar-section-toggle {
  margin-bottom: 0;
}

.sidebar-section-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.sidebar-action-btn {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-action-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-action-btn.active {
  color: var(--text);
  background: var(--surface-hover);
}

.workflows-header {
  margin-bottom: 4px;
  padding: 0 2px;
}

.workflows-header .sidebar-section-toggle {
  padding: 3px 2px;
}

.sidebar-section-toggle:hover { background: var(--surface-hover); }
.sidebar-section-toggle .chevron {
  font-size: 10px;
  transition: transform .2s;
}
.sidebar-section.collapsed .sidebar-section-body { display: none; }
.sidebar-section.collapsed .sidebar-section-toggle .chevron { transform: rotate(0deg); }
.sidebar-section:not(.collapsed) .sidebar-section-toggle .chevron { transform: rotate(90deg); }

.workflow-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px 6px 6px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
}

.workflow-search-icon {
  font-size: 12px;
  color: var(--text-muted);
}

#workflowSearchInput {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

#workflowSearchInput:focus {
  outline: none;
}

.workflow-search-clear {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.workflow-search-clear:hover {
  color: var(--text);
}

.settings-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
  min-height: 0;
}

.settings-tree-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 520px;
  max-height: 72vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-tree-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.settings-tree-actions {
  display: flex;
  gap: 2px;
}

.settings-scope-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.settings-tree-pane .group-header {
  margin-bottom: 2px;
}

.settings-tree-pane .group-items {
  padding-left: 6px;
}

.settings-tree-pane .wf-item {
  padding: 5px 8px;
}

.settings-detail-pane {
  min-height: 0;
}

.settings-selected-row {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.settings-selected-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.settings-selected-path {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.settings-empty-state {
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.settings-footer-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Group headers */
.group-header {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  transition: background .15s;
  user-select: none;
  list-style: none;
}
.group-header:hover { background: var(--surface-hover); }
.group-header .chevron {
  font-size: 10px;
  transition: transform .2s;
  color: var(--text-muted);
  display: inline-block;
}
.group-header .chevron.open { transform: rotate(90deg); }
.group-header .group-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Workflow items in sidebar */
.group-items { list-style: none; padding-left: 8px; }
.group-items.collapsed { display: none; }
.trigger-path-group,
.trigger-flat-group {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trigger-channel-section {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.trigger-channel-section:first-child {
  margin-top: 0;
}
.trigger-channel-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid var(--border);
}
.trigger-channel-section:first-child .trigger-channel-header {
  border-top: none;
  padding-top: 4px;
}
.trigger-channel-http .trigger-channel-header {
  border-left: 3px solid rgba(88, 166, 255, 0.55);
}
.trigger-channel-schedule .trigger-channel-header {
  border-left: 3px solid rgba(245, 158, 11, 0.55);
}
.trigger-channel-amqp .trigger-channel-header {
  border-left: 3px solid rgba(168, 85, 247, 0.55);
}
.trigger-channel-header:hover {
  background: var(--surface-hover);
}
.trigger-channel-header .chevron {
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--text-muted);
  display: inline-block;
  margin-top: 3px;
  flex-shrink: 0;
}
.trigger-channel-header .chevron.open {
  transform: rotate(90deg);
}
.trigger-channel-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.trigger-channel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.trigger-channel-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.trigger-channel-body {
  padding-left: 4px;
}
.trigger-channel-empty {
  list-style: none;
  padding: 4px 8px 8px 22px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.trigger-channel-sublabel {
  list-style: none;
  padding: 8px 8px 4px 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trigger-channel-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.trigger-channel-badge-schedule {
  background: rgba(245, 158, 11, 0.12);
  color: rgb(245, 158, 11);
  border-color: rgba(245, 158, 11, 0.25);
}
.trigger-channel-badge-amqp {
  background: rgba(168, 85, 247, 0.12);
  color: rgb(168, 85, 247);
  border-color: rgba(168, 85, 247, 0.25);
}
.wf-item {
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
  color: var(--text-muted);
}
.wf-item:hover { background: var(--surface-hover); color: var(--text); }
.wf-item.active { background: rgba(88,166,255,.12); color: var(--accent); }
.wf-item .wf-icon { font-size: 11px; flex-shrink: 0; color: var(--text-muted); }

.trigger-path-method-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.trigger-path-method-badge,
.trigger-path-method-prefix {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.22);
}
.trigger-path-method-prefix {
  font-size: 11px;
}
.trigger-item-conflict {
  color: var(--red);
}
.trigger-path-conflict {
  font-size: 11px;
  color: var(--red);
}

.wf-empty {
  list-style: none;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Workflow combobox (trigger target picker, etc.) */
.workflow-combobox {
  position: relative;
  margin-top: 4px;
}
.workflow-combobox-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.workflow-combobox-input-row input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.workflow-combobox-toggle {
  flex-shrink: 0;
  width: 36px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 4px 4px 0;
  background: var(--background-alt);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.workflow-combobox-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.workflow-combobox-open {
  z-index: 30;
}
.workflow-combobox-open .workflow-combobox-toggle {
  border-color: var(--accent);
  color: var(--accent);
}
.workflow-combobox-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 31;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.workflow-combobox-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.workflow-combobox-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}
.workflow-combobox-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  font-family: inherit;
}
.workflow-combobox-tree-item {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.workflow-combobox-item:hover,
.workflow-combobox-item-active {
  background: var(--surface-hover);
}
.workflow-combobox-item-name {
  font-family: var(--mono, monospace);
  font-size: 13px;
}
.workflow-combobox-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.workflow-combobox-tree {
  padding: 6px 0;
}
.workflow-combobox-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px 6px 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.workflow-combobox-group-header:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.workflow-combobox-group-header .chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}
.workflow-combobox-group-header .chevron.open {
  transform: rotate(90deg);
}
.workflow-combobox-group-body.collapsed {
  display: none;
}

/* Multi-select workflow picker (access control, etc.) */
.workflow-multi-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workflow-multi-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  padding: 6px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: var(--background-alt);
}
.workflow-multi-picker-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 4px;
}
.workflow-multi-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-raised, var(--background));
  font-family: var(--mono, monospace);
  font-size: 12px;
}
.workflow-multi-picker-chip button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.workflow-multi-picker-chip button:hover {
  color: var(--red);
}
.workflow-multi-picker .workflow-combobox {
  margin-top: 0;
}
.workflow-combobox-disabled .workflow-combobox-input-row {
  opacity: 0.72;
  pointer-events: none;
}
.sr-only-workflow-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-list { list-style: none; }
.nav-item {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background .15s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: rgba(88,166,255,.12); color: var(--accent); }

/* ----- Content ----- */
.content {
  flex: 1;
  overflow: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
}
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
}
.hidden { display: none !important; }

/* ----- Workflow detail view ----- */
.wf-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.wf-detail-info h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.wf-detail-info .wf-group-label {
  font-size: 12px;
  color: var(--text-muted);
}
.wf-detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Stat cards */
.stat-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 130px;
}
.stat-card .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 20px;
  font-weight: 600;
}

/* Buttons */
.btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--text-muted); }
.btn-primary {
  background: rgba(88,166,255,.15);
  border-color: rgba(88,166,255,.3);
  color: var(--accent);
}
.btn-primary:hover { background: rgba(88,166,255,.25); }

/* Run history section */
.runs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.runs-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.workflow-list-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.workflow-list-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.workflow-list-tab:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.workflow-list-tab.active {
  color: var(--accent);
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.12);
}
.run-table-wrap { flex: 1; overflow: auto; }
.run-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.run-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.run-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(48,54,61,.5);
  cursor: pointer;
}
.run-table tr:hover td { background: var(--surface-hover); }
.run-table tr.active-row td { background: rgba(88,166,255,.12); }

.rabbit-status {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  font-size: 13px;
}
.rabbit-status.ok {
  border-color: rgba(63,185,80,.45);
  color: var(--green);
  background: rgba(63,185,80,.08);
}
.rabbit-status.warn {
  border-color: rgba(210,153,34,.45);
  color: var(--orange);
  background: rgba(210,153,34,.08);
}
.rabbit-status.error {
  border-color: rgba(248,81,73,.45);
  color: var(--red);
  background: rgba(248,81,73,.08);
}

.rabbit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.rabbit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.rabbit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rabbit-card-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.rabbit-peek-card { margin-top: 8px; }

.rabbit-peek-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.rabbit-peek-controls input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

#rabbitPeekQueue { min-width: 260px; flex: 1; }
#rabbitPeekCount { width: 88px; }

.access-login-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.access-login-row input,
.access-admin-grid select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

.access-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.access-admin-grid label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.access-rights-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
}

/* IAM admin: master-detail, toggles, chips */
.iam-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.iam-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: -1px;
}
.iam-tab:hover { color: var(--text); }
.iam-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.iam-master-detail {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 16px;
  min-height: 480px;
}
@media (max-width: 900px) {
  .iam-master-detail { grid-template-columns: 1fr; }
}

.iam-master {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.iam-master-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.iam-filter-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
}
.iam-entity-list {
  list-style: none;
  margin: 0;
  overflow-y: auto;
  padding: 6px;
}
.iam-entity-item {
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
}
.iam-entity-item:hover { background: var(--surface-hover); }
.iam-entity-item.active {
  background: rgba(88, 166, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}
.iam-entity-name { font-size: 14px; font-weight: 600; }
.iam-entity-meta { color: var(--text-muted); font-size: 11px; }

.iam-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-y: auto;
  max-height: 70vh;
}
.iam-empty-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 48px 16px;
  text-align: center;
}
.iam-empty-state.small { padding: 16px 8px; }
.iam-empty-state.error { color: var(--red); }
.iam-loading { color: var(--text-muted); padding: 24px; }

.iam-detail-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.iam-detail-header h3 { margin: 0 0 6px; font-size: 18px; }
.iam-detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.iam-detail-actions { display: flex; gap: 8px; flex-shrink: 0; }

.iam-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 12px;
}
.iam-form-grid label {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 4px;
}
.iam-form-grid input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
}

.iam-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-direction: row;
}

.iam-smtp-meta {
  margin-top: 8px;
}

.iam-section { margin-top: 20px; }
.iam-section h4 { font-size: 14px; margin: 0 0 6px; }
.iam-hint { color: var(--text-muted); font-size: 12px; margin: 0 0 10px; }

.iam-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.iam-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 12px;
}
.iam-chip:hover { border-color: var(--accent); color: var(--text); }
.iam-chip--on {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.iam-policy-section {
  border-left: 3px solid var(--border);
  margin-bottom: 14px;
  padding-left: 12px;
}
.iam-policy-section--accent { border-left-color: var(--accent); }
.iam-policy-section--green { border-left-color: var(--green); }
.iam-policy-section--orange { border-left-color: var(--orange); }
.iam-policy-section--red { border-left-color: var(--red); }
.iam-policy-section-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.iam-policy-list { display: flex; flex-direction: column; gap: 6px; }
.iam-policy-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 6px 0;
}
.iam-policy-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.iam-policy-label { font-size: 13px; font-weight: 500; }
.iam-policy-scope {
  color: var(--text-muted);
  font-size: 11px;
  word-break: break-all;
}
.iam-policy-hint { color: var(--orange); font-size: 11px; }

.iam-toggle {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  gap: 8px;
  position: relative;
  user-select: none;
}
.iam-toggle input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}
.iam-toggle-label {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 24px;
  text-align: right;
}
.iam-toggle-track {
  background: var(--border);
  border-radius: 999px;
  display: inline-block;
  height: 22px;
  position: relative;
  transition: background 0.15s ease;
  width: 40px;
}
.iam-toggle-track::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 0.15s ease;
  width: 16px;
}
.iam-toggle input:checked + .iam-toggle-track::after {
  transform: translateX(18px);
}
.iam-toggle--accent input:checked + .iam-toggle-track { background: var(--accent); }
.iam-toggle--green input:checked + .iam-toggle-track { background: var(--green); }
.iam-toggle--orange input:checked + .iam-toggle-track { background: var(--orange); }
.iam-toggle--red input:checked + .iam-toggle-track { background: var(--red); }
.iam-toggle--inherited input:checked + .iam-toggle-track { background: var(--text-muted); opacity: 0.85; }
.iam-toggle--inherited { cursor: not-allowed; opacity: 0.9; }

.iam-wf-policy-list {
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.iam-wf-policy-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 12px;
}
.iam-wf-policy-row:last-child { border-bottom: none; }
.iam-wf-name {
  font-family: var(--mono, monospace);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iam-wf-toggles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.iam-catalog-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.iam-catalog-toolbar input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  flex: 1;
  font-size: 13px;
  min-width: 160px;
  padding: 8px 10px;
}
.iam-audit-detail {
  font-family: var(--mono, monospace);
  font-size: 11px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iam-access-review {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.iam-review-summary {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}
tr.iam-review-critical td:first-child { color: var(--red); font-weight: 600; }
tr.iam-review-warn td:first-child { color: var(--orange); }
tr.iam-review-info td:first-child { color: var(--text-muted); }
.iam-catalog-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.iam-catalog-desc-input {
  width: 100%;
  min-width: 180px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.iam-catalog-table tr.active { background: var(--surface-hover); }
.btn-danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--border));
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
}
.iam-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.iam-section-heading h4 { margin: 0; }
.iam-effective-meta { margin: 0; font-size: 11px; }
.iam-effective-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.iam-effective-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.iam-effective-row:last-child { border-bottom: none; }
.iam-effective-scope {
  font-size: 12px;
  word-break: break-all;
}
.iam-effective-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.iam-effective-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-hover);
  color: var(--text-muted);
}
.iam-effective-badge--direct {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}
.iam-effective-badge--group {
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}
.iam-section--effective {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.iam-inherited-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--border));
  background: color-mix(in srgb, var(--orange) 8%, var(--surface));
  font-size: 13px;
  line-height: 1.45;
}
.iam-inherited-notice .iam-btn-link { margin: 0 2px; vertical-align: baseline; }
.iam-policy-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.iam-inherited-on-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text-muted);
  white-space: nowrap;
}
.iam-inherited-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.iam-inherited-via {
  font-size: 11px;
  color: var(--text-muted);
}
.iam-btn-link {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 2px 6px;
  text-decoration: underline;
  cursor: pointer;
}
.iam-btn-link:hover { color: var(--text); }
.iam-wf-inherited-slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.iam-wf-edit-group { margin-left: 8px; flex-shrink: 0; }
.rabbit-status.iam-status-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.storage-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Status badges */
.badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}
.badge-green { background: rgba(63,185,80,.15); color: var(--green); }
.badge-red { background: rgba(248,81,73,.15); color: var(--red); }
.badge-orange { background: rgba(210,153,34,.15); color: var(--orange); }
.badge-blue { background: rgba(88,166,255,.15); color: var(--accent); }

/* ----- Run detail view ----- */
.run-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.run-nav-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.run-nav-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -2px 0 8px;
}
.run-detail-header h2 { font-size: 20px; font-weight: 600; }
.run-detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.run-detail-meta span { margin-right: 16px; }
.run-error {
  background: rgba(248,81,73,.1);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px;
  font-family: var(--mono);
  white-space: pre-wrap;
}

.run-artifacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.run-artifact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.run-artifact h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: .02em;
}

.run-artifact .code-block {
  margin: 0;
  max-height: 180px;
  overflow: auto;
}

#runPanel.run-panel-logs-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#runPanel.run-panel-logs-active #runLogsCard:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  margin-bottom: 0;
}

#runPanel.run-panel-logs-active .run-logs-artifact {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

.run-artifact.run-logs-artifact .run-logs-output.code-block {
  max-height: calc(100vh - 220px);
}

.run-logs-output {
  flex: 0 1 auto;
  width: 100%;
  max-height: calc(100vh - 220px);
  overflow: auto;
  margin: 0;
  line-height: 1.45;
  white-space: normal;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line + .log-line {
  margin-top: 2px;
}

.log-note {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.log-ts {
  color: var(--text-muted);
}

.log-level-info {
  color: var(--accent);
  font-weight: 600;
}

.log-level-warning {
  color: var(--orange);
  font-weight: 600;
}

.log-level-error {
  color: var(--red);
  font-weight: 600;
}

.log-level-debug {
  color: var(--text-muted);
}

.log-status-ok {
  color: var(--green);
  font-weight: 600;
}

.log-status-err {
  color: var(--red);
  font-weight: 600;
}

.log-flag-skip {
  color: var(--orange);
}

.log-exec-type {
  color: var(--text);
  font-weight: 600;
}

.run-logs-output .method-badge {
  margin-right: 4px;
  vertical-align: baseline;
}

.run-artifact-wide {
  grid-column: 1 / -1;
}

.run-overview-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.run-details-tab .run-side-column {
  max-width: 960px;
}

.run-side-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.run-artifact-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.run-artifact-section h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: .02em;
}

.run-artifact-source {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 6px;
}

.run-artifact-section summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .02em;
}

.run-artifact-section summary::-webkit-details-marker {
  display: none;
}

.run-artifact-section summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--accent);
}

.run-artifact-section[open] summary::before {
  content: "▾";
}

.run-artifact-section .code-block {
  margin: 8px 0 0;
  max-height: 210px;
  overflow: auto;
}

@media (max-width: 900px) {
  .run-artifacts {
    grid-template-columns: 1fr;
  }

  .run-overview-layout {
    grid-template-columns: 1fr;
  }
}

/* ----- Graph container ----- */
.graph-container {
  flex: 1;
  overflow: auto;
  min-height: 200px;
  background: linear-gradient(180deg, var(--canvas), var(--canvas-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

/* Pipeline graph nodes */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}
.pipe-node {
  position: relative;
  margin-left: 40px;
  padding: 14px 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  min-width: 260px;
  max-width: 600px;
}
.pipe-node:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.pipe-node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88,166,255,.3);
}
.pipe-node .node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pipe-node .node-id { font-weight: 600; font-size: 14px; }
.pipe-node .node-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  line-height: 1;
}
.pipe-node .node-type {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(139,148,158,.15);
  color: var(--text-muted);
  font-family: var(--mono);
}
.pipe-node .node-status {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
}
.pipe-node .node-duration {
  font-size: 11px;
  color: var(--text-muted);
}

.pipe-node.status-ok,
.pipe-node.status-success,
.pipe-node.status-succeeded { border-left: 3px solid var(--green); }
.pipe-node.status-failed { border-left: 3px solid var(--red); }
.pipe-node.status-skipped { border-left: 3px solid var(--text-muted); opacity: .6; }
.pipe-node.status-canceled { border-left: 3px solid var(--orange); }
.pipe-node.status-ignored { border-left: 3px solid var(--orange); }
.pipe-node.status-error { border-left: 3px solid var(--red); }

.pipe-node.type-scoped_context {
  border-left: 3px solid var(--accent);
  cursor: default;
}
.pipe-node.type-scoped_context .scoped-context-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pipe-node.type-scoped_context .scoped-context-provider {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pipe-node.type-scoped_context .scoped-context-table {
  font-size: 12px;
  width: 100%;
}

.run-step-view .pipe-node {
  border-width: 2px;
  background: var(--surface);
}

.run-step-view .pipe-node.status-ok,
.run-step-view .pipe-node.status-success,
.run-step-view .pipe-node.status-succeeded {
  border-color: var(--green);
  border-left: 4px solid var(--green);
}

.run-step-view .pipe-node.status-failed,
.run-step-view .pipe-node.status-error {
  border-color: var(--red);
  border-left: 4px solid var(--red);
}

.run-step-view .pipe-node.status-skipped,
.run-step-view .pipe-node.status-not-reached {
  border-color: var(--blue);
  border-left: 4px solid var(--blue);
  opacity: 1;
}

.run-step-view .pipe-node.status-canceled,
.run-step-view .pipe-node.status-ignored {
  border-color: var(--orange);
  border-left: 4px solid var(--orange);
}

.run-step-view .pipe-node.type-scoped_context {
  border-color: var(--accent);
  border-left: 4px solid var(--accent);
  cursor: default;
}

.pipe-connector {
  margin-left: 58px;
  width: 2px;
  height: 20px;
  background: var(--border);
}

.pipe-loop {
  margin-left: 40px;
  border: 1px dashed var(--purple);
  border-radius: var(--radius);
  padding: 12px;
  max-width: 100%;
  box-sizing: border-box;
}
.pipe-loop .loop-header {
  font-size: 12px;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
}
.pipe-loop .loop-header .node-icon {
  font-size: 16px;
  min-width: 20px;
  margin-right: 4px;
}
.pipe-loop .loop-header.selected {
  background: rgba(88,166,255,.16);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.pipe-loop .loop-body { padding-left: 8px; }
.pipe-loop .pipe-node { margin-left: 24px; }
.pipe-loop .pipe-connector { margin-left: 42px; }

.loop-iteration-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.loop-iteration-btn {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  border-radius: 6px;
  width: 24px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
}

.loop-iteration-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.loop-iteration-pill {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 46px;
  text-align: center;
}

.loop-iteration-view {
  display: flex;
  flex-direction: column;
}

.loop-iteration-info {
  margin-left: 24px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.if-split {
  margin-left: 24px;
  border: 1px solid rgba(88,166,255,.45);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(88,166,255,.08), transparent);
  padding: 10px;
}

.if-split-header {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
}
.if-split-header .node-icon {
  font-size: 16px;
  min-width: 20px;
}

.if-split-lanes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

/* try/catch: stack catch below try (not side-by-side like if then/else) */
.try-split .if-split-lanes {
  grid-template-columns: 1fr;
  gap: 8px;
}

.if-lane {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 86px;
  min-width: 0;
}

/* Nested if inside then/else (or parallel lane): stack branches vertically */
.if-split-nested .if-split-lanes,
.if-lane > .if-split .if-split-lanes {
  grid-template-columns: 1fr;
  gap: 8px;
}

.if-split-nested,
.if-lane > .if-split {
  margin-left: 0;
  padding: 8px;
}

.if-split-nested .if-lane,
.if-lane > .if-split .if-lane {
  min-height: 0;
}

.if-lane-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
}

.if-lane-true .if-lane-title { color: var(--green); }
.if-lane-false .if-lane-title { color: var(--orange); }

.if-lane .pipe-node {
  margin-left: 0;
  max-width: none;
}

.if-lane .if-lane-connector {
  margin-left: 18px;
}

.if-lane-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.if-lane-add-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: .65;
  transition: opacity .15s, background .15s;
  user-select: none;
}
.if-lane-add-btn:hover {
  opacity: 1;
  background: rgba(88,166,255,.1);
}
.if-lane-add-icon {
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}

.pipe-insert-zone-visible {
  opacity: 1 !important;
}

.type-http .node-type  { background: rgba(88,166,255,.15); color: var(--blue); }
.type-xslt .node-type  { background: rgba(188,140,255,.15); color: var(--purple); }
.type-ftp .node-type   { background: rgba(210,153,34,.15);  color: var(--orange); }
.type-ssh .node-type   { background: rgba(210,153,34,.15);  color: var(--orange); }
.type-sftp .node-type  { background: rgba(210,153,34,.15);  color: var(--orange); }
.type-liquid .node-type { background: rgba(63,185,80,.15);  color: var(--green); }
.type-xml2json .node-type, .type-json2xml .node-type { background: rgba(188,140,255,.15); color: var(--purple); }
.type-context_set .node-type, .type-context_increment .node-type, .type-context_extract_json .node-type, .type-context_extract_xml .node-type {
  background: rgba(210,153,34,.15); color: var(--orange);
}
.type-json_set .node-type, .type-xml_set_text .node-type {
  background: rgba(210,153,34,.15); color: var(--orange);
}

/* ----- Detail panel (right side) ----- */
.detail-panel {
  width: 420px;
  min-width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.detail-header h3 { font-size: 14px; font-weight: 600; }

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}
.btn-close:hover { color: var(--text); }

.detail-body { flex: 1; overflow: auto; }

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { padding: 16px; }

.detail-split-stack {
  display: grid;
  gap: 10px;
  height: calc(100vh - 320px);
  min-height: 320px;
}

.detail-data-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.detail-data-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.icon-btn {
  padding: 2px 8px;
  min-height: auto;
  font-size: 12px;
}

.detail-data-block .code-block {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 60vh;
  overflow: auto;
  color: var(--text);
}

/* ----- Workflow design overlay ----- */
/* ---- Design tab (main panel, replaces modal for graph view) ---- */
.design-tab-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 0 6px;
  gap: 8px;
}
.design-tab-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.design-tab-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.design-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
  min-height: 0;
}
.design-tab-flow {
  min-width: 0;
  height: calc(100vh - 250px);
  min-height: 420px;
  overflow-y: auto;
}

/* ---- Edit mode: insert zones & drag-and-drop ---- */
.pipe-insert-zone {
  display: flex;
  align-items: center;
  margin-left: 40px;
  height: 20px;
  opacity: 0;
  transition: opacity .15s;
}
.pipe-insert-zone:hover,
.pipe-insert-zone.drag-over {
  opacity: 1;
}
.pipe-insert-zone.drag-over {
  background: rgba(88,166,255,.08);
  border-radius: 4px;
}
.pipe-insert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background .12s, transform .1s;
}
.pipe-insert-btn:hover {
  background: rgba(88,166,255,.18);
  transform: scale(1.15);
}
.pipe-drag-handle {
  font-size: 16px;
  color: var(--text-muted);
  cursor: grab;
  margin-right: 6px;
  opacity: .5;
  user-select: none;
  flex-shrink: 0;
}
.pipe-drag-handle:active { cursor: grabbing; }
.pipe-node[draggable]:hover .pipe-drag-handle { opacity: 1; }
.pipe-node.dragging {
  opacity: .4;
  border-style: dashed;
}

/* ---- Trigger-only modal (simplified from full design modal) ---- */
.trigger-only-modal {
  max-width: 680px !important;
}
.trigger-only-modal .design-trigger-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.design-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.design-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90vw;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative; /* anchor for step-picker-modal */
}
.design-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.design-modal-header h3 { font-size: 16px; font-weight: 600; }
.design-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.design-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}

.design-flow {
  min-width: 0;
  height: 580px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--canvas), var(--canvas-alt));
  overflow: hidden;
  position: relative;
}

/* In the design tab, prefer viewport-driven height and internal scrolling.
   This keeps long step lists reachable (scroll + drag/drop insert zones). */
.design-flow.design-tab-flow {
  height: calc(100vh - 250px);
  min-height: 420px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Design flow pan/zoom hint */
.design-flow::after {
  content: "Scroll to zoom · Drag to pan · Click a node to inspect";
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0.7;
}

/* Graph toolbar (zoom / fit / toggle) */
.graph-toolbar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  pointer-events: all;
}
.graph-tb-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 7px;
  font-size: 13px;
  border-radius: 3px;
  line-height: 1;
  transition: background 0.1s;
}
.graph-tb-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.graph-tb-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 4px;
  display: inline-block;
  flex-shrink: 0;
}
.graph-undo-btn {
  font-size: 14px;
  min-width: 28px;
  padding: 2px 6px;
}
.graph-undo-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* palette sidebar (visible in edit mode via .edit-mode class on .design-flow) */
.graph-palette {
  position: absolute;
  top: 44px;
  left: 8px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 130px;
  max-height: calc(100% - 56px);
  overflow-y: auto;
  pointer-events: all;
  display: none;
  flex-direction: column;
}
.design-flow.edit-mode .graph-palette { display: flex; }
.graph-palette-group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 6px 8px 2px 8px;
}
.graph-palette-chip {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(128,128,128,0.15);
  color: var(--text);
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: "JetBrains Mono","Consolas",monospace;
  transition: background 0.1s;
}
.graph-palette-chip:hover { background: var(--surface-hover); }

/* Pipeline fallback toggle bar */
.graph-view-toggle-bar {
  padding: 6px 10px 6px 0;
}
.graph-toggle-btn { font-size: 11px; }

/* ---- Design overlay: edit mode save bar ---- */
.design-edit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(210,153,34,0.08);
  border-bottom: 1px solid rgba(210,153,34,0.3);
  font-size: 12px;
  flex-wrap: wrap;
}
.design-edit-pill {
  font-weight: 600;
  color: var(--orange);
  font-size: 11px;
  background: rgba(210,153,34,0.15);
  border-radius: 10px;
  padding: 2px 8px;
}
.design-edit-dirty-pill {
  font-size: 11px;
  color: var(--orange);
}
.design-edit-error {
  color: var(--red);
  font-size: 11px;
}

/* ---- Step edit panel (in detail aside) ---- */
.design-step-edit-panel { padding-top: 8px; }
.design-step-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.design-step-edit-json {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  font-family: "JetBrains Mono", "Consolas", "Fira Code", monospace;
  font-size: 11px;
  line-height: 1.55;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.design-step-edit-json:focus { outline: none; border-color: var(--blue); }
.design-step-edit-error {
  color: var(--red);
  font-size: 11px;
  min-height: 18px;
  margin-top: 4px;
}

/* ---- Step edit form (SEF) ---- */
.sef-form { display: flex; flex-direction: column; gap: 0; padding-top: 4px; }
.sef-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 8px 0 4px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.sef-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.sef-label {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sef-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.sef-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.sef-input:focus { outline: none; border-color: var(--blue); }
.sef-textarea {
  font-family: "JetBrains Mono", "Consolas", "Fira Code", monospace;
  font-size: 11px;
  line-height: 1.55;
  resize: vertical;
  min-height: 60px;
}
.sef-remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 6px;
  align-self: stretch;
  transition: color .15s, border-color .15s;
}
.sef-remove-btn:hover { color: var(--red); border-color: var(--red); }
.sef-help-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  padding: 0 2px;
  line-height: 1;
  opacity: .65;
  transition: opacity .15s;
}
.sef-help-btn:hover { opacity: 1; }
.sef-add-row { margin-top: 4px; }
.sef-add-select {
  width: 100%;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.sef-add-select:focus { outline: none; border-color: var(--blue); color: var(--text); }
.sef-json-toggle-row { margin-top: 8px; display: flex; justify-content: flex-end; }

/* ---- Step picker modal ---- */
/* Section headers in trigger/step capability pickers (service or category) */
.capability-modal-provider-header {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
  margin-top: 0;
  letter-spacing: 0.01em;
}

.step-picker-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.step-picker-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(600px, 94vw);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Duidelijke rand t.o.v. de achtergrond (vooral light theme) */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 10%, var(--border)),
    0 8px 32px rgba(0, 0, 0, 0.45);
}
[data-theme="light"] .step-picker-inner {
  border-color: color-mix(in srgb, var(--border) 70%, #94a3b8);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #64748b 22%, transparent),
    0 12px 40px rgba(15, 23, 42, 0.14);
}
.step-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.step-picker-search-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.step-picker-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.step-picker-search:focus { border-color: var(--accent); }
/* Registry-zoekveld (Add step): geen browser-default blauwe ring; rustige rand + lichte achtergrond */
.step-picker-search-registry {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--text));
  background: color-mix(in srgb, var(--surface-raised) 55%, var(--surface));
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
[data-theme="light"] .step-picker-search-registry {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.step-picker-search-registry:hover {
  border-color: color-mix(in srgb, var(--border) 50%, var(--text-muted));
}
.step-picker-search-registry:focus {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  background: var(--surface);
}
[data-theme="light"] .step-picker-search-registry:focus {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 42%, #94a3b8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.step-picker-search-registry::placeholder {
  color: var(--text-muted);
}
.step-picker-registry-section .step-picker-search-row {
  background: color-mix(in srgb, var(--surface-raised) 40%, transparent);
  border-bottom-color: color-mix(in srgb, var(--border) 85%, var(--text));
  margin-left: -18px;
  margin-right: -18px;
  padding-left: 18px;
  padding-right: 18px;
}
.step-picker-registry-section {
  padding: 12px 18px 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step-picker-registry-label {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.step-picker-registry-list {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 8px;
  flex: 1;
  min-height: 0;
}
.step-picker-registry-group {
  margin-bottom: 16px;
}
.step-picker-registry-group:last-child {
  margin-bottom: 4px;
}
.step-picker-registry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.step-registry-chip-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.step-picker-configure-icon {
  margin-right: 6px;
}
[data-theme="light"] .step-picker-registry-section .step-picker-search-row {
  background: #eef2f7;
}
.step-picker-list { overflow-y: auto; flex: 1; }
.step-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.step-picker-row:last-child { border-bottom: none; }
.step-picker-row:hover { background: var(--surface-hover); }
.step-picker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.step-picker-row-body { flex: 1; min-width: 0; }
.step-picker-row-name {
  display: block;
  font-size: 12px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-weight: 600;
  color: var(--text);
}
.step-picker-row-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-picker-row-group {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Registry grid chips (“Add step”) — stronger borders & readable secondary text */
.step-registry-chip {
  width: 100%;
  height: 122px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 4px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: normal;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 16%, var(--border)) !important;
  background: var(--surface-raised);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
[data-theme="light"] .step-registry-chip {
  box-shadow: 0 1px 3px rgba(21, 34, 56, 0.08);
}
.step-registry-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border)) !important;
  background: var(--surface-hover);
}
.step-registry-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.step-registry-chip--selected {
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    0 8px 22px color-mix(in srgb, var(--accent) 22%, transparent);
  background: var(--surface-hover);
}
.step-registry-chip-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.step-registry-chip-desc {
  font-size: 12px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in srgb, var(--text) 58%, var(--text-muted));
}
.step-registry-chip-meta {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
  color: color-mix(in srgb, var(--text) 42%, var(--text-muted));
  font-family: var(--mono);
}

/* ---- Step picker: configure panel (step 2) ---- */
.step-picker-configure { overflow-y: auto; flex: 1; padding: 10px 14px; }
.spc-form { display: flex; flex-direction: column; gap: 10px; }
.spc-field { display: flex; flex-direction: column; gap: 3px; }
.spc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.spc-hint { font-weight: 400; text-transform: none; }
.spc-input, .spc-select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-family: var(--mono);
}
.spc-input:focus, .spc-select:focus { border-color: var(--accent); }
.spc-actions { display: flex; gap: 8px; margin-top: 4px; }
.spc-error { color: var(--red); font-size: 11px; margin-top: 2px; }

/* ---- Trigger edit form in detail panel ---- */
.design-trigger-edit-panel { padding: 6px 0; }
.trigger-edit-form { display: flex; flex-direction: column; gap: 10px; }
.trigger-edit-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trigger-edit-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.trigger-edit-sub { padding-left: 4px; display: flex; flex-direction: column; gap: 5px; }
.trigger-edit-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.trigger-edit-input, .trigger-edit-select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-family: var(--mono);
  width: 100%;
  box-sizing: border-box;
}
.trigger-edit-input:focus, .trigger-edit-select:focus { border-color: var(--accent); }
.trigger-edit-methods { display: flex; flex-wrap: wrap; gap: 5px; }
.trigger-method-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  cursor: pointer;
  user-select: none;
}
.trigger-method-pill:has(input:checked) {
  background: rgba(88,166,255,.15);
  border-color: var(--accent);
  color: var(--accent);
}

.design-step-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.design-step-detail-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.design-step-detail-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.design-step-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.design-step-tab {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.design-step-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.design-step-detail .code-block {
  max-height: 52vh;
}

.design-trigger {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  margin-bottom: 16px;
}

.design-trigger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.design-trigger-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.design-trigger-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.design-trigger label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.design-preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.design-preset-row label {
  margin-bottom: 0;
}

.design-preset-select,
.design-preset-name {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 12px;
}

.design-preset-select {
  min-width: 180px;
}

.design-preset-name {
  min-width: 160px;
}

.design-payload {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 10px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

  .design-layout {
    grid-template-columns: 1fr;
  }

  .design-step-detail {
    position: static;
  }
}

/* Rerun modal */
.rerun-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rerun-modal.hidden {
  display: none;
}

.rerun-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.rerun-modal-content {
  position: relative;
  z-index: 1001;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(600px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

#schedulesListModal {
  z-index: 1100;
}

#scheduleModal {
  z-index: 1200;
}

#scheduleModal .rerun-modal-content {
  width: min(720px, 92vw);
  max-height: 88vh;
}

.schedule-cron-mode-toggle {
  display: flex;
  gap: 8px;
}

.schedule-cron-mode-toggle .btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.schedule-cron-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-cron-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.schedule-cron-preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-cron-preview code {
  margin-left: 6px;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}

.template-field-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
}

.template-field-textarea {
  width: 100%;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.35;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .schedule-cron-grid {
    grid-template-columns: 1fr;
  }
}

.rerun-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.rerun-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.rerun-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.rerun-payload {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 12px;
}

.rerun-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--red);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 12px;
}

.rerun-error.hidden {
  display: none;
}

.rerun-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* Connection type tab bar */
.connections-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.connections-tab-bar button {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.connections-tab-bar button:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.connections-tab-bar button.active {
  background: rgba(88,166,255,.15);
  border-color: rgba(88,166,255,.4);
  color: var(--accent);
  font-weight: 600;
}

/* New-resource modal form fields */
.new-resource-field {
  margin-bottom: 12px;
}
.new-resource-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.new-resource-field input,
.new-resource-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background-alt);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.new-resource-field input:focus,
.new-resource-field select:focus {
  outline: none;
  border-color: var(--accent);
}
