.neo-mode-toggle,
.neo-period-toggle,
.neo-fee-toggle,
.neo-tenure-toggle,
.neo-repayment-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    /* Slightly darker for better contrast */
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    /* Tighter radius */
    padding: 2px;
    position: relative;
    width: fit-content;
}

.neo-mode-toggle.triple {
    width: 100%;
}

.neo-tenure-toggle.triple {
    width: 100%;
}

.neo-mode-toggle input,
.neo-period-toggle input,
.neo-fee-toggle input,
.neo-tenure-toggle input,
.neo-repayment-toggle input {
    display: none !important;
}

.neo-mode-toggle label,
.neo-period-toggle label,
.neo-fee-toggle label,
.neo-tenure-toggle label,
.neo-repayment-toggle label {
    padding: 0.4rem 0.8rem;
    font-size: 0.65rem;
    /* Reduced from 0.68rem to fit triple text */
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    /* Dimmer when inactive */
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 60px;
    text-align: center;
    flex: 1;
}

.neo-mode-toggle input:checked+label,
.neo-period-toggle input:checked+label,
.neo-fee-toggle input:checked+label,
.neo-tenure-toggle input:checked+label,
.neo-repayment-toggle input:checked+label {
    color: #1a0b2e;
}

.toggle-slider,
.period-slider,
.fee-slider,
.tenure-slider,
.repayment-slider {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc(50% - 2px);
    background: linear-gradient(135deg, var(--primary) 0%, #cc9900 100%);
    border-radius: 6px;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(255, 204, 51, 0.2);
}

.neo-mode-toggle.triple .toggle-slider {
    width: calc(33.33% - 2px);
}

.neo-tenure-toggle.triple .tenure-slider {
    width: calc(33.33% - 2px);
}

.neo-mode-toggle.triple input[value="reducing-fixed"]:checked~.toggle-slider {
    transform: translateX(100%);
}

.neo-mode-toggle.triple input[value="reducing-declining"]:checked~.toggle-slider {
    transform: translateX(200%);
}

.neo-period-toggle input[value="yearly"]:checked~.period-slider {
    transform: translateX(100%);
}

.neo-fee-toggle input[value="amount"]:checked~.fee-slider {
    transform: translateX(100%);
}

.neo-repayment-toggle input[value="lump-sum"]:checked~.repayment-slider {
    transform: translateX(100%);
}

.neo-tenure-toggle.triple input[value="month"]:checked~.tenure-slider {
    transform: translateX(100%);
}

.neo-tenure-toggle.triple input[value="year"]:checked~.tenure-slider {
    transform: translateX(200%);
}

.neo-tenure-toggle:not(.triple) input[value="year"]:checked~.tenure-slider {
    transform: translateX(100%);
}

/* Multiselect / Scenario Filter */
.neo-filter-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.neo-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-toggle {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: normal;
    min-height: 38px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.multiselect-toggle:hover {
    border-color: rgba(255, 204, 51, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 204, 51, 0.1);
}

.multiselect-toggle.open {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 204, 51, 0.15);
}

.multiselect-content {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 440px;
    background: #0a0612;
    border: 1px solid rgba(255, 204, 51, 0.3);
    border-radius: 8px;
    margin-top: 0;
    padding: 0;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    overflow: visible;
}

.multiselect-content.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.multiselect-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.multiselect-action-btn {
    flex: 1;
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 51, 0.35);
    background: rgba(255, 204, 51, 0.08);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multiselect-action-btn:hover {
    background: rgba(255, 204, 51, 0.18);
    border-color: rgba(255, 204, 51, 0.65);
}

.multiselect-action-btn.danger {
    border-color: rgba(255, 77, 77, 0.35);
    background: rgba(255, 77, 77, 0.08);
    color: #ff7a7a;
}

.multiselect-action-btn.danger:hover {
    background: rgba(255, 77, 77, 0.16);
    border-color: rgba(255, 77, 77, 0.6);
}

.check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none !important;
    margin-bottom: 0 !important;
    min-height: 36px;
    box-sizing: border-box;
    display: flex !important;
    width: 100%;
}

.check-item-main {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    flex: 1;
}

.check-item-title {
    min-width: 0;
}

.check-item:hover {
    background: var(--primary);
}

.check-item:hover .check-item-title {
    color: #1a0b2e;
    font-weight: 700;
}

.check-item input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border: 1px solid rgba(255, 204, 51, 0.5) !important;
    border-radius: 4px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    position: relative;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.check-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #1a0b2e;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.check-item:hover input[type="checkbox"] {
    border-color: #1a0b2e !important;
}

.check-item:hover input[type="checkbox"]:checked::after {
    border-color: #1a0b2e;
}

.check-item span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.check-item-help {
    width: 19px;
    height: 19px;
    min-width: 19px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 204, 51, 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.check-item-help:hover {
    background: rgba(255, 204, 51, 0.2);
    border-color: rgba(255, 204, 51, 0.7);
    color: #1a0b2e;
}

.check-item:hover .check-item-help {
    background: rgba(26, 11, 46, 0.16);
    border-color: rgba(26, 11, 46, 0.35);
    color: #1a0b2e;
}

.check-item-help[data-tooltip]::after {
    left: auto;
    right: calc(100% + 10px);
    bottom: 50%;
    transform: translateY(50%) translateX(8px);
}

.check-item-help[data-tooltip]::before {
    left: auto;
    right: calc(100% - 2px);
    bottom: 50%;
    transform: translateY(50%) translateX(8px);
    border-width: 6px;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.95);
}

.check-item-help[data-tooltip]:hover::after,
.check-item-help[data-tooltip]:hover::before {
    transform: translateY(50%) translateX(0);
}

.compare-set-heading {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
}

.compare-set-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.7rem;
    margin-bottom: 0.9rem;
}

.compare-set-clear-btn {
    background: none;
    border: 1px solid rgba(255, 77, 77, 0.22);
    color: #ff6b6b;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.38rem 0.65rem;
    border-radius: 7px;
    transition: all 0.2s ease;
}

.compare-set-clear-btn:hover {
    background: rgba(255, 77, 77, 0.1);
    color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.16);
}

.multiselect-toggle .select-arrow {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: all 0.3s ease;
    margin-bottom: 3px;
    opacity: 0.5;
}

.multiselect-toggle.open .select-arrow {
    transform: rotate(-135deg);
    margin-bottom: -3px;
    border-color: var(--primary);
    opacity: 1;
}

.check-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0;
    grid-column: span 3;
}

#clear-all-scenarios:hover {
    background: rgba(255, 77, 77, 0.1) !important;
    color: #ff3333 !important;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
}

/* Inputs & Form Style */
.neo-field {
    margin-bottom: 1.5rem;
    /* Increased spacing between fields */
    overflow: visible !important;
}

.neo-field > label,
.neo-label-row label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.4;
}

.neo-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.neo-label-row label {
    margin-bottom: 0 !important;
}

.neo-input-panel .neo-label-row {
    gap: 0.35rem;
}

.neo-input-panel {
    --panel-toggle-unit-width: 3rem;
}

.neo-input-panel .neo-label-row > label {
    flex: 1 1 auto;
    min-width: 0;
}

.neo-input-panel .neo-tenure-toggle,
.neo-input-panel .neo-repayment-toggle,
.neo-input-panel .neo-period-toggle,
.neo-input-panel .neo-fee-toggle {
    flex-shrink: 0;
    width: auto;
}

.neo-input-panel .neo-tenure-toggle.triple {
    width: calc(var(--panel-toggle-unit-width) * 3 + 4px);
}

.neo-input-panel .neo-repayment-toggle {
    width: calc(var(--panel-toggle-unit-width) * 2 + 4px);
}

.neo-input-panel .neo-period-toggle,
.neo-input-panel .neo-fee-toggle {
    width: calc(var(--panel-toggle-unit-width) * 2 + 4px);
}

.neo-input-panel .neo-tenure-toggle label,
.neo-input-panel .neo-repayment-toggle label,
.neo-input-panel .neo-period-toggle label,
.neo-input-panel .neo-fee-toggle label {
    width: var(--panel-toggle-unit-width);
    box-sizing: border-box;
    padding: 0.28rem 0.14rem;
    font-size: 0.56rem;
    letter-spacing: 0.03em;
    min-width: 0;
}

input:not([type="checkbox"]),
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 0.6rem 0.9rem !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

select option {
    background: #1a0b2e;
    color: #fff;
    padding: 10px;
}

input:hover,
select:hover {
    border-color: rgba(255, 204, 51, 0.4) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 0 15px rgba(255, 204, 51, 0.1) !important;
}

input:focus,
select:focus {
    border-color: var(--primary) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 0 20px rgba(255, 204, 51, 0.15) !important;
    outline: none;
}

/* Custom Dropdown Styling - Theme Matched Version */
.neo-custom-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.preset-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.preset-panel-title {
    margin: 0;
    font-size: 0.62rem;
    color: var(--text-dim);
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.preset-status-toggle {
    transform: scale(0.88);
    transform-origin: right center;
}

.dropdown-trigger {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: normal;
    min-height: 38px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.current-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.dropdown-trigger:hover {
    border-color: rgba(255, 204, 51, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 204, 51, 0.1);
}

.dropdown-trigger:hover .select-arrow {
    opacity: 1;
}

.neo-custom-dropdown.open .dropdown-trigger {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 204, 51, 0.15);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #0a0612;
    border: 1px solid rgba(255, 204, 51, 0.3);
    border-radius: 8px;
    z-index: 1000;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: rgba(255, 204, 51, 0.78);
    border-radius: 999px;
}

.dropdown-options {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 204, 51, 0.78) rgba(255, 255, 255, 0.04);
}

.dropdown-section-label {
    color: var(--gold) !important;
    padding: 0.55rem 1rem 0.25rem !important;
}

.neo-custom-dropdown.open .dropdown-options {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

.dropdown-item {
    padding: 0.6rem 0.9rem 0.6rem 1.45rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background: var(--primary);
    color: #1a0b2e;
    font-weight: 700;
}

.dropdown-item.active {
    background: rgba(255, 204, 51, 0.15);
    color: var(--primary);
    font-weight: 700;
}

.dropdown-search-shell {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.55rem;
    background: #0a0612;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-search-input {
    width: 100%;
    min-height: 34px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    outline: none;
}

.dropdown-search-input:focus {
    border-color: rgba(255, 204, 51, 0.5);
    box-shadow: 0 0 16px rgba(255, 204, 51, 0.12);
}

.dropdown-search-empty {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    text-align: center;
}

.dropdown-options.is-search-empty .dropdown-search-empty {
    display: flex;
}

.dropdown-trigger .select-arrow {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: all 0.3s ease;
    margin-bottom: 3px;
    opacity: 0.5;
}

.neo-custom-dropdown.open .select-arrow {
    transform: rotate(-135deg);
    margin-bottom: -3px;
    border-color: var(--primary);
    opacity: 1;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.neo-btn-submit {
    width: 100%;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    margin-top: 1.2rem;
    transition: all 0.3s ease;
}

.neo-btn-submit:hover {
    background: var(--primary);
    color: #1a0b2e;
    box-shadow: 0 0 30px rgba(255, 204, 51, 0.4);
    transform: translateY(-2px);
}
