/* =========================================================
   NEXENG | Grease Duct Sizer + Materials
   Archivo específico de la app
   Depende de: /assets/css/nexeng-app-base.css
   ========================================================= */

.nx-helper-note {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.86);
    color: var(--nx-soft, #3f5871);
    font-size: 0.92rem;
    line-height: 1.6;
}

.nx-field-note {
    display: block;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.76rem;
    line-height: 1.45;
}

.nx-hidden {
    display: none !important;
}

/* Advanced box */

.nx-advanced-box {
    margin: 2px 0 18px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.86);
    overflow: hidden;
}

.nx-advanced-box summary {
    list-style: none;
    padding: 14px 16px;
    color: var(--nx-soft, #3f5871);
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
}

.nx-advanced-box summary::-webkit-details-marker {
    display: none;
}

.nx-advanced-box summary::after {
    content: "+";
    float: right;
    color: var(--nx-accent, #0284c7);
    font-weight: 950;
}

.nx-advanced-box[open] summary::after {
    content: "−";
}

.nx-advanced-grid {
    padding: 0 16px 16px;
    margin-bottom: 0;
}

/* Materiales preliminares */

.nx-material-list {
    display: grid;
    gap: 12px;
}

.nx-material-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid rgba(15, 87, 130, 0.11);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.06), transparent 42%),
        rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(15, 35, 60, 0.04);
}

.nx-material-item strong {
    display: block;
    color: var(--nx-text, #0f2137);
    font-size: 0.96rem;
    letter-spacing: -0.025em;
}

.nx-material-item small {
    display: block;
    margin-top: 5px;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nx-material-qty {
    min-width: 96px;
    text-align: right;
    color: var(--nx-accent, #0284c7);
    font-size: 0.98rem;
    font-weight: 950;
    white-space: nowrap;
}

/* Advertencias técnicas */

.nx-warning-box {
    margin-top: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(217, 119, 6, 0.22);
    border-radius: 18px;
    background: rgba(217, 119, 6, 0.08);
    color: #92400e;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Estados */

.nx-risk-low {
    color: var(--nx-success, #059669) !important;
    background: rgba(5, 150, 105, 0.08) !important;
    border-color: rgba(5, 150, 105, 0.22) !important;
}

.nx-risk-medium {
    color: var(--nx-warning, #d97706) !important;
    background: rgba(217, 119, 6, 0.08) !important;
    border-color: rgba(217, 119, 6, 0.24) !important;
}

.nx-risk-high {
    color: var(--nx-danger, #dc2626) !important;
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.24) !important;
}

/* Historial */

.nx-calc-card {
    overflow: hidden;
}

.nx-calc-recs p {
    margin: 0;
}

.nx-mini-btn.danger:hover {
    border-color: rgba(220, 38, 38, 0.22);
    color: var(--nx-danger, #dc2626);
    background: rgba(220, 38, 38, 0.06);
}

/* PWA fallback */

.nx-pwa-help {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 35, 60, 0.34);
    backdrop-filter: blur(12px);
}

.nx-pwa-help-card {
    position: relative;
    width: min(100%, 520px);
    padding: 24px;
    border: 1px solid rgba(2, 132, 199, 0.22);
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.12), transparent 40%),
        rgba(255, 255, 255, 0.96);
    box-shadow: var(--nx-shadow, 0 24px 70px rgba(15, 35, 60, 0.10));
}

.nx-pwa-help-card strong {
    display: block;
    margin-bottom: 10px;
    color: var(--nx-accent, #0284c7);
    font-size: 1.05rem;
}

.nx-pwa-help-card p {
    margin: 0;
    color: var(--nx-soft, #3f5871);
    line-height: 1.7;
}

.nx-pwa-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(15, 87, 130, 0.16);
    border-radius: 999px;
    background: #ffffff;
    color: var(--nx-text, #0f2137);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 820px) {
    .nx-material-item {
        grid-template-columns: 1fr;
    }

    .nx-material-qty {
        text-align: left;
    }
}