.problem-shell {
    max-width: min(100%, var(--layout-max, 96%));
}

.problem-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.75rem;
}

.problem-box pre {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.6rem;
    padding: 0.8rem;
    color: #c9d1d9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-bottom: 0;
}

.topology-wrap {
    background: #0f1724;
    border: 1px solid #30363d;
    border-radius: 0.6rem;
    padding: 0.8rem;
}

.topology-wrap .mermaid {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 0.3rem;
}

.topology-wrap .mermaid svg {
    margin: 0 auto !important;
    display: block;
    max-width: 100%;
    height: auto;
}

.topology-wrap .mermaid svg g.node.topology-node-selected rect,
.topology-wrap .mermaid svg g.node.topology-node-selected polygon,
.topology-wrap .mermaid svg g.node.topology-node-selected path {
    stroke: #f2cc60 !important;
    stroke-width: 0.234% !important;
    filter: drop-shadow(0 0 0.469% rgba(242, 204, 96, 0.45));
}

.topology-wrap .mermaid svg g.node.topology-node-selected .label text,
.topology-wrap .mermaid svg g.node.topology-node-selected span {
    font-weight: 700;
}

.problem-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

/* --- Alinhamento consistente do formulário de cenário (design A&D) --- */
#resolucao-form .row {
    align-items: flex-start !important;
}

#resolucao-form .form-control,
#resolucao-form .form-select {
    height: 44px;
}

#resolucao-form .form-label {
    min-height: 1.25rem;
    margin-bottom: 0.375rem;
    display: block;
}

#resolucao-form .form-text {
    margin-top: 0.375rem;
}

#resolucao-form .location-row .btn-remove-location {
    height: 44px;
    width: 100%;
}

/* rótulo espaçador: mantém o botão "Remover" alinhado com os inputs vizinhos */
#resolucao-form .spacer-label {
    pointer-events: none;
    user-select: none;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    border: 1px solid #30363d;
    padding: 0.25rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    background: #0d1117;
    color: #9ecbff;
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
}

.section-chip .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

.chip-info { color: #79c0ff; border-color: #1f6feb; background: rgba(31, 111, 235, 0.15); }
.chip-success { color: #7ee787; border-color: #238636; background: rgba(46, 160, 67, 0.18); }
.chip-warning { color: #f2cc60; border-color: #d29922; background: rgba(210, 153, 34, 0.15); }
.chip-danger { color: #ffb3ad; border-color: #f85149; background: rgba(248, 81, 73, 0.15); }

.result-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.scenario-network-hero {
    border: 1px solid #30363d;
    border-left: 3px solid #1f6feb;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0f1724 0%, #13233a 100%);
    padding: 0.85rem;
}

.scenario-network-value {
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    font-weight: 800;
    color: #79c0ff;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.scenario-network-meta {
    font-size: 0.82rem;
    color: #8b949e;
}

.topology-card {
    border-left: 3px solid #1f6feb;
    background: #0f1724;
    border-radius: 0.6rem;
    padding: 0.6rem;
}

.cli-box {
    border-left: 3px solid #d29922;
}

.cli-box pre {
    max-height: none;
    overflow: visible;
}

.export-actions {
    row-gap: 0.55rem;
}

.export-actions .btn {
    min-height: 2.5rem;
}

.export-actions .export-status-chip {
    color: #7ee787;
    border-color: #238636;
    background: rgba(46, 160, 67, 0.32);
    padding: 0.45rem 0.75rem;
    min-height: 2.5rem;
    align-items: center;
}

@media (max-width: 62em) {
    .problem-shell {
        max-width: 100%;
    }
    .problem-box {
        padding: 0.85rem !important;
    }
    .problem-title {
        line-height: 1.2;
        flex-wrap: wrap;
    }
}

@media (max-width: 48em) {
    .section-chip {
        margin-right: 0;
    }
    .result-strip {
        gap: 0.35rem;
    }
    .topology-wrap {
        padding: 0.55rem;
    }
    .topology-wrap .mermaid {
        padding: 0.15rem;
    }
}

@media (max-width: 36em) {
    .problem-shell.container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .problem-box {
        border-radius: 0.6rem;
    }
    .problem-title {
        font-size: 0.98rem;
    }
    .problem-box table th,
    .problem-box table td {
        font-size: 0.77rem;
        white-space: nowrap;
    }
    .problem-box pre {
        font-size: 0.73rem;
        line-height: 1.35;
    }
    .problem-box .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .export-actions {
        flex-direction: column;
        align-items: stretch !important;
    }
    .export-actions .btn {
        width: 100%;
    }
    .export-actions .section-chip {
        text-align: center;
        justify-content: center;
    }
    #locations-container .location-row {
        border: 1px solid #30363d;
        border-radius: 0.6rem;
        padding: 0.55rem;
        margin-bottom: 0.55rem !important;
    }
    #locations-container .location-row .col-md-2.d-grid {
        margin-top: 0.2rem;
    }
}
