.wiz-steps {
    --dot: 28px;
    --line-h: 8px;
    position: relative;
    padding: 8px 0 6px;
}

.wiz-steps__track {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(var(--dot) / 2 + 7px);
    height: var(--line-h);
    transform: translateY(-50%);
    background: #eaeef1;
    border-radius: 999px;
    overflow: hidden;
    z-index: 0;
}

.wiz-steps__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--prog, 0%);
    background: var(--brand-primary);
    transition: width .25s ease;
}

.wiz-steps__list {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: -2px;
}

.wiz-step {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    margin-top: 0;
}

.wiz-step__dot {
    width: var(--dot);
    height: var(--dot);
    border-radius: 50%;
    border: 2px solid var(--ui-border);
    background: #fff;
    color: #666;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
}

.wiz-step__label {
    display: block;
    margin-top: 0;
    color: #5d6b75;
    white-space: nowrap;
}

.wiz-steps .wiz-step.is-done .wiz-step__dot {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.wiz-steps .wiz-step.is-done .wiz-step__label {
    color: var(--brand-primary);
}

.wiz-steps .wiz-step.is-current .wiz-step__dot {
    border-color: var(--brand-primary);
}

/* On very small screens hide step labels to keep dots readable */
@media (max-width: 479.98px) {
    .wiz-step__label {
        display: none;
    }
}

.wiz-status {
    padding: 10px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-light);
    margin-bottom: 18px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.wiz-status__msg {
    font-size: .95rem;
}

.wiz-status.is-go {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px rgba(0, 126, 69, .25);
}

.wiz-stage {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s ease, transform .25s ease;
}

.wiz-stage.is-ready.is-entered {
    opacity: 1;
    transform: none;
}

.wiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 8px;
}

.wiz-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: var(--ui-white);
    transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}

.wiz-card:is(:hover,:focus-visible) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}

.wiz-card__media img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.wiz-card__title {
    margin-top: 8px;
    font-weight: 600;
    text-align: center;
}

.wiz-card.is-selected {
    outline: 2px solid var(--brand-primary);
}

.is-dimmed {
    opacity: .35;
    pointer-events: none;
}

.wiz-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wiz-side {
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: var(--ui-white);
    padding: 16px;
}

.wiz-side.is-connected {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}

.wiz-side__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.wiz-side__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e1e6eb;
    padding: 4px;
    background: #fff;
}

.wiz-side__title {
    margin: 0;
    font-weight: 700;
    font-size: .95rem;
}

.wiz-side__body {
    font-size: .9rem;
}

.wiz-badge {
    margin-left: auto;
    font-size: .75rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.wiz-badge--ok {
    color: var(--brand-primary);
}

.wiz-badge--warn {
    color: var(--table-header-bg);
}

.wiz-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

@media (max-width: 800px) {
    .wiz-config-grid {
        grid-template-columns: 1fr;
    }
}

.wiz-flows {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.wiz-flow {
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: var(--ui-white);
    padding: 14px 16px 10px;
    padding-bottom: 14px;
}

.wiz-flow.is-on {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 214, 57, .10);
}

.wiz-flow:not(.is-on) .wiz-flow__left {
    opacity: .55;
    filter: grayscale(.12);
}

.wiz-flow:not(.is-on) .wiz-flow__logo {
    opacity: .8;
}

.wiz-flow__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.wiz-flow__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.wiz-flow__diagram {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wiz-flow__logo {
    width: 44px;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    object-fit: contain;
}

.wiz-flow__arrow {
    width: 32px;
    height: 10px;
    stroke: #6b7280;
    stroke-width: 1.6;
}

.wiz-flow__title {
    margin: 8px 0 2px;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.25;
}

.wiz-flow__desc {
    margin: 8px 0 2px;
    font-size: .92rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, .70);
}

.wiz-toggle {
    --track: #e5e7eb;
    --on: var(--brand-primary);
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: var(--track);
    border: 1px solid var(--ui-border);
    padding: 0;
}

.wiz-toggle__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    transition: transform .18s ease;
}

.wiz-toggle.is-on {
    background: color-mix(in srgb, var(--on) 20%, #fff 80%);
    border-color: var(--on);
}

.wiz-toggle.is-on .wiz-toggle__knob {
    transform: translateX(20px);
}

/* Small toggle variant for child agent toggles in modals */
.wiz-toggle--sm {
    width: 36px;
    height: 20px;
    padding: 0;
}

.wiz-toggle--sm .wiz-toggle__knob {
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
}

.wiz-toggle--sm.is-on .wiz-toggle__knob {
    transform: translateX(16px);
}

.wiz-advanced {
    margin-top: 50px;
}

.wiz-advanced .btn-link {
    background: transparent !important;
    color: var(--text-link);
    padding: 0;
    border: 0;
    box-shadow: none;
}

.wiz-advanced .btn-link:hover,
.wiz-advanced .btn-link:focus {
    text-decoration: underline;
}

.wiz-advanced .btn-link:disabled {
    opacity: .55;
    cursor: not-allowed;
    text-decoration: none;
}

.wiz-confirm3 {
    display: grid;
    grid-template-columns: 1fr 220px 1fr;
    gap: 20px;
    align-items: stretch;
}

.wiz-confirm__sys {
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ui-white);
    align-self: stretch;
}

.wiz-confirm__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.wiz-confirm__name {
    font-weight: 600;
}

.wiz-confirm__type {
    color: rgba(0, 0, 0, .55);
}

.wiz-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--ui-light);
    border: 1px solid var(--ui-border);
}

.wiz-confirm__flowscol {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.flowchip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-white);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

.flowchip__label {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.2;
    margin: 0;
}

.flowchip__arrow {
    width: 110px;
    height: 10px;
    stroke: #6b7280;
    stroke-width: 1.6;
    fill: none;
}

.flowchip.is-rl .flowchip__arrow {
    transform: scaleX(-1);
    transform-origin: 50% 50%;
}

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

    .wiz-confirm__flowscol {
        margin: 4px 0 10px;
    }
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ui-border);
}

.wizard-footer__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-footer__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wizard-footer__right form {
    display: inline-block;
    margin: 0;
}

.wizard-footer__left form {
    margin: 0;
    display: inline-block;
}

.connector-card {
    transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease, border-color .2s ease;
}

.connector-card.is-selected-left,
.connector-card.is-selected-right {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.connector-card.is-selected-left,
.connector-card.is-selected-right {
    box-shadow: 0 0 0 2px rgba(0, 126, 69, .25);
}

.connector-card.is-highlight {
    box-shadow: 0 0 0 3px rgba(0, 126, 69, .15);
}

.connector-card.is-dimmed {
    opacity: .35;
    pointer-events: none;
}


/* ======================================================================
   V2 WIZARD — Instrument Panel Design System
   Scoped styles for the v2 setup wizard
====================================================================== */

/* -- Connect step: Pair Preview Strip -------------------------------- */

.v2-pair-preview {
  display: none;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 18px;
  padding: 14px 20px;
  margin-bottom: 18px;
  overflow: hidden;
}

.v2-pair-preview.is-visible {
  display: flex;
}

.v2-pair-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.v2-pair-slot__logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid #e1e6eb;
  background: #f8fafc;
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}

.v2-pair-slot__logo-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-pair-slot__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.v2-pair-slot__role {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v2-pair-slot .v2-pair-slot__role { color: var(--brand-primary); }

.v2-pair-slot__name {
  font-weight: 600;
  font-size: .9rem;
  color: #0d1117;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-pair-slot__name--empty {
  color: #94a3b8;
  font-weight: 400;
}

.v2-pair-arc {
  flex: 1;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.v2-pair-arc svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes v2-dash-flow {
  from { stroke-dashoffset: 24; }
  to   { stroke-dashoffset: 0; }
}

.v2-pair-arc__line {
  stroke: var(--brand-primary);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  fill: none;
  animation: v2-dash-flow .8s linear infinite;
  opacity: .65;
}

.v2-pair-arc__head {
  fill: var(--brand-primary);
  opacity: .85;
}

/* Role badge injected onto selected cards by JS */
.v2-ct-role-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 2;
}

.v2-ct-role-badge--source,
.v2-ct-role-badge--dest {
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff 90%);
  color: var(--brand-primary-hover);
}

/* Refined v2 connector cards */
.wiz-card.v2-ct-card {
  position: relative;
  border: 1.5px solid #e1e6eb;
  border-radius: 14px;
  background: #fff;
  padding: 18px 12px 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.wiz-card.v2-ct-card:hover:not(.is-dimmed) {
  border-color: #94a3b8;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  transform: translateY(-2px);
}

.wiz-card.v2-ct-card .wiz-card__media {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid #f0f4f8;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  overflow: hidden;
  padding: 6px;
}

.wiz-card.v2-ct-card .wiz-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wiz-card.v2-ct-card .wiz-card__title {
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.wiz-card.v2-ct-card.is-selected-left,
.wiz-card.v2-ct-card.is-selected-right {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0,126,69,.14);
  transform: translateY(-2px);
}

.wiz-card.v2-ct-card.is-highlight {
  border-color: rgba(0,126,69,.45);
  box-shadow: 0 0 0 2px rgba(0,126,69,.07);
}

.wiz-card.v2-ct-card.is-dimmed {
  opacity: .28;
  pointer-events: none;
  transform: none;
}

.v2-ct-placeholder {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulse dot in wiz-status bar */
@keyframes v2-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,126,69,.45); }
  50%       { box-shadow: 0 0 0 5px rgba(0,126,69,0); }
}

.wiz-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background .25s;
}

.wiz-status.is-go .wiz-status__dot {
  background: var(--brand-primary);
  animation: v2-pulse 1.6s ease-in-out infinite;
}

/* Override wiz-status to use flex row with dot */
.wiz-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 14px;
  border: 1.5px solid #e1e6eb;
  border-radius: 999px;
  background: #fafbfc;
  margin-bottom: 20px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: fit-content;
  max-width: 100%;
}

.wiz-status.is-go {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff 95%);
  box-shadow: 0 0 0 3px rgba(0,126,69,.07);
}

.wiz-status__msg {
  font-size: .88rem;
  color: #374151;
}

/* -- Authenticate step ----------------------------------------------- */

.v2-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 6px;
}

.v2-auth-side {
  display: flex;
  flex-direction: column;
}

.v2-auth-side:first-child {
  border-right: 1.5px solid #e1e6eb;
}

.v2-auth-side__label {
  padding: 18px 22px;
  border-bottom: 1.5px solid #e1e6eb;
  background: #f8fafc;
}

.v2-auth-side__label > span {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  color: #0d1117;
}

.v2-auth-side__label small {
  display: block;
  color: #64748b;
  font-size: .76rem;
  margin-top: 2px;
  font-weight: 400;
}

.v2-auth-card {
  padding: 24px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: none;
  border-radius: 0;
  background: #fff;
}

.v2-auth-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.v2-auth-card__prompt {
  margin: 0;
  font-size: .88rem;
  color: #4b5563;
}

.v2-auth-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e1e6eb;
  padding: 6px;
  background: #fff;
  flex-shrink: 0;
}

.v2-auth-logo-sm {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 5px;
  border: 1px solid #e1e6eb;
  padding: 2px;
  background: #fff;
}

.v2-auth-card__title {
  margin: 0 0 3px;
  font-size: .98rem;
  font-weight: 700;
  color: #0d1117;
}

.v2-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-auth-connected {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff 95%);
  border: none;
}

.v2-auth-connected__icon { flex-shrink: 0; }

.v2-auth-connected__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v2-auth-connected__title {
  font-weight: 700;
  font-size: .95rem;
  color: #0d1117;
}

.v2-auth-connected__sub {
  font-size: .82rem;
  color: #64748b;
}

@media (max-width: 640px) {
  .v2-auth-grid { grid-template-columns: 1fr; }
  .v2-auth-side:first-child {
    border-right: none;
    border-bottom: 1.5px solid #e1e6eb;
  }
}

/* -- Agents step ----------------------------------------------------- */

.wiz-agents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.wiz-agents-column {
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wiz-agents-column__header {
  padding: 14px 20px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #f0f4f8;
}

.wiz-agents-column__header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: #0d1117;
}

.wiz-agents-column__header p {
  margin: 2px 0 0;
  font-size: .78rem;
  color: #64748b;
}

.wiz-agents-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.wiz-agents-column .alert { margin: 14px; }

.v2-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1.5px solid #e9edf2;
  border-radius: 12px;
  padding: 13px 15px;
  background: #fafbfc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.v2-agent.is-on {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 4%, #fff 96%);
  box-shadow: 0 1px 5px rgba(0,126,69,.08);
}

.v2-agent:not(.is-on) .v2-agent__info { opacity: .55; }

.v2-agent__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.v2-agent__mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.v2-agent__mode-badge--export {
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff 88%);
  color: var(--brand-primary-hover);
}
.v2-agent__mode-badge--import {
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff 94%);
  color: var(--brand-primary);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, #fff 80%);
}

.v2-agent__info { flex: 1; min-width: 0; }

.v2-agent__title {
  margin: 0 0 2px;
  font-size: .9rem;
  font-weight: 600;
  color: #1e293b;
}

.v2-agent__desc {
  margin: 0;
  font-size: .8rem;
  color: #64748b;
  line-height: 1.4;
}

.v2-agent__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .wiz-agents-grid { grid-template-columns: 1fr; }
  .v2-agent { flex-wrap: wrap; }
  .v2-agent__controls { align-self: flex-end; }
}

/* -- Confirm step: Flow Pipeline ------------------------------------- */

.v2-flow-pipeline {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
}

.v2-flow-node {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 20px;
  gap: 6px;
  min-width: 130px;
}

.v2-flow-node__logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 11px;
  border: 1px solid #e1e6eb;
  padding: 7px;
  background: #f8fafc;
}

.v2-flow-node__logo-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-flow-node__name {
  font-weight: 700;
  font-size: .85rem;
  color: #0d1117;
  text-align: center;
  line-height: 1.3;
}

.v2-flow-node__type {
  font-size: .72rem;
  color: #64748b;
  text-align: center;
}

.v2-flow-node__badge {
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 7px;
  border-radius: 999px;
}

.v2-flow-node--source .v2-flow-node__badge,
.v2-flow-node--dest   .v2-flow-node__badge {
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff 90%);
  color: var(--brand-primary-hover);
}

.v2-flow-agents-node {
  flex: 1;
  border-left: 1.5px solid #e1e6eb;
  border-right: 1.5px solid #e1e6eb;
  background: #f8fafc;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.v2-flow-agents-node__label {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.v2-flow-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e1e6eb;
  font-size: .78rem;
  font-weight: 500;
  color: #374151;
  position: relative;
  overflow: hidden;
}

.v2-confirm-section {
  border: 1.5px solid #e1e6eb;
  border-radius: 16px;
  background: #fff;
  padding: 18px 22px;
  margin-bottom: 14px;
}

.v2-confirm-section--info {
  background: #f8fafc;
  border-color: #e9edf2;
}

.v2-confirm-section__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  margin-bottom: 14px;
}

.v2-confirm-agents {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-confirm-agent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-confirm-agent__name {
  font-size: .88rem;
  color: #374151;
}

.v2-confirm-next {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-confirm-next li {
  font-size: .86rem;
  color: #374151;
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}

.v2-confirm-next li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: .8rem;
  top: 1px;
}

.v2-confirm-section--agents {
  border: 1.5px solid #e1e6eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}

/* backwards-compat confirm grid */
.v2-confirm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.v2-confirm-conn-card {
  border: 1.5px solid #e1e6eb;
  border-radius: 16px;
  padding: 16px 18px;
  background: #fff;
}
.v2-confirm-conn { display: flex; align-items: center; gap: 12px; }
.v2-confirm-conn__logo {
  width: 36px; height: 36px; object-fit: contain;
  border-radius: 8px; border: 1px solid #e1e6eb;
  padding: 4px; background: #fff; flex-shrink: 0;
}
.v2-confirm-conn__name { font-weight: 600; font-size: 1rem; }
.v2-confirm-conn__type { color: #64748b; font-size: .875rem; }

@media (max-width: 600px) {
  .v2-flow-pipeline { flex-direction: column; }
  .v2-flow-node {
    border-bottom: 1.5px solid #e1e6eb;
    min-width: unset;
    padding: 16px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
  }
  .v2-flow-node--dest { border-bottom: none; }
  .v2-flow-agents-node {
    border-left: none; border-right: none;
    border-top: 1.5px solid #e1e6eb;
    border-bottom: 1.5px solid #e1e6eb;
  }
}

/* -- Confirm step: Paired flow rows --------------------------------- */

.v2-flow-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.v2-flow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 12px;
  padding: 11px 16px;
  flex-wrap: wrap;
}

.v2-flow-row__node {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.v2-flow-row__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e1e6eb;
  padding: 3px;
  background: #f8fafc;
  flex-shrink: 0;
}

.v2-flow-row__logo-ph {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f0f4f8;
  border: 1px dashed #cbd5e1;
  flex-shrink: 0;
}

.v2-flow-row__node-name {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-flow-row__arrow {
  color: #94a3b8;
  font-size: .82rem;
  flex-shrink: 0;
  line-height: 1;
}

.v2-flow-row__agent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e9edf2;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 500;
  color: #374151;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .v2-flow-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -- Agents step: gear button --------------------------------------- */

.v2-agent__gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #e1e6eb;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .8rem;
  transition: border-color .15s, color .15s, background .15s;
}

.v2-agent__gear:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff 94%);
}

/* -- Confirm step: animated in-pipeline flow rows ------------------- */

@keyframes v2-row-enter {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Override middle column for flow-row mode */
.v2-flow-agents-node--rows {
  padding: 0;
  gap: 0;
}

.v2-confirm-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 16px;
  border-bottom: 1px solid #edf1f5;
  animation: v2-row-enter 0.3s ease both;
  animation-delay: calc(var(--i, 0) * 0.07s);
  min-width: 0;
}

.v2-confirm-row:last-child { border-bottom: none; }

.v2-confirm-row--rl {
  background: color-mix(in srgb, var(--brand-primary) 2%, #f8fafc 98%);
}

.v2-confirm-row__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e1e6eb;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .77rem;
  font-weight: 500;
  color: #374151;
  flex-shrink: 0;
  white-space: nowrap;
  z-index: 1;
}

/* Stretching animated connector line between pills */
.v2-confirm-row__line {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 16px;
  gap: 2px;
}

.v2-confirm-row__line-track {
  flex: 1;
  height: 1.5px;
  background-image: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--brand-primary) 55%, transparent) 0,
    color-mix(in srgb, var(--brand-primary) 55%, transparent) 5px,
    transparent 5px,
    transparent 10px
  );
  background-size: 10px 1.5px;
  animation: v2-dash-march 0.5s linear infinite;
}

.v2-confirm-row__line-track--rl {
  animation-name: v2-dash-march-rl;
}

@keyframes v2-dash-march {
  to { background-position: 10px 0; }
}

@keyframes v2-dash-march-rl {
  to { background-position: -10px 0; }
}

.v2-confirm-row__arrow { flex-shrink: 0; }

@media (max-width: 640px) {
  .v2-confirm-row { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .v2-confirm-row__line { display: none; }
  .v2-confirm-row__pill { flex-shrink: 1; }
}

/* -- Authenticate step: logo-in-header redesign --------------------- */

.v2-auth-side__label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff 94%);
  border-bottom: 1.5px solid color-mix(in srgb, var(--brand-primary) 18%, #e1e6eb 82%);
}

.v2-auth-label__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--brand-primary) 18%, #e1e6eb 82%);
  padding: 8px;
  background: #fff;
  flex-shrink: 0;
}

.v2-auth-label__logo-ph {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  background: rgba(255,255,255,.6);
  flex-shrink: 0;
}

.v2-auth-label__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.v2-auth-label__name {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  color: #0d1117;
}

.v2-auth-label__step {
  display: block;
  font-size: .69rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-primary);
}

/* Simplify old label span (fallback if old template in cache) */
.v2-auth-side__label > span {
  font-weight: 700;
  font-size: .9rem;
  color: #0d1117;
}

.v2-auth-card {
  padding: 24px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

.v2-auth-card__prompt {
  margin: 0;
  font-size: .88rem;
  color: #4b5563;
}

.v2-auth-connected {
  padding: 22px;
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff 95%);
}

.v2-auth-connected__check { flex-shrink: 0; margin-top: 2px; }

.v2-auth-connected__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v2-auth-connected__title {
  font-weight: 700;
  font-size: .95rem;
  color: #0d1117;
}

.v2-auth-connected__sub {
  font-size: .82rem;
  color: #64748b;
}

.v2-auth-connected__change {
  padding: 0;
  font-size: .82rem;
  margin-top: 4px;
}

/* -- Agents: universal start date ----------------------------------- */

.wiz-agents-startdate {
  background: #fff;
  border: 1.5px solid #e1e6eb;
  border-radius: 14px;
  padding: 11px 18px;
  margin-bottom: 14px;
}

.wiz-agents-startdate__form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wiz-agents-startdate__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  margin: 0;
  cursor: default;
}

.wiz-agents-startdate__input {
  width: auto;
  min-width: 140px;
}

.wiz-agents-startdate__hint {
  font-size: .78rem;
  color: #64748b;
}

/* -- Agents: config modal checkboxes -------------------------------- */

.v2-agent-cfg__checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
