/* Optional decorative surfaces. All rules are limited to the screen. */
@media screen {
    [data-nexo-glass-scope] {
        --ng-surface: 255 255 255;
        --ng-solid: #fff;
        --ng-ink: #162f47;
        --ng-muted: #50677d;
        --ng-line: #a6c7d4;
        --ng-tint: #b7d9df;
        --ng-glow: #86bbd959;
        --ng-wash: linear-gradient(100deg, #eaf3f8ed 22%, #d9eaf27a 75%);
        --ng-bottom: #edf4f8;
        --ng-alpha: .93;
        --ng-blur: 7px;
        position: relative;
        isolation: isolate;
    }

    body[data-nexo-theme="oscuro_nexo"][data-nexo-glass-scope],
    body[data-nexo-theme="oscuro_nexo"] [data-nexo-glass-scope] {
        --ng-surface: 20 38 56;
        --ng-solid: #142638;
        --ng-ink: #eef6fc;
        --ng-muted: #afc3d4;
        --ng-line: #507891;
        --ng-tint: #14384c;
        --ng-glow: #55bcb753;
        --ng-wash: linear-gradient(100deg, #102337ed 22%, #10233790 75%);
        --ng-bottom: #0d1b2a;
        --ng-alpha: .88;
    }

    [data-nexo-glass="photo"] [data-nexo-glass-scope] { --ng-blur: 10px; }
    [data-nexo-glass="cinema"] [data-nexo-glass-scope] {
        --ng-blur: 14px;
        --ng-glow: #68b7cc87;
    }

    .nexo-glass-scene {
        position: absolute;
        z-index: -1;
        inset: 0 0 auto;
        height: min(580px, 100%);
        overflow: hidden;
        background: linear-gradient(180deg, var(--ng-tint), transparent);
        pointer-events: none;
    }
    .nexo-glass-layer { position: absolute; inset: 0; }
    .nexo-glass-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 68% 42%; }
    .nexo-glass-layer::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse at 87% 9%, var(--ng-glow), transparent 66%), var(--ng-wash);
    }
    .nexo-glass-scene::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(0deg, var(--ng-bottom), transparent 62%);
    }
    [data-nexo-glass-depth="on"] .nexo-glass-layer {
        transform: perspective(900px) rotateX(var(--ng-x, 0deg)) rotateY(var(--ng-y, 0deg)) scale(1.035);
    }

    [data-nexo-glass-scope] .nexo-glass-surface {
        background: var(--ng-solid);
        border: 1px solid var(--ng-line);
        border-radius: 12px;
        color: var(--ng-ink);
        box-shadow: 0 8px 24px #152c481a;
    }
    [data-nexo-glass-scope] :is(.heading,.nx45-head,.sec-head,.nexo-welcome,.import-top).nexo-glass-surface {
        padding: 13px 16px;
    }
    [data-nexo-glass-scope] .nexo-glass-surface :is(h1,h2,h3,.nexo-stat-top,.nexo-stat-bottom,.muted) { color: var(--ng-ink); }
    [data-nexo-glass-scope] .nexo-glass-surface :is(.nexo-stat-bottom,.muted) { color: var(--ng-muted); }
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        [data-nexo-glass-transparency="on"] [data-nexo-glass-scope] .nexo-glass-surface {
            background-color: rgb(var(--ng-surface) / var(--ng-alpha));
            background-image: none;
        }
        [data-nexo-glass-transparency="on"] [data-nexo-glass-scope] .nexo-glass-blur {
            backdrop-filter: blur(var(--ng-blur));
            -webkit-backdrop-filter: blur(var(--ng-blur));
        }
        [data-nexo-glass-photo="on"][data-nexo-glass-transparency="on"] [data-nexo-glass-scope] .nexo-welcome.nexo-glass-surface {
            min-height: 124px;
            background: linear-gradient(100deg, rgb(var(--ng-surface) / .99), rgb(var(--ng-surface) / .95) 62%, rgb(var(--ng-surface) / .38));
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }
        [data-nexo-glass-photo="on"] [data-nexo-glass-scope] .nexo-welcome-text { max-width: 62%; }
    }

    @media (max-width: 760px) {
        [data-nexo-glass-photo="on"][data-nexo-glass-transparency="on"] [data-nexo-glass-scope] .nexo-welcome.nexo-glass-surface {
            background: rgb(var(--ng-surface) / .95);
        }
        [data-nexo-glass-photo="on"] [data-nexo-glass-scope] .nexo-welcome-text { max-width: 100%; }
    }

    .nexo-glass-controls .nexo-glass-fields { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: end; }
    .nexo-glass-controls .nexo-glass-fields label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .nexo-glass-controls input[type="checkbox"] { width: 17px; height: 17px; }
    .nexo-glass-controls :is(input,select) { accent-color: var(--nt-primary, #086962); }
    .nexo-glass-controls select { max-width: 100%; }
    .nexo-glass-recommendation { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
    .nexo-glass-recommendation p { flex: 1 1 220px; margin: 0; }
    @media (prefers-reduced-motion: reduce) {
        .nexo-glass-layer { transform: none !important; }
    }
    @media (prefers-reduced-transparency: reduce) {
        [data-nexo-glass-scope] .nexo-glass-surface {
            background: var(--ng-solid) !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
    }
}
.nexo-glass-scene[hidden] { display: none !important; }
@media print { .nexo-glass-scene, .nexo-glass-controls { display: none !important; } }

@media screen {
    body.nexo-standalone[data-nexo-theme="oscuro_nexo"] {
        color-scheme: dark;
        --bg: #0d1b2a;
        --ink: #eef6fc;
        --navy: var(--ink);
        --teal: #8ce5cd;
        --muted: #afc3d4;
        --line: #44647d;
        --standalone-panel: #142638;
        --standalone-field: #192f42;
        background: var(--bg);
        color: var(--ink);
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.authcard:not(.nexo-glass-surface),.import-card,.nx45-panel) {
        background: var(--standalone-panel);
        border-color: var(--line);
        color: var(--ink);
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.nx45-stat,.nx45-table th,.import-list th,.previewtag,.button.ghost,.nx45-prompt,.mutedrow) {
        background: var(--standalone-field);
        border-color: var(--line);
        color: var(--ink);
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(input, select, textarea) {
        background: var(--standalone-field);
        border-color: var(--line);
        color: var(--ink);
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.nx45-link,.nx45-panel form button,.import-actions button,.authcard button) {
        background: #086962;
        border-color: #086962;
        color: #fff;
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.note-alert,.nx45-notice,.nx45-warn) {
        background: #423620;
        border-color: #9d7942;
        color: #ffe1a6;
    }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.authcard label,.small-note, .nb-login-footer) { color: var(--muted); }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :is(.import-list td,.import-list th) { color: var(--ink); border-color: var(--line); }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] .nx45-good { color: #8ce5cd; }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] .nx45-bad { color: #ffe1a6; }
    .nexo-standalone[data-nexo-theme="oscuro_nexo"] :focus-visible { outline: 3px solid #8ac8ff; outline-offset: 3px; }
}
