.node-wizard-stage {
    --node-brand-blue: #1E499B;
    --node-brand-orange: #FF6600;
    background: #f8fafc;
    padding-top: 0;
}

.node-wizard-header {
    margin-bottom: 1rem;
}

.node-wizard-stage .text-3xl {
    font-size: 1.55rem;
    line-height: 1.95rem;
}

.node-wizard-stage .text-2xl {
    font-size: 1.2rem;
    line-height: 1.65rem;
}

.node-wizard-stage .text-lg {
    font-size: 0.94rem;
    line-height: 1.35rem;
}

.node-wizard-stage .text-base {
    font-size: 0.88rem;
    line-height: 1.3rem;
}

.node-wizard-stage .text-sm {
    font-size: 0.76rem;
}

.node-wizard-stage .text-xs {
    font-size: 0.67rem;
}

.node-wizard-stage [data-step-section] h2 {
    font-size: 1.2rem;
    line-height: 1.65rem;
}

.node-wizard-stage [data-step-section] h3 {
    font-size: 0.94rem;
    line-height: 1.3rem;
}

.node-wizard-stage [data-step-section] p {
    font-size: 0.78rem;
}

.node-wizard-stage input,
.node-wizard-stage select,
.node-wizard-stage textarea,
.node-wizard-stage button {
    font-size: 0.84rem;
}

.node-wizard-panel {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.node-stepper {
    --node-step-circle-size: 44px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.node-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94a3b8;
    flex: 1;
    position: relative;
}

.node-stepper > .node-step + .node-step-connector {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    display: block;
    align-self: flex-start !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
    margin-top: calc((var(--node-step-circle-size) / 2) - 1px) !important;
}

.node-step-circle {
    width: var(--node-step-circle-size);
    height: var(--node-step-circle-size);
    border-radius: 999px;
    border: 2px solid #d9e2ef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    background: white;
    color: #1e3a8a;
}

.node-step.active .node-step-circle,
.node-step.completed .node-step-circle {
    border-color: #1e3a8a;
    background: #1e3a8a;
    color: white;
}

.node-step-check {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    display: none;
}

.node-step.completed .node-step-check {
    display: inline-flex;
}

.node-step.completed .node-step-number {
    display: none;
}

.node-domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 1rem;
    min-width: 0;
}

.node-domain-grid > * {
    min-width: 0;
}

.node-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    min-width: 0;
}

.node-source-grid > * {
    min-width: 0;
}

.node-card {
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    background: white;
    text-align: left;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    cursor: pointer;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.node-card h3,
.node-card p,
.node-deploy-source-card,
.node-deploy-source-card p,
.node-log-summary-card p,
.node-log-artifact-card,
.node-log-artifact-card p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.node-card.active {
    border-color: var(--node-brand-blue);
    box-shadow: 0 18px 40px rgba(30, 73, 155, 0.2);
    background: linear-gradient(180deg, rgba(30, 73, 155, 0.12), white);
    transform: translateY(-2px);
}

.node-card-check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid #1e3a8a;
    display: none;
    align-items: center;
    justify-content: center;
    background: white;
    color: #1e3a8a;
}

.node-card.active .node-card-check {
    display: inline-flex;
}

.node-source-info {
    margin-top: 1.5rem;
    border-radius: 20px;
    padding: 1rem 1.25rem;
    background: #e2ecff;
    border: 1px solid #cbd9ff;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #1e3a8a;
}

.node-source-info i[data-lucide] {
    color: #1e3a8a;
    width: 1.25rem;
    height: 1.25rem;
}

.node-card:hover {
    border-color: var(--node-brand-orange);
    box-shadow: 0 12px 28px rgba(255, 102, 0, 0.18);
    transform: translateY(-1px);
}

.node-card .node-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eef2ff;
    display: grid;
    place-items: center;
    margin-bottom: 0.75rem;
    color: var(--node-brand-blue);
}

.node-domain-grid [data-domain-choice] .node-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 16px;
}

.node-domain-grid [data-domain-choice] .node-icon svg,
.node-domain-grid [data-domain-choice] .node-icon .node-domain-choice-icon {
    width: 28px !important;
    height: 28px !important;
}

.node-source-grid [data-source-choice] .node-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 16px;
}

.node-source-grid [data-source-choice] .node-icon svg {
    width: 28px !important;
    height: 28px !important;
}

.node-card span.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #475569;
}

.node-card button {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.node-domain-panel,
.node-source-section {
    margin-top: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    background: #f8fafc;
}

.node-domain-panel.hidden,
.node-source-section.hidden {
    display: none;
}

.node-domain-existing-layout {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.node-domain-existing-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.node-domain-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #dbe4f0;
    background: #ffffff;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

.node-domain-existing-select-wrap {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    width: min(100%, 520px);
}

.node-domain-existing-control {
    position: relative;
    min-width: 0;
}

.node-domain-select-chevron {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.node-domain-select-chevron i[data-lucide] {
    width: 1rem;
    height: 1rem;
}

.node-domain-existing-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.68rem 3rem 0.68rem 0.9rem;
    border: 1px solid #cfd9e6;
    border-radius: 0.75rem;
    background: #ffffff;
    background-image: none;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.node-domain-existing-select::-ms-expand {
    display: none;
}

.node-domain-existing-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.node-domain-search-input {
    padding-left: 3rem !important;
}

.node-domain-search-input::placeholder {
    color: #64748b;
    opacity: 1;
    font-weight: 500;
}

.node-domain-search-icon {
    left: 0.95rem;
    width: 1rem;
    height: 1rem;
}

.node-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.node-modal {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 640px;
    width: 100%;
    max-height: min(90vh, 820px);
    overflow-y: auto;
    box-shadow: 0 32px 60px rgba(15, 23, 42, 0.15);
}

.node-modal h3 {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.node-log-panel {
    border: 1px solid #d8e1ef;
    border-radius: 1rem;
    background: #ffffff;
    overflow: hidden;
}

.node-log-toggle {
    width: 100%;
    border: none;
    background: #f8fafc;
    padding: 1rem 1.2rem;
    text-align: left;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.node-log-list {
    padding: 1rem 1.2rem;
    height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: nowrap;
    font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    background: #081437;
    color: #e2e8f0;
    border-top: 1px solid #d8e1ef;
}

.node-log-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.node-log-list::-webkit-scrollbar-track {
    background: #0f1e48;
}

.node-log-list::-webkit-scrollbar-thumb {
    background: #3f4f78;
    border-radius: 999px;
}

.node-progress {
    background: #e4e8f1;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.node-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--node-brand-blue), #2d63c9);
    transition: width 0.2s ease;
}

.node-deploy-running-title {
    margin-bottom: 1rem;
    font-size: 2.2rem;
    line-height: 1.1;
    color: #1f2a44;
    font-weight: 900;
}

.node-deploy-running-card {
    border: 1px solid #d8e1ef;
    border-radius: 1rem;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(30, 73, 155, 0.08);
    padding: 1.35rem;
}

.node-deploy-running-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.node-deploy-running-percent {
    margin-left: auto;
    color: var(--node-brand-blue);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1;
}

.node-success-card {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    background: #f8fafc;
    min-width: 0;
}

.node-success-card [data-success-url],
[data-temp-app-name] {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.node-deploy-success-wrap {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.1rem;
}

.node-deploy-success-check {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d9f5e3;
    color: #15984a;
    box-shadow: 0 0 0 0 rgba(21, 152, 74, 0.25);
}

.node-deploy-success-check i[data-lucide] {
    width: 50px;
    height: 50px;
}

[data-deploy-success]:not(.hidden) .node-deploy-success-check,
[data-deploy-success].is-animated .node-deploy-success-check {
    animation: node-deploy-success-pop 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards,
        node-deploy-success-pulse 1200ms ease-out 520ms 1;
}

[data-deploy-success]:not(.hidden) .node-deploy-success-check i[data-lucide],
[data-deploy-success].is-animated .node-deploy-success-check i[data-lucide] {
    animation: node-deploy-success-icon 360ms ease-out 140ms forwards;
}

@keyframes node-deploy-success-pop {
    0% {
        transform: scale(0.78);
        opacity: 0;
    }
    65% {
        transform: scale(1.08);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes node-deploy-success-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(21, 152, 74, 0.3);
    }
    100% {
        box-shadow: 0 0 0 22px rgba(21, 152, 74, 0);
    }
}

@keyframes node-deploy-success-icon {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .node-deploy-success-check,
    .node-deploy-success-check i[data-lucide],
    [data-deploy-success].is-animated .node-deploy-success-check,
    [data-deploy-success].is-animated .node-deploy-success-check i[data-lucide] {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        box-shadow: none !important;
    }
}

.node-deploy-success-title {
    margin: 0;
    font-size: 2.4rem;
    line-height: 1.05;
    font-weight: 900;
    color: #1f2a44;
}

.node-deploy-success-subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #607089;
}

.node-deploy-source-card {
    width: min(100%, 660px);
    border: 1px solid #d8e1ef;
    border-radius: 1rem;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(30, 73, 155, 0.08);
    padding: 1.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.node-deploy-source-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    border: 1px solid #d3dce8;
    background: #eef2f7;
    color: #3a4c66;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.node-deploy-source-icon i[data-lucide] {
    width: 24px;
    height: 24px;
}

.node-deploy-source-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: #1f2a44;
}

.node-deploy-source-value {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    color: #55657c;
}

.node-success-log-panel {
    width: min(100%, 660px);
    margin: 0 auto;
    border: 1px solid #d8e1ef;
    border-radius: 1rem;
    overflow: hidden;
    background: #ffffff;
    text-align: left;
}

.node-success-log-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border: none;
    background: #f8fafc;
    color: #3e4f68;
    font-weight: 700;
    text-align: left;
}

.node-success-log-panel .node-log-list--detailed,
.node-success-log-panel .node-log-list--detailed *,
.node-success-log-panel .node-log-detail-head,
.node-success-log-panel .node-log-detail-head *,
.node-success-log-panel .node-log-artifact-card,
.node-success-log-panel .node-log-event {
    text-align: left;
}

.node-success-log-toggle:hover {
    background: #f1f5fb;
}

.node-success-log-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5f7088;
}

.node-success-log-icons i[data-lucide] {
    width: 1.1rem;
    height: 1.1rem;
}

.node-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.node-actions > div {
    margin-left: auto;
}

.node-actions button {
    border-radius: 999px;
    padding: 0.95rem 2.5rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.25);
}

.node-actions button:not(.hidden) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.node-actions button i[data-lucide] {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.node-actions button.secondary {
    background: white;
    border: 1px solid #cbd5f5;
    color: #282c37;
}

.node-actions button.primary {
    background: var(--node-brand-blue);
    color: white;
}


[data-node-wizard] button {
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

[data-node-wizard] button:focus-visible {
    outline: 2px solid rgba(30, 73, 155, 0.35);
    outline-offset: 2px;
}

.node-actions button.primary:hover,
[data-build-save]:hover,
[data-env-save]:hover {
    background: #173b7f;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(30, 73, 155, 0.28);
}

.node-actions button.secondary,
[data-build-modal-close],
[data-build-reset],
[data-env-modal-close],
[data-env-add],
[data-node-build],
[data-node-env] {
    border: 1px solid #d7dfec;
    background: #ffffff;
    color: #334155;
}

.node-actions button.secondary:hover,
[data-build-modal-close]:hover,
[data-build-reset]:hover,
[data-env-modal-close]:hover,
[data-env-add]:hover,
[data-node-build]:hover,
[data-node-env]:hover {
    border-color: var(--node-brand-blue);
    color: var(--node-brand-blue);
    background: #f8fbff;
    transform: translateY(-1px);
}

.node-domain-panel[data-domain-panel="SUBDOMAIN"] button {
    background: var(--node-brand-orange);
    color: #ffffff;
    border: 1px solid transparent;
}

.node-domain-panel[data-domain-panel="SUBDOMAIN"] button:hover {
    background: #e65c00;
    box-shadow: 0 10px 20px rgba(255, 102, 0, 0.25);
}

.node-stepper + .node-wizard-panel > *:first-child {
    margin-top: 0;
}

.node-section {
    display: none;
}

.node-section.active {
    display: block;
}

@media (max-width: 768px) {
    .node-wizard-header {
        margin-bottom: 0.75rem;
    }

    .node-wizard-stage .text-3xl {
        font-size: 1.35rem;
        line-height: 1.7rem;
    }

    .node-stepper {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        max-width: 340px;
        margin-inline: auto;
    }

    .node-step {
        flex: none;
        width: 100%;
        display: grid;
        grid-template-columns: var(--node-step-circle-size) 1fr;
        align-items: center;
        column-gap: 0.75rem;
    }

    .node-stepper > .node-step + .node-step-connector {
        display: block;
        flex: none;
        width: 2px;
        height: 20px;
        min-width: 0;
        margin-top: 0 !important;
        margin-left: calc((var(--node-step-circle-size) / 2) - 1px);
    }

    .node-step-label {
        font-size: 0.68rem;
        letter-spacing: 0.12em;
        text-align: left;
        line-height: 1.2;
    }

    .node-wizard-panel {
        padding: 1.15rem;
        border-radius: 24px;
    }

    .node-domain-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .node-card {
        width: 100%;
    }

    .node-source-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .node-domain-panel[data-domain-panel="SUBDOMAIN"] {
        overflow: hidden;
    }

    .node-domain-panel[data-domain-panel="SUBDOMAIN"] .text-2xl {
        display: none;
    }

    .node-domain-panel[data-domain-panel="SUBDOMAIN"] input,
    .node-domain-panel[data-domain-panel="SUBDOMAIN"] select,
    .node-domain-panel[data-domain-panel="SUBDOMAIN"] button {
        width: 100%;
        min-width: 0;
    }

    .node-success-card .flex.justify-between {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .node-success-card .flex.justify-between > span:last-child {
        width: 100%;
    }

    .node-deploy-success-title {
        font-size: 1.85rem;
    }

    .node-deploy-source-card,
    .node-success-log-panel {
        width: 100%;
    }

    .node-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .node-actions > div {
        margin-left: 0;
        width: 100%;
    }

    .node-actions button {
        width: 100%;
        max-width: 100%;
        padding-inline: 1.25rem;
    }

    .node-modal {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .node-log-toggle,
    .node-success-log-toggle {
        padding: 0.9rem 1rem;
    }

    .node-log-list {
        height: 280px;
        padding: 0.9rem 1rem;
        font-size: 0.72rem;
    }

    .node-deploy-success-wrap {
        gap: 0.9rem;
    }

    .node-success-card {
        padding: 1.1rem;
    }

    .node-deploy-source-card {
        padding: 1rem;
        align-items: flex-start;
    }

    .node-deploy-source-title {
        font-size: 1rem;
    }

    .node-deploy-source-value {
        font-size: 0.85rem;
    }

    .node-domain-existing-head {
        align-items: stretch;
    }

    .node-domain-count {
        width: fit-content;
    }

    .node-domain-existing-select-wrap {
        width: 100%;
    }

    .node-deploy-running-title {
        font-size: 1.8rem;
    }

    .node-deploy-running-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .node-deploy-running-percent {
        margin-left: 0;
        font-size: 1.4rem;
    }

    .node-deploy-running-card {
        padding: 1rem;
    }
}
