/* =========================================================
   NEXENG DUCT SIZER - COMPACT LIGHT THEME
   Archivo: /apps/duct_sizer/assets/duct-sizer.css
   ========================================================= */

:root {
    --nx-bg: #f5f8fc;
    --nx-bg-2: #eaf2fb;
    --nx-card: rgba(255, 255, 255, 0.94);
    --nx-card-2: rgba(248, 251, 255, 0.98);

    --nx-border: rgba(15, 87, 130, 0.14);
    --nx-border-strong: rgba(2, 132, 199, 0.32);

    --nx-text: #0f2137;
    --nx-muted: #6b7f95;
    --nx-soft: #3f5871;

    --nx-accent: #0284c7;
    --nx-accent-2: #0ea5e9;
    --nx-accent-3: #06b6d4;

    --nx-orange: #f97316;
    --nx-success: #059669;
    --nx-warning: #d97706;
    --nx-danger: #dc2626;
    --nx-info: #2563eb;

    --nx-shadow: 0 24px 70px rgba(15, 35, 60, 0.10);
    --nx-shadow-soft: 0 14px 36px rgba(15, 35, 60, 0.07);

    --nx-radius-lg: 30px;
    --nx-radius-md: 22px;
    --nx-radius-sm: 15px;

    --nx-max: 1420px;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.16), transparent 34%),
        radial-gradient(circle at 92% 14%, rgba(249, 115, 22, 0.08), transparent 32%),
        radial-gradient(circle at 52% 96%, rgba(6, 182, 212, 0.10), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f5f8fc 46%, #eaf2fb 100%);
    color: var(--nx-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* =========================================================
   BACKGROUND
   ========================================================= */

.nx-bg-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(2, 132, 199, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 132, 199, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 90%);
}

.nx-bg-glow {
    position: fixed;
    width: 520px;
    height: 520px;
    z-index: -2;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(76px);
    opacity: 0.26;
}

.nx-bg-glow-a {
    top: -190px;
    left: -150px;
    background: #38bdf8;
}

.nx-bg-glow-b {
    right: -180px;
    bottom: 4%;
    background: #fb923c;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.nx-app-shell {
    width: min(100% - 48px, var(--nx-max));
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 48px;
}

.nx-main {
    width: 100%;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.nx-topbar {
    position: sticky;
    top: 18px;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--nx-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 50px rgba(15, 35, 60, 0.10);
    backdrop-filter: blur(18px);
}

.nx-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nx-brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    color: #ffffff;
    font-weight: 950;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    box-shadow: 0 12px 26px rgba(2, 132, 199, 0.25);
}

.nx-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.nx-brand-text strong {
    color: var(--nx-text);
    font-size: 1rem;
    letter-spacing: 0.12em;
}

.nx-brand-text span {
    margin-top: 4px;
    color: var(--nx-muted);
    font-size: 0.72rem;
}

.nx-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.nx-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 18px;
    color: var(--nx-text);
    background: transparent;
    font-weight: 850;
    font-size: 0.92rem;
    white-space: nowrap;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}

.nx-btn:hover {
    transform: translateY(-1px);
}

.nx-btn:active {
    transform: translateY(0);
}

.nx-btn:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(2, 132, 199, 0.18);
    outline-offset: 2px;
}

.nx-btn-primary {
    border-color: rgba(2, 132, 199, 0.32);
    background: linear-gradient(135deg, #0284c7, #06b6d4 55%, #38bdf8);
    color: #ffffff;
    box-shadow: 0 14px 32px rgba(2, 132, 199, 0.24);
}

.nx-btn-primary:hover {
    box-shadow: 0 18px 42px rgba(2, 132, 199, 0.32);
}

.nx-btn-orange {
    border-color: rgba(249, 115, 22, 0.30);
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: #fff7ed;
    box-shadow: 0 14px 32px rgba(249, 115, 22, 0.20);
}

.nx-btn-orange:hover {
    box-shadow: 0 18px 42px rgba(249, 115, 22, 0.28);
}

.nx-btn-ghost {
    border-color: rgba(15, 87, 130, 0.16);
    background: rgba(255, 255, 255, 0.72);
    color: var(--nx-soft);
}

.nx-btn-ghost:hover {
    border-color: var(--nx-border-strong);
    background: #ffffff;
    color: var(--nx-accent);
}

.nx-btn-large {
    min-height: 52px;
    padding: 0 24px;
    font-size: 1rem;
}

/* =========================================================
   HERO
   ========================================================= */

.nx-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 370px);
    gap: 24px;
    align-items: stretch;
    padding: 48px 0 22px;
}

.nx-hero-content {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 52px);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    background:
        radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.13), transparent 42%),
        radial-gradient(circle at 100% 80%, rgba(249, 115, 22, 0.06), transparent 38%),
        rgba(255, 255, 255, 0.86);
    box-shadow: var(--nx-shadow);
    backdrop-filter: blur(18px);
}

.nx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--nx-accent);
    font-size: 0.8rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--nx-success);
    box-shadow: 0 0 18px rgba(5, 150, 105, 0.45);
}

.nx-hero h1 {
    max-width: 920px;
    margin: 0;
    color: var(--nx-text);
    font-size: clamp(2.45rem, 4.8vw, 5rem);
    line-height: 0.96;
    letter-spacing: -0.075em;
}

.nx-hero h1 span {
    color: var(--nx-accent);
}

.nx-hero p {
    max-width: 840px;
    margin: 20px 0 0;
    color: var(--nx-soft);
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    line-height: 1.75;
}

.nx-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.nx-hero-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 999px;
    background: rgba(245, 248, 252, 0.90);
    color: #4f6982;
    font-size: 0.78rem;
    font-weight: 850;
}

.nx-hero-summary {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid rgba(2, 132, 199, 0.24);
    border-radius: var(--nx-radius-lg);
    background:
        radial-gradient(circle at 16% 0%, rgba(14, 165, 233, 0.14), transparent 44%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,249,255,0.92));
    box-shadow: var(--nx-shadow-soft);
    backdrop-filter: blur(18px);
}

.nx-card-label {
    color: var(--nx-muted);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-hero-total strong {
    display: block;
    margin-top: 14px;
    color: var(--nx-accent);
    font-size: clamp(2.8rem, 4.5vw, 4.7rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
}

.nx-hero-total small {
    display: block;
    margin-top: 8px;
    color: var(--nx-soft);
    font-size: 1rem;
    font-weight: 850;
}

.nx-hero-summary p {
    margin: 16px 0 0;
    color: var(--nx-muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

/* =========================================================
   SUMMARY
   ========================================================= */

.nx-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.nx-summary-card {
    padding: 18px;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: 0 12px 34px rgba(15, 35, 60, 0.06);
}

.nx-summary-card span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.75rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-summary-card strong {
    display: block;
    margin-top: 8px;
    color: var(--nx-text);
    font-size: 1.45rem;
    line-height: 1;
    letter-spacing: -0.045em;
    font-weight: 950;
}

.nx-summary-card small {
    color: var(--nx-muted);
    font-size: 0.82rem;
    letter-spacing: 0;
}

/* =========================================================
   MAIN TOOL
   ========================================================= */

.nx-tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
    gap: 22px;
    align-items: start;
    padding: 0 0 34px;
}

.nx-panel {
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    background: var(--nx-card);
    box-shadow: var(--nx-shadow-soft);
    backdrop-filter: blur(18px);
}

.nx-input-panel,
.nx-results-panel {
    padding: 24px;
}

.nx-results-panel {
    position: sticky;
    top: 104px;
    border-color: rgba(2, 132, 199, 0.24);
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.10), transparent 42%),
        rgba(255, 255, 255, 0.94);
}

.nx-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.nx-panel-header h2,
.nx-section-header h2 {
    margin: 7px 0 0;
    color: var(--nx-text);
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.nx-section-label {
    display: inline-block;
    color: var(--nx-accent);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.nx-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(2, 132, 199, 0.18);
    border-radius: 999px;
    background: rgba(2, 132, 199, 0.08);
    color: var(--nx-accent);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.nx-status-calc {
    color: var(--nx-success);
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.22);
}

/* =========================================================
   FORMS
   ========================================================= */

.nx-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.nx-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.nx-field label {
    color: var(--nx-soft);
    font-size: 0.86rem;
    font-weight: 850;
}

.nx-input,
.nx-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 15px;
    background: #ffffff;
    color: var(--nx-text);
    padding: 0 14px;
    outline: none;
    font-weight: 750;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.nx-input::placeholder {
    color: rgba(107, 127, 149, 0.65);
}

.nx-input:focus,
.nx-select:focus {
    border-color: rgba(2, 132, 199, 0.48);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.10);
    background: #ffffff;
}

.nx-combo-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid rgba(15, 87, 130, 0.14);
    border-radius: 15px;
    background: #ffffff;
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.nx-combo-field:focus-within {
    border-color: rgba(2, 132, 199, 0.48);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.10);
}

.nx-combo-field .nx-input,
.nx-combo-field .nx-select {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.nx-combo-field .nx-unit-select {
    width: auto;
    min-width: 118px;
    border-left: 1px solid rgba(15, 87, 130, 0.10);
    background: rgba(248, 251, 255, 0.88);
    color: var(--nx-soft);
    font-size: 0.84rem;
    font-weight: 900;
}

.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);
    font-size: 0.92rem;
    line-height: 1.6;
}

.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);
    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);
    font-weight: 950;
}

.nx-advanced-box[open] summary::after {
    content: "−";
}

.nx-advanced-grid {
    padding: 0 16px 16px;
    margin-bottom: 0;
}

.nx-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nx-form-actions .nx-btn {
    flex: 1;
}

.nx-alert,
.nx-warning-box {
    margin-top: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(220, 38, 38, 0.22);
    border-radius: 18px;
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
    font-size: 0.92rem;
    line-height: 1.65;
}

.nx-warning-box {
    border-color: rgba(217, 119, 6, 0.22);
    background: rgba(217, 119, 6, 0.08);
    color: #92400e;
}

/* =========================================================
   RESULTS
   ========================================================= */

.nx-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.nx-result-card {
    min-height: 126px;
    padding: 16px;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.86));
    box-shadow: 0 10px 28px rgba(15, 35, 60, 0.05);
}

.nx-result-card span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-result-card strong {
    display: block;
    margin-top: 10px;
    color: var(--nx-text);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.nx-result-card small {
    display: block;
    margin-top: 8px;
    color: var(--nx-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.nx-result-featured {
    grid-column: 1 / -1;
    border-color: rgba(2, 132, 199, 0.28);
    background:
        radial-gradient(circle at 8% 0%, rgba(14, 165, 233, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.90));
}

.nx-result-featured strong {
    color: var(--nx-accent);
    font-size: clamp(2rem, 4vw, 3.1rem);
}

/* =========================================================
   RECTANGULAR PREVIEW
   ========================================================= */

.nx-rect-preview {
    margin-top: 22px;
}

.nx-rect-preview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.nx-rect-preview-header h3 {
    margin: 6px 0 0;
    color: var(--nx-text);
    font-size: 1.18rem;
    letter-spacing: -0.04em;
}

.nx-rect-list {
    display: grid;
    gap: 8px;
}

.nx-rect-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid rgba(15, 87, 130, 0.11);
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.88);
}

.nx-rect-item strong {
    color: var(--nx-text);
    font-size: 1rem;
}

.nx-rect-item span {
    display: block;
    margin-top: 4px;
    color: var(--nx-muted);
    font-size: 0.8rem;
}

.nx-rect-item small {
    color: var(--nx-accent);
    font-weight: 950;
}

.nx-empty-mini {
    padding: 15px;
    border: 1px dashed rgba(15, 87, 130, 0.18);
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.72);
    color: var(--nx-muted);
    text-align: center;
    font-size: 0.9rem;
}

/* =========================================================
   SAVED CALCS
   ========================================================= */

.nx-calcs-section {
    margin-top: 8px;
    padding: 24px;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-lg);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--nx-shadow-soft);
}

.nx-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.nx-empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 220px;
    padding: 28px;
    border: 1px dashed rgba(15, 87, 130, 0.20);
    border-radius: 22px;
    background: rgba(248, 251, 255, 0.72);
    color: var(--nx-muted);
}

.nx-empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 18px;
    color: var(--nx-accent);
    background: rgba(2, 132, 199, 0.08);
    font-size: 2rem;
}

.nx-empty-state strong {
    color: var(--nx-text);
    font-size: 1.1rem;
}

.nx-empty-state p {
    margin: 6px 0 0;
}

.nx-calc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.nx-calc-card {
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 22px;
    background:
        radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.08), transparent 42%),
        #ffffff;
    box-shadow: 0 12px 32px rgba(15, 35, 60, 0.06);
    overflow: hidden;
}

.nx-calc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(15, 87, 130, 0.08);
}

.nx-calc-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nx-calc-title strong {
    color: var(--nx-text);
    font-size: 1.15rem;
    letter-spacing: -0.035em;
}

.nx-calc-title span {
    color: var(--nx-muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.nx-calc-total {
    text-align: right;
}

.nx-calc-total span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-calc-total strong {
    display: block;
    margin-top: 4px;
    color: var(--nx-accent);
    font-size: 1.35rem;
    line-height: 1;
    letter-spacing: -0.045em;
}

.nx-calc-body {
    padding: 14px 18px 18px;
}

.nx-calc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.nx-calc-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(15, 87, 130, 0.11);
    border-radius: 999px;
    background: rgba(248, 251, 255, 0.88);
    color: var(--nx-soft);
    font-size: 0.78rem;
    font-weight: 850;
}

.nx-calc-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nx-calc-metric {
    padding: 11px;
    border-radius: 15px;
    background: rgba(248, 251, 255, 0.84);
    border: 1px solid rgba(15, 87, 130, 0.09);
}

.nx-calc-metric span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.nx-calc-metric strong {
    display: block;
    margin-top: 5px;
    color: var(--nx-text);
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.nx-calc-rects {
    margin-top: 14px;
    padding: 13px;
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.84);
    border: 1px solid rgba(15, 87, 130, 0.09);
}

.nx-calc-rects span {
    display: block;
    margin-bottom: 7px;
    color: var(--nx-muted);
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.nx-calc-rects p {
    margin: 0;
    color: var(--nx-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.nx-calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.nx-mini-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 999px;
    background: #ffffff;
    color: var(--nx-soft);
    padding: 0 13px;
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
    transition: 0.2s ease;
}

.nx-mini-btn:hover {
    border-color: var(--nx-border-strong);
    color: var(--nx-accent);
    transform: translateY(-1px);
}

.nx-mini-btn.danger:hover {
    border-color: rgba(220, 38, 38, 0.22);
    color: var(--nx-danger);
    background: rgba(220, 38, 38, 0.06);
}

/* =========================================================
   INFO / DISCLAIMER / FOOTER
   ========================================================= */

.nx-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.nx-info-card {
    min-height: 190px;
    padding: 24px;
    border: 1px solid rgba(15, 87, 130, 0.12);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.82));
    box-shadow: 0 12px 34px rgba(15, 35, 60, 0.06);
}

.nx-info-card h2 {
    margin: 9px 0 0;
    color: var(--nx-text);
    font-size: 1.25rem;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.nx-info-card p {
    margin: 13px 0 0;
    color: var(--nx-soft);
    line-height: 1.72;
    font-size: 0.96rem;
}

.nx-disclaimer {
    margin-top: 22px;
    padding: 22px 24px;
    border: 1px solid rgba(15, 87, 130, 0.13);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 34px rgba(15, 35, 60, 0.05);
}

.nx-disclaimer strong {
    display: block;
    color: var(--nx-text);
    font-size: 1rem;
    font-weight: 950;
}

.nx-disclaimer p {
    margin: 10px 0 0;
    color: var(--nx-soft);
    line-height: 1.75;
    font-size: 0.94rem;
}

.nx-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 34px;
    padding: 26px 0 36px;
    border-top: 1px solid rgba(15, 87, 130, 0.12);
    color: var(--nx-muted);
}

.nx-footer strong {
    color: var(--nx-text);
    margin-right: 8px;
}

.nx-footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nx-footer-links a {
    color: var(--nx-muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.nx-footer-links a:hover {
    color: var(--nx-accent);
}

/* =========================================================
   TOAST / PWA
   ========================================================= */

.nx-toast-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
    display: grid;
    gap: 8px;
    width: min(92vw, 380px);
}

.nx-toast {
    padding: 13px 16px;
    border: 1px solid rgba(2, 132, 199, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--nx-text);
    box-shadow: var(--nx-shadow-soft);
    font-size: 0.9rem;
    font-weight: 750;
    animation: nxToastIn 0.25s ease forwards;
}

.nx-toast.is-out {
    animation: nxToastOut 0.25s ease forwards;
}

@keyframes nxToastIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes nxToastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

.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);
}

.nx-pwa-help-card strong {
    display: block;
    margin-bottom: 10px;
    color: var(--nx-accent);
    font-size: 1.05rem;
}

.nx-pwa-help-card p {
    margin: 0;
    color: var(--nx-soft);
    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);
    font-size: 1.35rem;
    line-height: 1;
}

.nx-noscript {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    padding: 14px 16px;
    border: 1px solid rgba(217, 119, 6, 0.30);
    border-radius: 16px;
    background: #fff7ed;
    color: #92400e;
    box-shadow: var(--nx-shadow);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 1680px) {
    .nx-app-shell {
        width: min(100% - 72px, 1560px);
    }
}

@media (max-width: 1180px) {
    .nx-hero {
        grid-template-columns: 1fr;
    }

    .nx-hero-summary {
        min-height: 220px;
    }

    .nx-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nx-tool-layout {
        grid-template-columns: 1fr;
    }

    .nx-results-panel {
        position: static;
    }

    .nx-calc-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .nx-app-shell {
        width: min(100% - 24px, var(--nx-max));
    }

    .nx-topbar {
        top: 10px;
        margin-top: 10px;
        grid-template-columns: 1fr;
        justify-items: stretch;
        border-radius: 28px;
    }

    .nx-brand {
        justify-content: center;
    }

    .nx-actions {
        width: 100%;
        justify-content: center;
    }

    .nx-actions .nx-btn {
        flex: 1;
    }

    .nx-hero {
        padding-top: 34px;
    }

    .nx-hero-content {
        min-height: auto;
        padding: 24px;
        border-radius: 24px;
    }

    .nx-hero h1 {
        font-size: 2.55rem;
    }

    .nx-summary-grid,
    .nx-form-grid,
    .nx-results-grid,
    .nx-info-grid {
        grid-template-columns: 1fr;
    }

    .nx-result-featured {
        grid-column: auto;
    }

    .nx-section-header,
    .nx-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-combo-field {
        grid-template-columns: 1fr;
    }

    .nx-combo-field .nx-unit-select {
        width: 100%;
        border-left: 0;
        border-top: 1px solid rgba(15, 87, 130, 0.10);
    }

    .nx-rect-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nx-app-shell {
        width: min(100% - 16px, var(--nx-max));
    }

    .nx-topbar {
        padding: 12px;
    }

    .nx-brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .nx-brand-text strong {
        font-size: 0.94rem;
    }

    .nx-brand-text span {
        font-size: 0.7rem;
    }

    .nx-actions .nx-btn,
    .nx-form-actions .nx-btn {
        width: 100%;
        flex: none;
    }

    .nx-hero {
        padding: 28px 0 18px;
    }

    .nx-hero-content,
    .nx-hero-summary,
    .nx-input-panel,
    .nx-results-panel,
    .nx-calcs-section,
    .nx-info-card,
    .nx-disclaimer {
        padding: 20px;
        border-radius: 22px;
    }

    .nx-hero h1 {
        font-size: 2.25rem;
        letter-spacing: -0.06em;
    }

    .nx-hero p {
        font-size: 0.98rem;
    }

    .nx-hero-total strong {
        font-size: 3rem;
    }

    .nx-calc-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-calc-total {
        text-align: left;
    }

    .nx-calc-metrics {
        grid-template-columns: 1fr;
    }

    .nx-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .nx-footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .nx-toast-container {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}