/* =========================================================
   NEXENG | IAQ Fresh Air Calculator ASHRAE 62.1
   Template NEXENG Table App v2 - v2.0.0
   Depende de: /assets/css/nexeng-app-base.css
   ========================================================= */

:root {
    --iaq-sheet-border: rgba(15, 87, 130, 0.14);
    --iaq-sheet-head: rgba(232, 246, 253, 0.94);
    --iaq-sheet-cell: rgba(255, 255, 255, 0.96);
    --iaq-sheet-cell-alt: rgba(248, 251, 255, 0.92);
    --iaq-sheet-input-bg: rgba(255, 252, 235, 0.96);
    --iaq-sheet-input-alt: rgba(255, 248, 220, 0.86);
    --iaq-sheet-calc-bg: rgba(244, 248, 252, 0.96);
    --iaq-sheet-calc-alt: rgba(236, 244, 250, 0.88);
    --iaq-sheet-sticky: rgba(255, 255, 255, 0.98);
    --iaq-sheet-blue: #0284c7;
    --iaq-sheet-cyan: #06b6d4;
}

.nx-iaq-shell {
    --nx-max: 1880px;
    width: min(100% - 20px, var(--nx-max));
}

.nx-iaq-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 22px;
    align-items: stretch;
    padding: 34px 0 18px;
}

.nx-iaq-hero-main,
.nx-iaq-hero-total {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: var(--nx-radius-lg, 30px);
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.13), transparent 42%),
        radial-gradient(circle at 92% 80%, rgba(6, 182, 212, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.88);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-iaq-hero-main {
    min-height: 220px;
    padding: clamp(26px, 3.2vw, 44px);
}

.nx-iaq-hero-main::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 48%;
    pointer-events: none;
    opacity: 0.44;
    background:
        linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.82) 44%, rgba(255, 255, 255, 0.94) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 320'%3E%3Cg fill='none' stroke='%230284c7' stroke-opacity='.2' stroke-width='2'%3E%3Cpath d='M43 205 C160 115 260 258 404 156 C505 82 562 124 619 87'/%3E%3Cpath d='M22 250 C140 164 251 290 394 205 C481 153 558 175 627 137'/%3E%3Cpath d='M310 82 h196 c37 0 67 30 67 67v70 c0 15-12 27-27 27H350c-37 0-67-30-67-67v-70c0-15 12-27 27-27z'/%3E%3Cpath d='M358 121h142M358 159h142M358 197h142M520 103v112'/%3E%3Ccircle cx='122' cy='177' r='4' fill='%2306b6d4' stroke='none'/%3E%3Ccircle cx='452' cy='96' r='4' fill='%2306b6d4' stroke='none'/%3E%3C/g%3E%3C/svg%3E") center right / contain no-repeat;
}

.nx-iaq-hero-main > * {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.nx-iaq-hero-main h1 {
    margin: 12px 0 12px;
    color: var(--nx-text, #0f2137);
    font-size: clamp(2rem, 4vw, 4.25rem);
    line-height: 0.96;
    letter-spacing: -0.075em;
}

.nx-iaq-hero-main h1 span:last-child {
    display: block;
    color: var(--nx-accent, #0284c7);
}

.nx-iaq-hero-main p {
    margin: 0;
    color: var(--nx-soft, #3f5871);
    max-width: 680px;
    font-size: 1.02rem;
    line-height: 1.65;
}

.nx-iaq-hero-total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px;
}

.nx-iaq-hero-total strong {
    display: block;
    margin: 8px 0 2px;
    color: var(--nx-accent, #0284c7);
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
}

.nx-iaq-hero-total small,
.nx-summary-card small {
    color: var(--nx-muted, #6b7f95);
    font-weight: 750;
}

.nx-iaq-hero-total p {
    margin: 16px 0 0;
    color: var(--nx-soft, #3f5871);
    line-height: 1.55;
}

.nx-iaq-summary-grid {
    margin-top: 0;
}

.nx-iaq-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0;
    padding: 22px;
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-iaq-toolbar h2 {
    margin: 4px 0 4px;
    color: var(--nx-text, #0f2137);
    font-size: 1.48rem;
    letter-spacing: -0.045em;
}

.nx-iaq-toolbar p {
    margin: 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.92rem;
}

.nx-iaq-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.nx-danger-soft:hover {
    color: var(--nx-danger, #dc2626) !important;
    border-color: rgba(220, 38, 38, 0.24) !important;
    background: rgba(220, 38, 38, 0.06) !important;
}

.nx-iaq-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

.nx-sheet-panel,
.nx-iaq-side-panel .nx-side-card,
.nx-reference-section {
    border: 1px solid var(--nx-border, rgba(15, 87, 130, 0.14));
    border-radius: var(--nx-radius-lg, 30px);
    background: rgba(255, 255, 255, 0.91);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-sheet-panel {
    overflow: hidden;
    min-width: 0;
}

.nx-sheet-scroll {
    width: 100%;
    max-height: 68vh;
    overflow: auto;
    border-radius: var(--nx-radius-lg, 30px);
    background:
        linear-gradient(90deg, rgba(2, 132, 199, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(2, 132, 199, 0.04) 1px, transparent 1px),
        rgba(255, 255, 255, 0.92);
    background-size: 38px 38px;
}

.nx-iaq-sheet {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.nx-iaq-sheet th,
.nx-iaq-sheet td {
    border-right: 1px solid var(--iaq-sheet-border);
    border-bottom: 1px solid var(--iaq-sheet-border);
    padding: 0;
    vertical-align: middle;
    background: var(--iaq-sheet-cell);
}

.nx-iaq-sheet th {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 42px;
    padding: 10px 10px;
    color: var(--nx-soft, #3f5871);
    background: var(--iaq-sheet-head);
    font-size: 0.72rem;
    font-weight: 950;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    backdrop-filter: blur(10px);
}

.nx-iaq-sheet tbody tr:nth-child(even) td:not(.nx-sticky-col) {
    background: var(--iaq-sheet-cell-alt);
}

.nx-iaq-sheet tbody tr.is-selected td {
    background: rgba(232, 246, 253, 0.98) !important;
}

.nx-iaq-sheet tbody tr:hover td {
    background: rgba(239, 249, 255, 0.98) !important;
}

.nx-iaq-sheet tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 18;
    height: 44px;
    padding: 10px;
    color: var(--nx-text, #0f2137);
    background: rgba(255, 255, 255, 0.98);
    font-weight: 950;
    backdrop-filter: blur(12px);
}

.nx-col-index,
.nx-row-index {
    width: 54px;
    min-width: 54px;
    text-align: center !important;
}

.nx-col-zone {
    min-width: 170px;
}

.nx-col-space {
    min-width: 210px;
}

.nx-col-result {
    min-width: 96px;
}

.nx-col-actions {
    min-width: 132px;
}

/* Columnas compactas con anchos mínimos para que los valores de 3+ dígitos no se corten */
.nx-iaq-sheet th:nth-child(4),
.nx-iaq-sheet td:nth-child(4) { min-width: 118px; }
.nx-iaq-sheet th:nth-child(5),
.nx-iaq-sheet td:nth-child(5) { min-width: 82px; }
.nx-iaq-sheet th:nth-child(6),
.nx-iaq-sheet td:nth-child(6) { min-width: 112px; }
.nx-iaq-sheet th:nth-child(7),
.nx-iaq-sheet td:nth-child(7) { min-width: 92px; }
.nx-iaq-sheet th:nth-child(8),
.nx-iaq-sheet td:nth-child(8) { min-width: 110px; }
.nx-iaq-sheet th:nth-child(9),
.nx-iaq-sheet td:nth-child(9) { min-width: 96px; }
.nx-iaq-sheet th:nth-child(10),
.nx-iaq-sheet td:nth-child(10) { min-width: 96px; }
.nx-iaq-sheet th:nth-child(11),
.nx-iaq-sheet td:nth-child(11),
.nx-iaq-sheet th:nth-child(12),
.nx-iaq-sheet td:nth-child(12),
.nx-iaq-sheet th:nth-child(13),
.nx-iaq-sheet td:nth-child(13) { min-width: 112px; }
.nx-iaq-sheet th:nth-child(14),
.nx-iaq-sheet td:nth-child(14) { min-width: 120px; }
.nx-iaq-sheet th:nth-child(15),
.nx-iaq-sheet td:nth-child(15) { min-width: 96px; }
.nx-iaq-sheet th:nth-child(16),
.nx-iaq-sheet td:nth-child(16) { min-width: 92px; }

/* Separación visual: celdas editables vs celdas calculadas */
.nx-iaq-sheet tbody td:nth-child(n+2):nth-child(-n+10) {
    background: var(--iaq-sheet-input-bg) !important;
}
.nx-iaq-sheet tbody tr:nth-child(even) td:nth-child(n+2):nth-child(-n+10) {
    background: var(--iaq-sheet-input-alt) !important;
}
.nx-iaq-sheet tbody td:nth-child(n+11):nth-child(-n+15) {
    background: var(--iaq-sheet-calc-bg) !important;
}
.nx-iaq-sheet tbody tr:nth-child(even) td:nth-child(n+11):nth-child(-n+15) {
    background: var(--iaq-sheet-calc-alt) !important;
}
.nx-iaq-sheet tbody td:nth-child(n+11):nth-child(-n+15) .nx-cell-output {
    color: var(--nx-text, #0f2137);
}
.nx-iaq-sheet tbody td:nth-child(13) .nx-cell-output {
    color: var(--nx-accent, #0284c7);
}

.nx-sticky-col {
    position: sticky;
    left: 0;
    z-index: 12;
    background: var(--iaq-sheet-sticky) !important;
}

.nx-iaq-sheet th.nx-sticky-col {
    z-index: 24;
}

.nx-row-index {
    color: var(--nx-muted, #6b7f95);
    font-weight: 950;
    background: rgba(248, 251, 255, 0.98) !important;
}

.nx-sheet-input,
.nx-sheet-select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 0;
    border-radius: 0;
    padding: 0 12px;
    color: var(--nx-text, #0f2137);
    background: rgba(255, 255, 255, 0.42);
    font: inherit;
    font-weight: 780;
    outline: none;
}

.nx-sheet-input:focus,
.nx-sheet-select:focus {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(2, 132, 199, 0.34);
}

.nx-sheet-input[type="number"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.nx-sheet-input[readonly] {
    color: var(--nx-accent, #0284c7);
    background: rgba(232, 246, 253, 0.78);
    font-weight: 950;
}

.nx-sheet-select {
    cursor: pointer;
}

.nx-cell-output {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    padding: 0 12px;
    color: var(--nx-text, #0f2137);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nx-cell-output.nx-main-result {
    color: var(--nx-accent, #0284c7);
    font-size: 1rem;
    font-weight: 950;
}

.nx-status-cell {
    justify-content: center;
}

.nx-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 950;
    white-space: nowrap;
}

.nx-status-ok {
    color: var(--nx-success, #059669);
    background: rgba(5, 150, 105, 0.10);
    border: 1px solid rgba(5, 150, 105, 0.22);
}

.nx-status-warning {
    color: var(--nx-warning, #d97706);
    background: rgba(217, 119, 6, 0.10);
    border: 1px solid rgba(217, 119, 6, 0.22);
}

.nx-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 8px;
}

.nx-icon-btn {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 10px;
    color: var(--nx-soft, #3f5871);
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-weight: 950;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nx-icon-btn:hover {
    transform: translateY(-1px);
    color: var(--nx-accent, #0284c7);
    border-color: rgba(2, 132, 199, 0.28);
    background: #ffffff;
}

.nx-icon-btn.nx-delete:hover {
    color: var(--nx-danger, #dc2626);
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.06);
}

.nx-iaq-side-panel {
    position: sticky;
    top: 110px;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.nx-side-card {
    padding: 20px;
}

.nx-side-card h2,
.nx-side-card h3 {
    margin: 6px 0 10px;
    color: var(--nx-text, #0f2137);
    letter-spacing: -0.04em;
}

.nx-side-card p {
    margin: 0;
    color: var(--nx-soft, #3f5871);
    line-height: 1.6;
    font-size: 0.92rem;
}

.nx-side-card-featured {
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.12), transparent 42%),
        rgba(255, 255, 255, 0.94) !important;
}

.nx-side-card-featured strong {
    display: block;
    margin: 6px 0 3px;
    color: var(--nx-accent, #0284c7);
    font-size: 2.25rem;
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.nx-side-card-featured small {
    color: var(--nx-muted, #6b7f95);
    font-weight: 800;
}

.nx-warning-box {
    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;
}

.nx-empty-state {
    margin: 20px;
    padding: 28px;
    text-align: center;
    border: 1px dashed rgba(2, 132, 199, 0.26);
    border-radius: 24px;
    background: rgba(248, 251, 255, 0.84);
}

.nx-empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 18px;
    color: var(--nx-accent, #0284c7);
    background: rgba(14, 165, 233, 0.10);
    font-size: 1.8rem;
}

.nx-empty-state strong {
    display: block;
    color: var(--nx-text, #0f2137);
    font-size: 1.1rem;
}

.nx-empty-state p {
    margin: 8px 0 0;
    color: var(--nx-muted, #6b7f95);
}

.nx-reference-section {
    margin-top: 22px;
    padding: 24px;
}

.nx-reference-section .nx-section-header p {
    margin: 6px 0 0;
    color: var(--nx-muted, #6b7f95);
    line-height: 1.5;
}

.nx-reference-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.nx-reference-card {
    padding: 16px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.82));
    box-shadow: 0 10px 28px rgba(15, 35, 60, 0.04);
}

.nx-reference-card h3 {
    margin: 0;
    color: var(--nx-text, #0f2137);
    font-size: 1rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.nx-reference-card p {
    margin: 8px 0 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.82rem;
    line-height: 1.45;
}

.nx-reference-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.nx-reference-values span {
    padding: 9px;
    border: 1px solid rgba(15, 87, 130, 0.10);
    border-radius: 14px;
    background: rgba(248, 251, 255, 0.86);
    color: var(--nx-soft, #3f5871);
    font-size: 0.76rem;
    font-weight: 850;
    text-align: center;
}

.nx-reference-values strong {
    display: block;
    color: var(--nx-accent, #0284c7);
    font-size: 1rem;
}

.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;
}

.nx-toast-container {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: grid;
    gap: 10px;
}

.nx-toast {
    min-width: 220px;
    padding: 12px 14px;
    border: 1px solid rgba(2, 132, 199, 0.22);
    border-radius: 16px;
    color: var(--nx-text, #0f2137);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(15, 35, 60, 0.14);
    font-weight: 800;
    animation: nxToastIn 0.22s ease both;
}

.nx-toast.is-out {
    animation: nxToastOut 0.22s ease both;
}

@keyframes nxToastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes nxToastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}



/* ---------------------------------------------------------
   Ayuda de columnas y encabezados técnicos
   --------------------------------------------------------- */

.nx-iaq-sheet th[data-i18n-title] {
    cursor: help;
}

.nx-th-main {
    display: block;
    color: var(--nx-text, #0f2137);
    font-size: 0.78rem;
    line-height: 1.05;
}

.nx-iaq-sheet th small {
    display: block;
    margin-top: 3px;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.05;
    white-space: nowrap;
}

.nx-iaq-column-guide {
    margin: 0 0 18px;
    padding: 20px;
    border: 1px solid rgba(2, 132, 199, 0.16);
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.10), transparent 42%),
        rgba(255, 255, 255, 0.90);
    box-shadow: var(--nx-shadow-soft, 0 14px 36px rgba(15, 35, 60, 0.07));
}

.nx-column-guide-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.nx-column-guide-head h2 {
    margin: 4px 0 0;
    color: var(--nx-text, #0f2137);
    font-size: 1.28rem;
    letter-spacing: -0.04em;
}

.nx-column-guide-head p {
    width: min(100%, 560px);
    margin: 0;
    color: var(--nx-muted, #6b7f95);
    font-size: 0.9rem;
    line-height: 1.5;
}

.nx-column-guide-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.nx-column-guide-card {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.86);
}

.nx-column-guide-card strong {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--nx-accent, #0284c7), var(--nx-accent-3, #06b6d4));
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: -0.015em;
}

.nx-column-guide-card span {
    display: block;
    margin-top: 9px;
    color: var(--nx-text, #0f2137);
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1.15;
}

.nx-column-guide-card p {
    margin: 6px 0 0;
    color: var(--nx-soft, #3f5871);
    font-size: 0.76rem;
    line-height: 1.38;
}

.nx-column-guide-result {
    background: rgba(232, 246, 253, 0.92);
    border-color: rgba(2, 132, 199, 0.24);
}

.nx-method-list {
    display: grid;
    gap: 7px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.nx-method-list li {
    padding: 9px 10px;
    border: 1px solid rgba(15, 87, 130, 0.10);
    border-radius: 14px;
    background: rgba(248, 251, 255, 0.82);
    color: var(--nx-soft, #3f5871);
    font-size: 0.82rem;
    line-height: 1.35;
}

.nx-method-list strong {
    color: var(--nx-accent, #0284c7);
}

@media (min-width: 1500px) {
    .nx-iaq-shell {
        width: min(100% - 16px, var(--nx-max));
    }

    .nx-iaq-workspace {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    .nx-iaq-hero {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 1280px) {
    .nx-column-guide-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .nx-iaq-workspace {
        grid-template-columns: 1fr;
    }

    .nx-iaq-side-panel {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nx-reference-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .nx-column-guide-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-column-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nx-iaq-hero {
        grid-template-columns: 1fr;
    }

    .nx-iaq-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .nx-iaq-toolbar-actions {
        justify-content: flex-start;
    }

    .nx-iaq-side-panel {
        grid-template-columns: 1fr;
    }

    .nx-reference-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .nx-column-guide-grid {
        grid-template-columns: 1fr;
    }

    .nx-iaq-column-guide {
        padding: 16px;
        border-radius: 22px;
    }

    .nx-iaq-shell {
        width: min(100% - 24px, var(--nx-max));
    }

    .nx-iaq-hero-main::after {
        opacity: 0.16;
        width: 100%;
    }

    .nx-iaq-toolbar-actions .nx-btn {
        flex: 1 1 calc(50% - 10px);
    }

    .nx-reference-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .nx-topbar,
    .nx-iaq-toolbar,
    .nx-iaq-side-panel,
    .nx-reference-section,
    .nx-info-grid,
    .nx-disclaimer,
    .nx-footer,
    .nx-toast-container,
    .nx-pwa-help {
        display: none !important;
    }

    .nx-iaq-hero,
    .nx-summary-grid {
        display: none !important;
    }

    .nx-iaq-workspace {
        display: block;
    }

    .nx-sheet-scroll {
        max-height: none;
        overflow: visible;
    }

    .nx-iaq-sheet {
        min-width: 0;
        font-size: 10px;
    }
}

.nx-column-guide-highlight {
    border-color: rgba(2, 132, 199, 0.22) !important;
    background: radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.10), transparent 42%), rgba(255, 255, 255, 0.94) !important;
}

/* =========================================================
   NEXENG IAQ v1.1.8
   Ajuste UX: tabla compacta sin scroll horizontal en desktop,
   controles pegados a la hoja y panel lateral debajo.
   ========================================================= */

@media screen {
    .nx-iaq-shell {
        --nx-max: 1920px;
        width: min(100% - 20px, var(--nx-max));
    }

    .nx-iaq-toolbar {
        position: sticky;
        top: 92px;
        z-index: 46;
        align-items: center;
        margin: 12px 0 12px;
        padding: 12px 14px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(16px);
    }

    .nx-iaq-toolbar h2 {
        margin: 2px 0 0;
        font-size: 1.16rem;
    }

    .nx-iaq-toolbar p {
        display: none;
    }

    .nx-iaq-toolbar-actions {
        gap: 8px;
    }

    .nx-iaq-toolbar-actions .nx-btn {
        min-height: 38px;
        padding: 0 13px;
        font-size: 0.82rem;
    }

    .nx-iaq-workspace {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
    }

    .nx-iaq-side-panel {
        position: static !important;
        top: auto !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .nx-side-card {
        padding: 16px;
    }

    .nx-side-card-featured strong {
        font-size: 2rem;
    }

    .nx-sheet-scroll {
        max-height: 72vh;
        overflow: auto;
    }

    .nx-iaq-sheet {
        width: 100%;
        min-width: 1180px;
        table-layout: fixed;
        font-size: 0.78rem;
    }

    .nx-iaq-sheet th,
    .nx-iaq-sheet td,
    .nx-col-index,
    .nx-row-index,
    .nx-col-zone,
    .nx-col-space,
    .nx-col-result,
    .nx-col-actions {
        min-width: 0 !important;
    }

    .nx-iaq-sheet th {
        height: 40px;
        padding: 7px 6px;
        white-space: normal;
        line-height: 1.05;
        letter-spacing: 0.045em;
        font-size: 0.64rem;
    }

    .nx-iaq-sheet th small {
        display: block;
        margin-top: 2px;
        font-size: 0.52rem;
        line-height: 1.05;
        letter-spacing: 0.01em;
        text-transform: none;
    }

    .nx-iaq-sheet th:nth-child(1),
    .nx-iaq-sheet td:nth-child(1) { width: 36px; }

    .nx-iaq-sheet th:nth-child(2),
    .nx-iaq-sheet td:nth-child(2) { width: 100px; }

    .nx-iaq-sheet th:nth-child(3),
    .nx-iaq-sheet td:nth-child(3) { width: 190px; }

    .nx-iaq-sheet th:nth-child(4),
    .nx-iaq-sheet td:nth-child(4) { width: 78px; }

    .nx-iaq-sheet th:nth-child(5),
    .nx-iaq-sheet td:nth-child(5) { width: 58px; }

    .nx-iaq-sheet th:nth-child(6),
    .nx-iaq-sheet td:nth-child(6) { width: 82px; }

    .nx-iaq-sheet th:nth-child(7),
    .nx-iaq-sheet td:nth-child(7) { width: 54px; }

    .nx-iaq-sheet th:nth-child(8),
    .nx-iaq-sheet td:nth-child(8) { width: 82px; }

    .nx-iaq-sheet th:nth-child(9),
    .nx-iaq-sheet td:nth-child(9) { width: 64px; }

    .nx-iaq-sheet th:nth-child(10),
    .nx-iaq-sheet td:nth-child(10) { width: 60px; }

    .nx-iaq-sheet th:nth-child(11),
    .nx-iaq-sheet td:nth-child(11) { width: 66px; }

    .nx-iaq-sheet th:nth-child(12),
    .nx-iaq-sheet td:nth-child(12) { width: 70px; }

    .nx-iaq-sheet th:nth-child(13),
    .nx-iaq-sheet td:nth-child(13) { width: 62px; }

    .nx-iaq-sheet th:nth-child(14),
    .nx-iaq-sheet td:nth-child(14) { width: 76px; }

    .nx-iaq-sheet th:nth-child(15),
    .nx-iaq-sheet td:nth-child(15) { width: 58px; }

    .nx-iaq-sheet th:nth-child(16),
    .nx-iaq-sheet td:nth-child(16) { width: 62px; }

    .nx-iaq-sheet th:nth-child(17),
    .nx-iaq-sheet td:nth-child(17) { width: 66px; }

    .nx-sheet-input,
    .nx-sheet-select {
        height: 38px;
        padding: 0 7px;
        font-size: 0.78rem;
        background: rgba(255, 255, 255, 0.48);
    }

    .nx-sheet-select {
        padding-right: 22px;
        text-overflow: ellipsis;
    }

    .nx-cell-output {
        min-height: 38px;
        padding: 0 7px;
        font-size: 0.78rem;
    }

    .nx-cell-output.nx-main-result {
        font-size: 0.86rem;
    }

    .nx-status-badge {
        min-height: 22px;
        padding: 0 7px;
        font-size: 0.62rem;
    }

    .nx-row-actions {
        min-height: 38px;
        gap: 4px;
        padding: 0 4px;
    }

    .nx-icon-btn {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        font-size: 0.76rem;
    }

    .nx-iaq-sheet tfoot td {
        height: 40px;
        padding: 8px 7px;
    }

    .nx-iaq-sheet tbody td:nth-child(n+2):nth-child(-n+10) {
        background: rgba(255, 252, 235, 0.98) !important;
    }

    .nx-iaq-sheet tbody td:nth-child(n+11):nth-child(-n+15) {
        background: rgba(239, 247, 252, 0.98) !important;
    }

    .nx-iaq-column-guide {
        margin-top: 18px;
    }
}

@media screen and (max-width: 1280px) {
    .nx-iaq-toolbar {
        top: 84px;
    }

    .nx-iaq-sheet {
        min-width: 1120px;
        font-size: 0.74rem;
    }

    .nx-iaq-side-panel {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 720px) {
    .nx-iaq-toolbar {
        position: static;
    }

    .nx-iaq-toolbar-actions .nx-btn {
        flex: 1 1 calc(50% - 8px);
    }
}
