.er-widget {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.er-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.er-tab {
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.er-tab.active,
.er-tab:hover {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.er-stage {
    display: grid;
    grid-template-columns: 1.6fr 0.8fr;
    gap: 1rem;
    align-items: stretch;
}

.er-diagram {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    min-height: 220px;
    padding: 1rem;
    border-radius: 22px;
    background: white;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.er-node {
    position: relative;
    z-index: 2;
    justify-self: center;
    width: 120px;
    padding: 1rem 0.6rem;
    text-align: center;
    border-radius: 18px;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #1e3a8a;
    font-weight: 850;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}

.er-line {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #cbd5e1;
    transform: translateY(-50%);
    transition: all 0.25s ease;
}

.er-line span {
    position: absolute;
    left: 50%;
    top: -2rem;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
}

.member-band { left: 18%; width: 22%; }
.band-booking { left: 39%; width: 23%; }
.booking-venue { left: 61%; width: 22%; }

.er-line.active-line {
    background: #e6004f;
    height: 6px;
}

.er-line.active-line span {
    color: #e6004f;
    border-color: rgba(230, 0, 79, 0.25);
}

.er-side-panel {
    padding: 1rem;
    border-radius: 22px;
    background: white;
    border: 1px solid #e2e8f0;
}

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

.er-side-panel select {
    width: 100%;
    padding: 0.65rem;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

.er-cardinality-card {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
}

.er-card-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.er-cardinality-card strong {
    display: block;
    font-size: 2.1rem;
    line-height: 1;
    margin: 0.4rem 0;
}

.er-explanation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 22px;
    background: white;
    border: 1px solid #e2e8f0;
}

.er-step-counter {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
}

.er-explanation h3 {
    margin-top: 0.25rem;
}

.er-read-box {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(91, 95, 168, 0.10);
    border: 1px solid rgba(91, 95, 168, 0.24);
    color: #4b4f9c;
    font-weight: 800;
}

@media (max-width: 820px) {
    .er-stage { grid-template-columns: 1fr; }
    .er-diagram { grid-template-columns: 1fr; gap: 2.2rem; }
    .er-line { display: none; }
}
