:root {
    --nex-primary: #1E3A8A;
    --nex-accent: #38bdf8;
    --nex-text: #333;
    --nex-bg: #f9f9f9;
}

/* --- DUAL MODE STYLES --- */
.nex-inline-wrapper { margin-bottom: 1.5em; display: block; }
.nex-inline-heading { display: inline; font-size: 1em; line-height: inherit; margin: 0; padding: 0; font-weight: 700; color: var(--nex-primary); }
.nex-inline-content { display: inline; }
.nex-inline-heading { margin: 0; }

h2.nex-standard-heading, h3.nex-standard-heading, h4.nex-standard-heading {
    margin-top: 1.5em; margin-bottom: 0.5em; font-weight: 700;
}

/* --- CORE NEXINDEX STYLES --- */
.nex-progress-bar { position: fixed; top: 0; left: 0; height: 4px; background: var(--nex-primary); width: 0%; z-index: 99999; transition: width 0.1s; }
.nexindex-container { margin-bottom: 2em; padding: 1.5em; border-radius: 8px; font-family: inherit; position: relative; max-width: 100%; }
.nexindex-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.nexindex-title { font-weight: 700; font-size: 1.1em; }
.nexindex-toggle { background: none; border: none; cursor: pointer; width: 24px; height: 24px; position: relative; }
.nexindex-toggle::after { content: ''; display: inline-block; width: 8px; height: 8px; border-right: 2px solid #666; border-bottom: 2px solid #666; transform: rotate(45deg); transition: transform 0.3s; }
.nexindex-container.collapsed .nexindex-toggle::after { transform: rotate(-135deg); }
.nexindex-list { list-style: none !important; margin: 0 !important; padding: 0 !important; max-height: 2000px; overflow: hidden; transition: max-height 0.3s ease-out; }
.nexindex-container.collapsed .nexindex-list { max-height: 0; }
.nexindex-item { margin: 5px 0; }
.nexindex-link { text-decoration: none; color: inherit; font-size: 0.95em; transition: color 0.2s; }
.nexindex-link:hover { color: var(--nex-primary); }
.nexindex-level-3 { padding-left: 20px; font-size: 0.9em; }
.nexindex-level-4 { padding-left: 40px; font-size: 0.85em; }
.nexindex-item.active > .nexindex-link { font-weight: 700; color: var(--nex-primary); }

/* Skins */
.is-style-glass { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.5); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.is-style-notion { background: transparent; padding-left: 0; }
.is-style-notion .nexindex-header { border-bottom: 2px solid #333; padding-bottom: 5px; }
.is-style-midnight { background: #0F172A; color: #f1f5f9; border: 1px solid #1E293B; }
.is-style-midnight .nexindex-link { color: #cbd5e1; }
.is-style-midnight .nexindex-link:hover, .is-style-midnight .nexindex-item.active > .nexindex-link { color: #38bdf8; }
.is-style-midnight .nexindex-toggle::after { border-color: #cbd5e1; }
.is-style-minimal { background: #fff; border-left: 4px solid var(--nex-primary); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.is-style-card { background: #fff; border: 1px solid #eee; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

/* Mobile Floating Widget */
.nex-floating-btn { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; background: var(--nex-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); cursor: pointer; z-index: 9990; transition: transform 0.2s; }
.nex-floating-btn:active { transform: scale(0.9); }
.nex-offcanvas-menu { position: fixed; bottom: -100%; left: 0; width: 100%; background: white; border-top-left-radius: 16px; border-top-right-radius: 16px; padding: 20px; box-shadow: 0 -5px 40px rgba(0,0,0,0.15); transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 9991; max-height: 85vh; overflow-y: auto; box-sizing: border-box; }
.nex-offcanvas-menu.open { bottom: 0; }
.nex-offcanvas-header { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.2em; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
#nex-close-offcanvas { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; }
@media (min-width: 768px) { .nex-floating-btn, .nex-offcanvas-menu { display: none !important; } }