.control-loop-widget {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.clw-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.clw-target-panel label {
    display: block;
    color: #334155;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.clw-number-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clw-number-input-row input {
    width: 100px;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    font-weight: 700;
}

.clw-number-input-row span {
    font-weight: 800;
    color: #475569;
}

.clw-small-text {
    margin: 0.45rem 0 0;
    color: #64748b;
    font-size: 0.92rem;
}

.clw-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin: 1rem 0;
}

.clw-node {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.clw-node.active {
    transform: translateY(-3px);
    border-color: #5b5fa8;
    box-shadow: 0 14px 30px rgba(91, 95, 168, 0.16);
}

.clw-node span {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.clw-node strong {
    display: block;
    margin: 0.35rem 0;
    color: #0f172a;
    font-size: 1.2rem;
}

.clw-node small {
    color: #64748b;
    line-height: 1.35;
}

.clw-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5b5fa8;
    font-weight: 900;
    white-space: nowrap;
}

.clw-meter-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 1rem;
    margin-top: 1rem;
}

.clw-meter-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    color: #334155;
    font-weight: 800;
}

.clw-meter-track {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.clw-meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #93c5fd, #5b5fa8, #e6004f);
    transition: width 0.35s ease;
}

.clw-meter-target {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 34px;
    border-radius: 999px;
    background: #0f172a;
    z-index: 2;
    transition: left 0.35s ease;
}

#clwStatusText {
    margin: 0.75rem 0 0;
    color: #334155;
    font-weight: 650;
    line-height: 1.55;
}

.clw-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.clw-controls button {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    background: #0f172a;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clw-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

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

    .clw-arrow {
        transform: rotate(90deg);
        padding: 0.2rem 0;
    }
}
