/* Client service request — read-only workflow path highlight */

/* ── Modal shell ── */
.client-svc-dialog--workflow-path .client-wf-path-modal__panel {
    display: flex;
    flex-direction: column;
    width: min(480px, calc(100vw - 32px));
    max-width: min(480px, calc(100vw - 32px));
    max-height: min(88vh, 680px);
    overflow: hidden;
    padding: 20px 20px 0;
    text-align: start;
    border-radius: 16px;
}

.client-svc-dialog--workflow-path .client-svc-dialog__close {
    top: 16px;
    inset-inline-end: 16px;
    background: #f3f1f7;
}

.client-svc-dialog--workflow-path .client-svc-dialog__title,
.client-svc-dialog--workflow-path h2.client-svc-dialog__title {
    padding-inline: 32px 40px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 1.125rem !important;
}

.client-wf-path-modal__subtitle {
    margin: 0 0 12px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.45;
}

.client-wf-path-modal__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
}

.client-wf-path-modal__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(106, 93, 139, 0.45) #ece8f2;
}

.client-wf-path-modal__scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.client-wf-path-modal__scroll::-webkit-scrollbar-track {
    background: #ece8f2;
    border-radius: 999px;
}

.client-wf-path-modal__scroll::-webkit-scrollbar-thumb {
    background: rgba(106, 93, 139, 0.45);
    border-radius: 999px;
    border: 2px solid #ece8f2;
}

.client-wf-path-modal__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(106, 93, 139, 0.65);
}

.client-wf-path-modal__footer {
    flex-shrink: 0;
    margin-top: 12px;
    padding: 14px 0 18px;
    border-top: 1px solid #ebe9f0;
    background: #fff;
    gap: 10px;
    flex-wrap: nowrap;
}

.client-wf-path-modal__footer .client-svc-dialog__btn {
    min-height: 42px;
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 14px;
    white-space: nowrap;
    font-size: 0.875rem;
    line-height: 1.2;
}

.client-wf-path-modal__footer .client-svc-dialog__btn.is-loading {
    opacity: 0.88;
    pointer-events: none;
    position: relative;
}

.client-wf-path-modal__footer .client-svc-dialog__btn.is-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-inline-start: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: client-wf-btn-spin 0.7s linear infinite;
}

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

/* ── Flow tokens ── */
.client-wf-path-root {
    --client-wf-primary: #6a5d8b;
    --client-wf-primary-light: #887da2;
    --client-wf-success: #49a078;
    --client-wf-ink: #1f2937;
    --client-wf-muted: #6b7280;
    --client-wf-border: #e5e7eb;
    --client-wf-highlight: #6a5d8b;
    --client-wf-highlight-soft: rgba(106, 93, 139, 0.14);
    --client-wf-canvas-bg: #f7f6fa;
}

.client-wf-path-modal__canvas {
    overflow: visible;
    max-height: none;
    padding: 12px 8px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ebebeb;
    box-shadow: none;
}

.client-wf-path-root .client-wf-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: min(640px, 100%);
    margin: 0 auto;
    padding-bottom: 8px;
}

.client-wf-path-root .client-wf-anchor {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: center;
    max-width: min(440px, 100%);
    opacity: 0.55;
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}

.client-wf-path-root .client-wf-anchor.start {
    background: linear-gradient(135deg, var(--client-wf-success), #3d9970);
}

.client-wf-path-root .client-wf-anchor.end {
    background: linear-gradient(135deg, #372a58, #5b4a8a);
}

.client-wf-path-root .client-wf-anchor.is-active {
    opacity: 1;
    box-shadow: 0 8px 20px rgba(106, 93, 139, 0.22);
}

.client-wf-path-root .client-wf-conn {
    width: 3px;
    height: 32px;
    background: #d8d2e6;
    position: relative;
    transition: background 0.2s;
}

.client-wf-path-root .client-wf-conn.is-active {
    background: var(--client-wf-highlight);
    box-shadow: 0 0 0 1px var(--client-wf-highlight-soft);
}

.client-wf-path-root .client-wf-conn.with-arrow::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #d8d2e6;
}

.client-wf-path-root .client-wf-conn.is-active.with-arrow::after {
    border-top-color: var(--client-wf-highlight);
}

/* ── Step cards ── */
.client-wf-path-root .client-wf-step {
    background: #fff;
    border: 2px solid var(--client-wf-border);
    border-radius: 14px;
    padding: 14px 16px;
    width: min(340px, 100%);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(55, 42, 88, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.client-wf-path-root .client-wf-step.is-active {
    border-color: var(--client-wf-highlight);
    box-shadow: 0 0 0 3px var(--client-wf-highlight-soft), 0 8px 20px rgba(106, 93, 139, 0.12);
}

.client-wf-path-root .client-wf-step.is-current {
    border-color: #49a078;
    box-shadow: 0 0 0 3px rgba(73, 160, 120, 0.16), 0 8px 20px rgba(73, 160, 120, 0.14);
    transform: scale(1.02);
}

.client-wf-path-root .client-wf-step.is-muted {
    border-color: #ebe9f0;
    background: #fafafa;
    box-shadow: none;
}

.client-wf-path-root .client-wf-step.is-muted .ic,
.client-wf-path-root .client-wf-step.is-muted .client-wf-step__title,
.client-wf-path-root .client-wf-step.is-muted .client-wf-step__meta {
    opacity: 0.55;
}

.client-wf-path-root .client-wf-step .ic {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.client-wf-path-root .client-wf-step__body {
    min-width: 0;
}

.client-wf-path-root .client-wf-step__title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--client-wf-ink);
}

.client-wf-path-root .client-wf-step__title .client-wf-step__tag {
    font-size: 0.6875rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: lowercase;
    background: #ede9f5;
    color: #4c3d72;
    letter-spacing: 0.02em;
}

.client-wf-path-root .client-wf-step__meta {
    font-size: 0.8125rem;
    color: var(--client-wf-muted);
    margin-top: 5px;
    line-height: 1.45;
    word-break: break-word;
}

.client-wf-path-root .client-wf-step .ic-form { background: #dbeafe; color: #1e40af; }
.client-wf-path-root .client-wf-step .ic-payment { background: #d1fae5; color: #047857; }
.client-wf-path-root .client-wf-step .ic-matching { background: #ccfbf1; color: #0f766e; }
.client-wf-path-root .client-wf-step .ic-offer { background: #fef3c7; color: #92400e; }
.client-wf-path-root .client-wf-step .ic-meeting { background: #fce7f3; color: #9f1239; }
.client-wf-path-root .client-wf-step .ic-contract { background: #ddd6fe; color: #5b21b6; }
.client-wf-path-root .client-wf-step .ic-audit { background: #ffe4e6; color: #be123c; }
.client-wf-path-root .client-wf-step .ic-external { background: #cffafe; color: #155e75; }
.client-wf-path-root .client-wf-step .ic-approval { background: #e0e7ff; color: #4338ca; }
.client-wf-path-root .client-wf-step .ic-notify { background: #fed7aa; color: #9a3412; }
.client-wf-path-root .client-wf-step .ic-condition { background: #fef3c7; color: #92400e; }
.client-wf-path-root .client-wf-step .ic-parallel { background: #cffafe; color: #155e75; }
.client-wf-path-root .client-wf-step .ic-end { background: #fae8ff; color: #86198f; }

/* ── Milestone stepper (client-facing, no branches) ── */
.client-wf-path-root {
    --client-wf-stepper-active: #42a5f5;
    --client-wf-stepper-active-dark: #1e88e5;
    --client-wf-stepper-current: #49a078;
    --client-wf-stepper-current-dark: #2e7d57;
    --client-wf-stepper-track: #e0e0e0;
}

.client-wf-path-root .client-wf-flow--milestones {
    min-width: 0;
    width: 100%;
    align-items: stretch;
    padding: 4px 0;
}

.client-wf-path-root .client-wf-stepper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 0;
}

.client-wf-path-root .client-wf-stepper__item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 18px;
    min-height: 56px;
}

.client-wf-path-root .client-wf-stepper__track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
}

.client-wf-path-root .client-wf-stepper__badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1;
    color: #fff;
    background: var(--client-wf-stepper-track);
    flex-shrink: 0;
    transition: background 0.2s;
}

.client-wf-path-root .client-wf-stepper__line {
    width: 2px;
    flex: 1 1 auto;
    min-height: 28px;
    margin: 6px 0 2px;
    background: var(--client-wf-stepper-track);
    border-radius: 1px;
    transition: background 0.2s;
}

.client-wf-path-root .client-wf-stepper__content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 0 20px;
}

.client-wf-path-root .client-wf-stepper__item:last-child .client-wf-stepper__content {
    padding-bottom: 6px;
}

.client-wf-path-root .client-wf-stepper__title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    color: #212121;
    transition: color 0.2s;
}

.client-wf-path-root .client-wf-stepper__meta {
    font-size: 0.8125rem;
    color: #757575;
    margin-top: 4px;
    line-height: 1.45;
    word-break: break-word;
}

.client-wf-path-root .client-wf-stepper__phase {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 14px 0 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f3ff 0%, #faf8ff 100%);
    border: 1px solid #ddd6fe;
}

.client-wf-path-root .client-wf-stepper__phase-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    border-radius: 10px;
    background: #ede9fe;
}

.client-wf-path-root .client-wf-stepper__phase-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #5b21b6;
    line-height: 1.35;
}

.client-wf-path-root .client-wf-stepper__phase-desc {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.45;
}

.client-wf-path-root .client-wf-stepper__item.is-active:not(.is-current) .client-wf-stepper__badge {
    background: var(--client-wf-stepper-active);
}

.client-wf-path-root .client-wf-stepper__item.is-active:not(.is-current) .client-wf-stepper__line {
    background: var(--client-wf-stepper-active);
}

.client-wf-path-root .client-wf-stepper__item.is-current .client-wf-stepper__badge {
    background: var(--client-wf-stepper-current);
}

.client-wf-path-root .client-wf-stepper__item.is-current .client-wf-stepper__title {
    color: var(--client-wf-stepper-current-dark);
    font-weight: 600;
}

.client-wf-path-root .client-wf-stepper__item.is-muted .client-wf-stepper__badge {
    background: var(--client-wf-stepper-track);
    color: #fff;
}

.client-wf-path-root .client-wf-stepper__item.is-muted .client-wf-stepper__title {
    color: #757575;
}

/* Start / end anchors */
.client-wf-path-root .client-wf-stepper__item--anchor .client-wf-stepper__badge--anchor {
    font-size: 0;
}

.client-wf-path-root .client-wf-stepper__badge--start::before {
    content: "▶";
    font-size: 0.8125rem;
    line-height: 1;
    color: #fff;
}

.client-wf-path-root .client-wf-stepper__badge--end::before {
    content: "✓";
    font-size: 0.9375rem;
    line-height: 1;
    font-weight: 700;
    color: #fff;
}

.client-wf-path-root .client-wf-stepper__item--start .client-wf-stepper__badge {
    background: var(--client-wf-stepper-current);
}

.client-wf-path-root .client-wf-stepper__item--start.is-active .client-wf-stepper__line {
    background: var(--client-wf-stepper-active);
}

.client-wf-path-root .client-wf-stepper__item--start .client-wf-stepper__title {
    font-weight: 600;
    color: var(--client-wf-stepper-current-dark);
}

.client-wf-path-root .client-wf-stepper__item--end.is-active .client-wf-stepper__badge {
    background: linear-gradient(135deg, #372a58, #5b4a8a);
}

.client-wf-path-root .client-wf-stepper__item--end.is-active .client-wf-stepper__title {
    font-weight: 600;
    color: #5b4a8a;
}

.client-wf-path-root .client-wf-stepper__item--end.is-muted .client-wf-stepper__badge {
    background: var(--client-wf-stepper-track);
}

.client-wf-path-root .client-wf-stepper__item--anchor .client-wf-stepper__content {
    padding-bottom: 20px;
}

.client-wf-path-root .client-wf-stepper__item--end .client-wf-stepper__content {
    padding-bottom: 6px;
}

/* ── Condition branches ── */
.client-wf-path-root .client-wf-branches {
    width: 100%;
    max-width: 820px;
    padding: 14px 0 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
}

.client-wf-path-root .client-wf-branches::before {
    content: "";
    position: absolute;
    top: 0;
    right: 25%;
    left: 25%;
    height: 3px;
    background: #d8d2e6;
    border-radius: 2px;
}

.client-wf-path-root .client-wf-branch-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 14px;
    padding: 14px 10px 12px;
    position: relative;
    transition: opacity 0.2s, border-color 0.2s, background 0.2s;
    min-width: 0;
}

.client-wf-path-root .client-wf-branch-col.is-active.true,
.client-wf-path-root .client-wf-branch-col.is-active.false {
    background: rgba(106, 93, 139, 0.06);
    border: 2px solid rgba(106, 93, 139, 0.28);
    opacity: 1;
}

.client-wf-path-root .client-wf-branch-col.is-muted {
    opacity: 0.38;
}

.client-wf-path-root .client-wf-branch-col::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 10px;
    background: #d8d2e6;
}

.client-wf-path-root .client-wf-branch-col.is-active::before {
    background: var(--client-wf-highlight);
}

.client-wf-path-root .client-wf-branch-label {
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}

.client-wf-path-root .client-wf-branch-label.true { background: var(--client-wf-success); color: #fff; }
.client-wf-path-root .client-wf-branch-label.false { background: #6b7280; color: #fff; }

.client-wf-path-root .client-wf-branches-merge {
    width: 100%;
    max-width: 820px;
    height: 28px;
    position: relative;
    margin-top: 8px;
}

.client-wf-path-root .client-wf-branches-merge::before,
.client-wf-path-root .client-wf-branches-merge::after {
    content: "";
    position: absolute;
    background: #d8d2e6;
}

.client-wf-path-root .client-wf-branches-merge.is-active::before,
.client-wf-path-root .client-wf-branches-merge.is-active::after {
    background: var(--client-wf-highlight);
}

.client-wf-path-root .client-wf-branches-merge::before {
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    border-radius: 2px;
}

.client-wf-path-root .client-wf-branches-merge::after {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 20px;
}

/* ── Parallel paths ── */
.client-wf-path-root .client-wf-parallel-wrap {
    width: 100%;
    max-width: 1000px;
    padding: 16px;
    background: rgba(106, 93, 139, 0.04);
    border-radius: 14px;
    border: 1px dashed rgba(106, 93, 139, 0.22);
}

.client-wf-path-root .client-wf-parallel-header {
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4c3d72;
    margin-bottom: 14px;
}

.client-wf-path-root .client-wf-parallel-tracks {
    display: grid;
    gap: 16px;
}

.client-wf-path-root .client-wf-parallel-track {
    border-radius: 12px;
    padding: 12px;
    border: 1px dashed #d8d2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.client-wf-path-root .client-wf-parallel-track.is-active {
    border-color: rgba(106, 93, 139, 0.35);
    background: rgba(106, 93, 139, 0.04);
}

.client-wf-path-root .client-wf-parallel-track.is-muted {
    opacity: 0.38;
}

.client-wf-path-root .client-wf-parallel-track-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4c3d72;
    margin-bottom: 10px;
}

.client-wf-path-root .client-wf-empty {
    text-align: center;
    color: var(--client-wf-muted);
    padding: 40px 20px;
    font-size: 0.9375rem;
}

/* ── Legend ── */
.client-wf-path-modal__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin: 0;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: #4b5563;
    background: #f9f8fc;
    border: 1px solid #ebe9f0;
    border-radius: 10px;
}

.client-wf-path-modal__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.client-wf-path-modal__legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: #42a5f5;
    flex-shrink: 0;
}

.client-wf-path-modal__legend-swatch.is-current {
    background: #49a078;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .client-svc-dialog--workflow-path .client-wf-path-modal__panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 24px);
        padding: 22px 16px 0;
        border-radius: 16px;
    }

    .client-svc-dialog--workflow-path .client-svc-dialog__title,
    .client-svc-dialog--workflow-path h2.client-svc-dialog__title {
        font-size: 1.125rem !important;
        padding-inline: 32px;
    }

    .client-wf-path-modal__canvas {
        padding: 20px 12px 24px;
    }

    .client-wf-path-root .client-wf-flow {
        min-width: 0;
        width: 100%;
    }

    .client-wf-path-root .client-wf-branches {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .client-wf-path-root .client-wf-branches::before {
        display: none;
    }

    .client-wf-path-modal__footer {
        padding-bottom: 18px;
    }

    .client-wf-path-modal__footer {
        flex-wrap: wrap;
    }

    .client-wf-path-modal__footer .client-svc-dialog__btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 9.5rem;
    }
}
