.boolean-expression-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(91, 95, 168, 0.12), transparent 34%),
        #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.be-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.be-panel,
.be-expression-card,
.be-result-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.be-panel h3 {
    margin-top: 0;
    color: #34387f;
}

.be-panel label {
    display: block;
    margin: 0.8rem 0 0.35rem;
    font-weight: 700;
    color: #334155;
}

.be-panel input[type="range"] {
    width: 100%;
}

.be-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) 82px 96px;
    gap: 0.6rem;
    align-items: center;
    margin: 0.8rem 0;
}

.be-row span {
    font-weight: 800;
    color: #334155;
}

.be-row select,
.be-row input,
.be-operator-row select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.55rem 0.65rem;
    font: inherit;
    background: #f8fafc;
    color: #0f172a;
}

.be-expression-card {
    margin: 1rem 0;
}

.be-operator-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: #334155;
}

.be-operator-row select {
    width: auto;
    min-width: 96px;
}

.be-not-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.be-expression {
    margin: 1rem 0 0;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(91, 95, 168, 0.10);
    border: 1px solid rgba(91, 95, 168, 0.22);
    color: #34387f;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 1.05rem;
    font-weight: 800;
    overflow-x: auto;
}

.be-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.be-result-card {
    display: grid;
    gap: 0.35rem;
    border-left: 6px solid #94a3b8;
}

.be-result-card span {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.be-result-card strong {
    font-size: 1.55rem;
    color: #0f172a;
}

.be-result-card small {
    color: #475569;
    font-weight: 700;
}

.be-result-card.is-true {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.be-result-card.is-false {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.be-result-card.is-true strong {
    color: #166534;
}

.be-result-card.is-false strong {
    color: #991b1b;
}

.be-final {
    border-width: 8px;
}

@media (max-width: 640px) {
    .be-row {
        grid-template-columns: 1fr;
    }
}
