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

body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1e4b69;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.container {
    max-width: 1100px;
    width: 100%;
}

h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e4b69;
    margin-bottom: 6px;
}

.subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: #6b7c8a;
    margin-bottom: 36px;
}

/* Workflow row */
.workflow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}

/* Arrow between cards */
.arrow {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    color: #94a3b8;
    padding: 0 6px;
    user-select: none;
    flex-shrink: 0;
}

/* Stage cards */
.stage-card {
    background: #ffffff;
    border-radius: 10px;
    width: 180px;
    min-height: 170px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.stage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.stage-card.active {
    outline: 2.5px solid #1e4b69;
    outline-offset: 2px;
}

.card-header {
    height: 6px;
    width: 100%;
}

.card-body {
    padding: 16px 14px 14px;
}

.stage-number {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: #e8eef3;
    color: #1e4b69;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.card-body h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e4b69;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-body p {
    font-size: 0.78rem;
    color: #5a6f7e;
    line-height: 1.45;
}

/* Feedback loop */
.feedback-loop {
    display: flex;
    justify-content: center;
    margin-top: -2px;
    padding: 0 60px;
}

.feedback-arrow {
    width: 400px;
    height: 60px;
    /* Position it roughly between stage 3 and stage 4 */
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: #1e4b69;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 240px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip.visible {
    opacity: 1;
}

.tooltip strong {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
}

.tooltip span {
    color: #b0d0e8;
}

/* Details panel */
.details-panel {
    margin-top: 28px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
}

.details-panel.open {
    max-height: 300px;
    opacity: 1;
}

.details-content {
    padding: 24px 28px;
}

.details-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e4b69;
}

.details-content .detail-row {
    display: flex;
    gap: 32px;
    margin-bottom: 10px;
    font-size: 0.88rem;
}

.details-content .detail-row .label {
    font-weight: 600;
    color: #1e4b69;
    min-width: 80px;
}

.details-content .detail-row .value {
    color: #5a6f7e;
}

.details-content .detail-description {
    font-size: 0.88rem;
    color: #5a6f7e;
    line-height: 1.6;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #e8eef3;
}

/* Color accent bar in details panel */
.details-content .accent-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 960px) {
    .workflow {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .arrow {
        transform: rotate(90deg);
        padding: 2px 0;
    }

    .stage-card {
        width: 300px;
    }

    .feedback-loop {
        display: none;
    }
}
