.rebalance2-page {
    background: #111a3c;
    color: #c2c7d6;
}

.rebalance2-shell {
    width: min(1500px, 96vw);
    margin: 0.35rem auto 0.8rem;
}

.rebalance2-header {
    text-align: center;
    margin-bottom: 0.45rem;
}

.rebalance2-overline {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.22rem;
    opacity: 0.7;
}

.rebalance2-header h1 {
    color: #fff;
    font-size: 1.28rem;
    margin: 0.25rem 0 0.1rem;
}

.rebalance2-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(194, 199, 214, 0.9);
}

.rebalance2-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(62px, 5.25rem) minmax(0, 0.95fr) minmax(62px, 5.25rem) minmax(0, 0.95fr);
    gap: 0.7rem;
    align-items: start;
}

.rebalance2-col-left,
.rebalance2-col-right {
    display: grid;
    gap: 0.7rem;
}

.reb2-or-divider {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.08rem;
    color: rgba(194, 199, 214, 0.92);
    text-transform: uppercase;
    padding: 0.1rem 0;
}

.reb2-plan-flow {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.reb2-plan-flow.reb2-amount-first #reb2CashBlock {
    order: 1;
}

.reb2-plan-flow.reb2-amount-first #reb2OrDivider {
    order: 2;
}

.reb2-plan-flow.reb2-amount-first #reb2SharesBlock {
    order: 3;
}

.reb2-plan-flow:not(.reb2-amount-first) .reb2-shares-block .reb2-plan-block-head {
    display: none;
}

.reb2-shares-block {
    padding-top: 0.1rem;
}

.reb2-assets.reb2-shares-owned-hidden .reb2-asset-table thead th:nth-child(3),
.reb2-assets.reb2-shares-owned-hidden .reb2-asset-table tbody td:nth-child(3) {
    display: none;
}

.reb2-cash-block {
    border: 1px solid rgba(57, 80, 143, 0.85);
    border-radius: 12px;
    padding: 0.62rem 0.68rem;
    background: rgba(17, 26, 60, 0.38);
}

.reb2-cash-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.25rem;
}

.reb2-step-pill {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04rem;
    text-transform: uppercase;
    color: rgba(194, 199, 214, 0.88);
}

.reb2-step-pill:empty {
    display: none;
}

.reb2-amount-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.reb2-amount-badge.reb2-amount-badge--required {
    color: #ffb8a1;
    background: rgba(180, 70, 50, 0.28);
    border-color: rgba(255, 140, 110, 0.45);
}

.reb2-amount-badge.reb2-amount-badge--optional {
    color: #9ae5d5;
    background: rgba(45, 120, 100, 0.28);
    border-color: rgba(110, 200, 175, 0.4);
}

.reb2-amount-helper {
    margin: 0 0 0.55rem;
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(194, 199, 214, 0.88);
}

.reb2-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.reb2-bridge-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    min-height: 100%;
    padding-top: clamp(180px, 30vh, 320px);
}

.reb2-track-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-height: 100%;
    padding-top: clamp(180px, 30vh, 320px);
}

.reb2-track-btn {
    opacity: 0.6;
}

.reb2-track-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.reb2-track-btn.is-ready {
    opacity: 1;
    border-color: #48bfa3;
    background: linear-gradient(180deg, #59c8ac 0%, #2d8f79 100%);
}

.rebalance2-col-right {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.reb2-bridge-btn {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    border: 1px solid #7ea6dc;
    background: linear-gradient(180deg, #6e9bd4 0%, #3a5e9a 100%);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
}

.reb2-bridge-action small,
.reb2-track-gate small {
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0.06rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.reb2-bridge-action .reb2-credit-status {
    margin-top: 0.35rem;
    font-size: 0.74rem;
    text-align: center;
    color: #c2c7d6;
    max-width: 240px;
}

.reb2-bridge-action #calculator-no-credits {
    max-width: 260px;
    font-size: 0.72rem;
    text-align: center;
    padding: 0.45rem 0.55rem;
}

.reb2-card {
    background: linear-gradient(180deg, #243368 0%, #1c2957 100%);
    border: 1px solid #39508f;
    border-radius: 16px;
    overflow: hidden;
}

.reb2-panel-locked {
    position: relative;
}

.reb2-panel-locked .reb2-card-head,
.reb2-panel-locked .reb2-card-body {
    filter: blur(4px);
    opacity: 0.45;
}

.reb2-panel-locked::after {
    content: "Run rebalancing to see results";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #c2c7d6;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02rem;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.75s ease;
}

#reb2CenterPanel::after,
#reb2SuggestionsPanel::after,
#reb2SummaryPanel::after {
    opacity: 0;
}

#reb2CenterPanel.reb2-panel-locked::after,
#reb2SuggestionsPanel.reb2-panel-locked::after,
#reb2SummaryPanel.reb2-panel-locked::after {
    opacity: 1;
}

#reb2CenterPanel.reb2-panel-locked::after {
    content: "Fill SETUP and then click Plan Rebalance";
}

#rebalance2Modal #reb2CenterPanel.reb2-panel-locked::after {
    content: "Fill SETUP and then click Plan Rebalance";
}

#reb2CenterPanel.reb2-panel-ready:not(.reb2-panel-locked) {
    box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.55);
}

#reb2CenterPanel.reb2-panel-ready:not(.reb2-panel-locked) .reb2-card-head {
    background: linear-gradient(90deg, rgba(110, 168, 254, 0.35), rgba(36, 51, 104, 0.9));
}

#reb2SuggestionsPanel.reb2-panel-locked::after,
#reb2SummaryPanel.reb2-panel-locked::after {
    content: "Run Rebalance to see results";
}

#reb2SuggestionsPanel.reb2-panel-needs-login.reb2-panel-locked::after {
    content: none;
}

#reb2SuggestionsPanel {
    position: relative;
}

.reb2-track-login-gate {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
    padding: 1.25rem;
    background: rgba(17, 26, 60, 0.92);
    border-radius: 0 0 10px 10px;
    pointer-events: auto;
}

.reb2-track-login-gate-text {
    margin: 0;
    max-width: 16rem;
    color: rgba(194, 199, 214, 0.95);
    font-size: 0.8rem;
    line-height: 1.45;
    font-weight: 600;
}

.reb2-card-head {
    background: #2a3d77;
    color: #fff;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.12rem;
    font-weight: 700;
    padding: 0.56rem 0.8rem;
    border-bottom: 1px solid #2b3a72;
    transition: filter 0.75s ease, opacity 0.75s ease;
}

.reb2-card-head-track {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.reb2-card-head-track .reb2-card-head-title {
    grid-column: 2;
}

.reb2-card-head-track .reb2-setup-wizard-btn {
    grid-column: 1;
    justify-self: start;
    flex-shrink: 0;
}

.reb2-card-head-track .reb2-panel-tutorial-btn {
    grid-column: 3;
    justify-self: end;
}

.reb2-card-head-spacer {
    grid-column: 1;
}

.reb2-panel-tutorial-btn {
    font-size: 0.72rem;
    letter-spacing: 0;
    font-weight: 600;
    white-space: nowrap;
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
    color: var(--darkblue) !important;
}

.reb2-panel-tutorial-btn:hover,
.reb2-panel-tutorial-btn:focus-visible {
    background-color: #e6c200 !important;
    border-color: #e6c200 !important;
    color: var(--darkblue) !important;
}

.reb2-setup-wizard-btn {
    font-size: 0.72rem;
    letter-spacing: 0;
    font-weight: 600;
    white-space: nowrap;
}

.reb2-card-body {
    padding: 0.72rem 0.76rem;
    transition: filter 0.75s ease, opacity 0.75s ease;
}

.reb2-card-tall .reb2-card-body {
    min-height: auto;
}

.reb2-card.reb2-card-tall {
    display: flex;
    flex-direction: column;
}

.reb2-plan-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.reb2-plan-panel-simulator {
    margin-top: auto;
    padding-top: 0.85rem;
}

.reb2-donut-wrap {
    display: flex;
    justify-content: center;
    margin: 0.1rem 0 0.5rem;
}

.reb2-donut-empty {
    margin: 0.2rem 0 0.8rem;
    border: 1px dashed rgba(92, 130, 190, 0.45);
    border-radius: 10px;
    text-align: center;
    font-size: 0.78rem;
    color: #8894b8;
    padding: 0.7rem;
    background: rgba(17, 26, 60, 0.35);
}

.reb2-donut {
    width: 142px;
    height: 142px;
    border-radius: 50%;
    background: conic-gradient(#5c82be 0deg 198deg, #c2c7d6 198deg 306deg, #d4a843 306deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reb2-donut-center {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #141e46;
    border: 1px solid #2b3a72;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reb2-donut-center span {
    color: #fff;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1;
}

.reb2-donut-center small {
    color: #8894b8;
    font-size: 0.66rem;
}

.reb2-legend {
    display: grid;
    gap: 0.35rem;
}

.reb2-legend-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    align-items: center;
}

.reb2-dot {
    position: relative;
    padding-left: 0.95rem;
    font-size: 0.78rem;
}

.reb2-dot::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    left: 0;
    top: 0.35rem;
}

.reb2-dot.stock::before { background: #5c82be; }
.reb2-dot.bond::before { background: #c2c7d6; }
.reb2-dot.gold::before { background: #d4a843; }

.reb2-track {
    height: 5px;
    background: #182044;
    border-radius: 999px;
}

.reb2-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.reb2-fill.stock { background: #5c82be; }
.reb2-fill.bond { background: #c2c7d6; }
.reb2-fill.gold { background: #d4a843; }

.reb2-legend-row strong {
    color: #fff;
    font-size: 0.82rem;
}

.reb2-portfolio-value {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #2b3a72;
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}

.reb2-portfolio-value strong {
    color: #5c82be;
}

.reb2-assets {
    margin-top: 0.65rem;
    border-top: 1px solid rgba(92, 130, 190, 0.25);
    padding-top: 0.5rem;
}

.reb2-assets.reb2-assets-no-top-divider {
    margin-top: 0.35rem;
    border-top: 0;
    padding-top: 0;
}

.reb2-asset-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.35rem;
}

.reb2-asset-table thead th {
    font-size: 0.7rem;
    color: #8894b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    padding: 0 0.35rem 0.2rem;
    white-space: nowrap;
}

.reb2-asset-table thead th:first-child,
.reb2-asset-table tbody td:first-child {
    width: 0.5rem;
    min-width: 0.5rem;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
}

.reb2-asset-table thead th:nth-child(3) {
    width: 84px;
    min-width: 84px;
    max-width: 84px;
}

.reb2-asset-table tbody tr {
    border: 1px solid rgba(43, 58, 114, 0.9);
}

.reb2-asset-table tbody td:nth-child(2) {
    width: auto;
    min-width: 12rem;
    padding-bottom: 0.4rem;
}

.reb2-assets.reb2-shares-owned-hidden .reb2-asset-table tbody td:nth-child(2) {
    min-width: 16rem;
}

.reb2-asset-table tbody td {
    padding: 0.4rem 0.35rem;
    vertical-align: top;
    background: #1f2d5f;
}

.reb2-asset-table tbody td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.reb2-asset-table tbody td:last-child {
    width: 84px;
    min-width: 84px;
    max-width: 84px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.reb2-asset-name {
    white-space: nowrap;
    color: #e6ebfa;
    font-size: 0.96rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02rem;
    line-height: 1.2;
}

.reb2-asset-table tr.tickersSTOCK .reb2-asset-name {
    color: #7ea6dc;
}

.reb2-asset-table tr.tickersBOND .reb2-asset-name {
    color: #c2c7d6;
}

.reb2-asset-table tr.tickersGOLD .reb2-asset-name {
    color: #d4a843;
}

.reb2-ticker-cell,
.reb2-ticker-cell.input-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.reb2-ticker-cell .input-param-box {
    display: flex;
    align-items: center;
    border: 1px solid #000;
    border-radius: 6px;
    background-color: #fff;
    min-height: 36px;
    height: auto;
    overflow: visible;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.reb2-ticker-cell .input-param-box .asset-icon {
    color: #fff !important;
    height: 34px !important;
    width: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    border-right: 1px solid #000;
    flex-shrink: 0;
}

.reb2-ticker-cell .input-param-box .asset-icon-stock {
    background-color: var(--asset-stock-color) !important;
}

.reb2-ticker-cell .input-param-box .asset-icon-bond {
    background-color: var(--asset-bond-color) !important;
}

.reb2-ticker-cell .input-param-box .asset-icon-gold {
    background-color: var(--asset-gold-color) !important;
}

.reb2-ticker-cell .input-param-box label {
    font-weight: 700;
    color: #040814;
    margin: 0;
    white-space: nowrap;
    padding: 0 0.35rem;
    border-right: 1px solid #000;
    font-size: 0.74rem;
    display: flex;
    align-items: center;
    min-width: 64px;
    width: 64px;
    justify-content: center;
    flex-shrink: 0;
    height: 100%;
}

.reb2-ticker-cell .input-param-box .asset-selector-input {
    border: none;
    border-radius: 0;
    background: transparent;
    color: #0b122e;
    min-height: 34px;
    padding: 0.2rem 0.45rem;
    min-width: 6.5rem;
    flex: 1 1 auto;
    position: relative;
    overflow: visible;
    box-shadow: none;
}

.reb2-ticker-cell .asset-selector-input .reb2-ticker-value-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    width: auto;
    max-width: none;
    overflow: visible;
}

.reb2-asset-table tr.tickersSTOCK .reb2-ticker-cell .input-param-box,
.reb2-asset-table tr.tickersBOND .reb2-ticker-cell .input-param-box,
.reb2-asset-table tr.tickersGOLD .reb2-ticker-cell .input-param-box {
    overflow: visible;
}

.reb2-ticker-cell .asset-selector-input .ticker-display-text {
    flex: 0 0 auto !important;
    display: inline-block;
    min-width: 0;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    color: #0b122e;
    font-weight: 600;
    vertical-align: middle;
}

.reb2-ticker-cell .asset-selector-input .ticker-status-badge {
    position: static !important;
    top: auto !important;
    left: auto !important;
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    pointer-events: auto;
}

.reb2-ticker-cell .asset-selector-input .ticker-status-badge .badge.lessoptimal {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.01rem;
    margin: 0 !important;
    line-height: 1.2;
    display: inline-block;
    cursor: help;
    pointer-events: auto;
    white-space: nowrap;
}

.reb2-ticker-cell .btn {
    border: 1px solid #000;
    color: #0b122e;
    background: #f8f9fa;
    border-radius: 6px;
    min-height: 36px;
    min-width: 36px;
    flex: 0 0 36px;
}

.reb2-ticker-cell .btn:hover {
    background: #edf1f5;
    color: #0b122e;
    border-color: #000;
}

.reb2-shares-input {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    margin-left: auto;
    text-align: right;
    background: #fff;
    color: #0b122e;
    border: 1px solid #000;
    border-radius: 6px;
    min-height: 36px;
}

.reb2-shares-input:focus {
    border-color: #2b3a72;
    box-shadow: 0 0 0 0.12rem rgba(43, 58, 114, 0.2);
}

.reb2-shares-input:disabled {
    background: #dfe7f7;
    color: #0b122e;
    -webkit-text-fill-color: #0b122e;
    opacity: 1;
    border-color: #5b6e9f;
    font-weight: 600;
}

.reb2-operation-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.reb2-toggle-btn {
    border: 1px solid #2b3a72;
    background: #182044;
    color: #8894b8;
    border-radius: 8px;
    padding: 0.42rem 0.4rem;
    font-size: 0.8rem;
}

.reb2-toggle-btn.active {
    background: #5c82be;
    color: #fff;
}

.reb2-amount-row {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 0.4rem;
    align-items: stretch;
}

.reb2-step-btn {
    border: 1px solid #2b3a72;
    background: #182044;
    color: #c2c7d6;
    border-radius: 8px;
    font-size: 1.35rem;
    line-height: 1;
}

.reb2-step-btn.plus {
    background: rgba(92, 130, 190, 0.85);
    color: #fff;
}

.reb2-amount-box {
    border: 1px solid #2b3a72;
    border-radius: 8px;
    background: #111a3c;
    text-align: center;
    padding: 0.34rem 0.44rem;
}

.reb2-amount-box small {
    display: block;
    font-size: 0.65rem;
    color: #8894b8;
}

.reb2-amount-box input {
    width: 100%;
    border: none;
    background: transparent;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.reb2-amount-box input:focus {
    outline: none;
}

.reb2-presets {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.48rem;
    flex-wrap: wrap;
}

.reb2-preset {
    border: 1px solid #2b3a72;
    background: #182044;
    color: #8894b8;
    border-radius: 6px;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.reb2-preset.active {
    border-color: #5c82be;
    color: #5c82be;
    background: rgba(92, 130, 190, 0.12);
}

.reb2-note {
    margin: 0.42rem 0 0;
    text-align: center;
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-note.muted {
    color: #5b6690;
}

.reb2-overview-legend {
    display: flex;
    gap: 0.8rem;
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-overview-legend .dot {
    display: inline-block;
    width: 14px;
    height: 5px;
    border-radius: 99px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.reb2-overview-legend .current { background: #5c82be; }
.reb2-overview-legend .target { border: 1px solid #c2c7d6; }

.reb2-overview-row {
    margin-top: 0.52rem;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.reb2-overview-row > span {
    color: #c2c7d6;
    font-size: 0.84rem;
}

.reb2-overview-row.asset-stock > span { color: #7ea6dc; }
.reb2-overview-row.asset-bond > span { color: #c2c7d6; }
.reb2-overview-row.asset-gold > span { color: #d4a843; }

.reb2-overview-bars .bar-base {
    height: 8px;
    border-radius: 999px;
    background: #182044;
    overflow: hidden;
}

.reb2-overview-bars .bar-base.target {
    margin-top: 4px;
    height: 5px;
}

.bar-current, .bar-target {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.2s ease;
}

.bar-current.stock { background: linear-gradient(90deg, #5c82be, #7ea6dc); }
.bar-current.bond { background: linear-gradient(90deg, #8899bc, #c2c7d6); }
.bar-current.gold { background: linear-gradient(90deg, #c9982c, #e0b94a); }
.bar-target { background: rgba(194, 199, 214, 0.35); }
.bar-target.stock { background: rgba(92, 130, 190, 0.45); }
.bar-target.bond { background: rgba(194, 199, 214, 0.45); }
.bar-target.gold { background: rgba(212, 168, 67, 0.45); }

.reb2-overview-row strong {
    min-width: 44px;
    text-align: right;
    font-size: 0.86rem;
}

.reb2-overview-row strong.pos { color: #48bfa3; }
.reb2-overview-row strong.neg { color: #dc7070; }
.reb2-overview-row strong.neutral { color: #8894b8; }
.reb2-overview-row.asset-stock strong.neutral { color: #7ea6dc; }
.reb2-overview-row.asset-bond strong.neutral { color: #c2c7d6; }
.reb2-overview-row.asset-gold strong.neutral { color: #d4a843; }

.reb2-card hr {
    border-color: #2b3a72;
    opacity: 1;
    margin: 0.68rem 0;
}

.reb2-section-title {
    margin: 0;
    font-size: 0.8rem;
    color: #fff;
    letter-spacing: 0.06rem;
}

.reb2-risk-slider-wrap {
    margin-top: 0.45rem;
}

.reb2-risk-slider {
    width: 100%;
    height: 10px;
    appearance: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #48bfa3 0%, #5c82be 50%, #dc7070 100%);
    outline: none;
    border: 1px solid #2b3a72;
}

.reb2-risk-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1b2b62;
    border: 2px solid #5c82be;
    cursor: pointer;
}

.reb2-risk-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1b2b62;
    border: 2px solid #5c82be;
    cursor: pointer;
}

.reb2-risk-scale {
    margin-top: 0.3rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
}

.reb2-risk-scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.08rem;
    text-align: center;
    line-height: 1.15;
    opacity: 0.72;
    transition: opacity 0.15s ease, font-weight 0.15s ease;
}

.reb2-risk-scale-item strong {
    font-weight: 600;
}

.reb2-risk-scale-item small {
    font-size: 0.68rem;
    font-weight: 500;
}

.reb2-risk-scale-item.active {
    opacity: 1;
}

.reb2-risk-scale-item.active strong {
    font-weight: 800;
}

.reb2-risk-scale-item:first-child {
    color: #48bfa3;
}

.reb2-risk-scale-item:nth-child(2) {
    color: #5c82be;
}

.reb2-risk-scale-item:last-child {
    color: #dc7070;
}

.reb2-risk-description {
    margin: 0.38rem 0 0;
    border: 1px solid #2b3a72;
    background: #182044;
    border-radius: 8px;
    text-align: center;
    padding: 0.45rem;
    font-size: 0.74rem;
    color: #fff;
}

.reb2-horizon {
    margin-top: 0.42rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.reb2-compare-donuts {
    margin-top: 0.45rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.reb2-mini-donut-card {
    border: 1px solid #2b3a72;
    border-radius: 8px;
    background: #182044;
    padding: 0.35rem 0.3rem;
    text-align: center;
}

.reb2-mini-donut-card.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.reb2-mini-donut-card small {
    display: block;
    color: #c2c7d6;
    font-size: 0.65rem;
    letter-spacing: 0.03rem;
    text-transform: uppercase;
}

.reb2-mini-donut-card span {
    display: block;
    color: #8894b8;
    font-size: 0.62rem;
    margin-top: 0.18rem;
}

.reb2-mini-donut {
    width: 64px;
    height: 64px;
    margin: 0.26rem auto 0;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(#5c82be 0deg 198deg, #c2c7d6 198deg 306deg, #d4a843 306deg 360deg);
}

.reb2-mini-donut::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: #141e46;
    border: 1px solid #2b3a72;
}

.reb2-donut-tooltip {
    position: absolute;
    z-index: 2000;
    background: rgba(17, 26, 60, 0.96);
    border: 1px solid #2b3a72;
    border-radius: 6px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.3rem 0.45rem;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

.reb2-horizon-btn {
    border: 1px solid #2b3a72;
    background: #182044;
    color: #8894b8;
    border-radius: 7px;
    font-size: 0.68rem;
    padding: 0.33rem 0.22rem;
}

.reb2-horizon-btn.active {
    border-color: #5c82be;
    color: #5c82be;
    background: rgba(92, 130, 190, 0.2);
    font-weight: 700;
}

.reb2-cta {
    margin-top: 0.68rem;
    width: 100%;
    border: 1px solid #5c82be;
    border-radius: 10px;
    background: linear-gradient(90deg, #3a5e9a, #2e4e82);
    color: #fff;
    padding: 0.52rem;
}

.reb2-cta span {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}

.reb2-cta small {
    color: #7ea6dc;
}

.reb2-cta-plan {
    margin-top: 0.55rem;
}

.reb2-quick-modal {
    --qc-stock: #5c82be;
    --qc-stock-soft: rgba(92, 130, 190, 0.22);
    --qc-stock-muted: #9ec5f5;
    --qc-bond: #7c93c8;
    --qc-bond-soft: rgba(124, 147, 200, 0.18);
    --qc-bond-muted: #c2c7d6;
    --qc-gold: #ffd10a;
    --qc-gold-soft: rgba(255, 209, 10, 0.18);
    --qc-gold-muted: #f0d56a;
    background: #111a3c;
    color: #c2c7d6;
    border: 1px solid #2b3a72;
}

.reb2-quick-modal .modal-header {
    position: relative;
    border-bottom: 1px solid #2b3a72;
    padding-right: 2.75rem;
}

.reb2-quick-modal .modal-title {
    color: #fff;
}

.reb2-quick-modal .btn-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    margin: 0;
    opacity: 0.9;
    z-index: 2;
}

.reb2-quick-modal .btn-close:hover,
.reb2-quick-modal .btn-close:focus {
    opacity: 1;
}

/* Quick Compare — above wizard (1170) and its backdrop (1160) */
#reb2QuickCompareModal.show,
#reb2QuickCompareModal.cw-qc-over-wizard.show {
    z-index: 1200 !important;
    pointer-events: auto !important;
}

#reb2QuickCompareModal.show .modal-dialog,
#reb2QuickCompareModal.cw-qc-over-wizard.show .modal-dialog {
    position: relative;
    z-index: 1201 !important;
    pointer-events: auto !important;
}

#reb2QuickCompareModal.show .modal-content,
#reb2QuickCompareModal.cw-qc-over-wizard.show .modal-content {
    position: relative;
    z-index: 1202 !important;
    pointer-events: auto !important;
}

.modal-backdrop.qc-over-wizard-backdrop {
    z-index: 1195 !important;
}

.reb2-quick-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: end;
    margin-bottom: 0.7rem;
}

.reb2-quick-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.reb2-quick-field label {
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-quick-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Browse panel: class tabs + ticker list */
.reb2-quick-browse {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.5rem;
}

.reb2-quick-class-tabs {
    display: flex;
    gap: 0;
    border-bottom: none;
}

.reb2-quick-class-tab {
    flex: 1;
    padding: 0.45rem 0.5rem;
    background: #182044;
    border: 1px solid #2b3a72;
    border-bottom: none;
    color: #8894b8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    border-radius: 0;
    position: relative;
    isolation: isolate;
}

.reb2-quick-class-tab i {
    margin-right: 0.25rem;
    opacity: 0.92;
}

.reb2-quick-class-tab:first-child { border-radius: 6px 0 0 0; }
.reb2-quick-class-tab:last-child  { border-radius: 0 6px 0 0; }

.reb2-quick-class-tab[data-class="STOCK"] {
    background: linear-gradient(180deg, rgba(92, 130, 190, 0.28), rgba(24, 32, 68, 0.95));
    border-top: 3px solid var(--qc-stock);
    color: var(--qc-stock-muted);
}

.reb2-quick-class-tab[data-class="STOCK"] i {
    color: var(--qc-stock);
}

.reb2-quick-class-tab[data-class="BOND"] {
    background: linear-gradient(180deg, rgba(124, 147, 200, 0.22), rgba(16, 24, 52, 0.96));
    border-top: 3px solid var(--qc-bond);
    color: var(--qc-bond-muted);
}

.reb2-quick-class-tab[data-class="BOND"] i {
    color: var(--qc-bond);
}

.reb2-quick-class-tab[data-class="GOLD"] {
    background: linear-gradient(180deg, rgba(255, 209, 10, 0.2), rgba(42, 34, 8, 0.92));
    border-top: 3px solid var(--qc-gold);
    color: var(--qc-gold-muted);
}

.reb2-quick-class-tab[data-class="GOLD"] i {
    color: var(--qc-gold);
}

.reb2-quick-class-tab:hover {
    filter: brightness(1.08);
}

.reb2-quick-class-tab.active {
    border-bottom-color: transparent;
    z-index: 1;
}

.reb2-quick-class-tab.active::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -3px;
    height: 3px;
    border-radius: 999px;
    z-index: 2;
}

.reb2-quick-class-tab[data-class="STOCK"].active {
    background: linear-gradient(180deg, rgba(92, 130, 190, 0.72), rgba(45, 68, 113, 0.98));
    border-color: rgba(92, 130, 190, 0.95);
    box-shadow: inset 0 0 0 1px rgba(92, 130, 190, 0.35), 0 0 0 1px rgba(92, 130, 190, 0.25);
    color: #eef4ff;
    text-shadow: 0 0 12px rgba(92, 130, 190, 0.45);
}

.reb2-quick-class-tab[data-class="STOCK"].active i {
    color: #cfe0ff;
}

.reb2-quick-class-tab[data-class="BOND"].active {
    background: linear-gradient(180deg, rgba(124, 147, 200, 0.62), rgba(20, 31, 68, 0.98));
    border-color: rgba(124, 147, 200, 0.85);
    box-shadow: inset 0 0 0 1px rgba(124, 147, 200, 0.3), 0 0 0 1px rgba(124, 147, 200, 0.2);
    color: #eef1f8;
    text-shadow: 0 0 10px rgba(124, 147, 200, 0.35);
}

.reb2-quick-class-tab[data-class="BOND"].active i {
    color: #dce4f5;
}

.reb2-quick-class-tab[data-class="GOLD"].active {
    background: linear-gradient(180deg, rgba(255, 209, 10, 0.58), rgba(86, 70, 12, 0.98));
    border-color: rgba(255, 209, 10, 0.95);
    box-shadow: inset 0 0 0 1px rgba(255, 209, 10, 0.35), 0 0 0 1px rgba(255, 209, 10, 0.22);
    color: #fff7d1;
    text-shadow: 0 0 10px rgba(255, 209, 10, 0.35);
}

.reb2-quick-class-tab[data-class="GOLD"].active i {
    color: #fff3b0;
}

.reb2-quick-class-tab[data-class="STOCK"].active::after {
    background: var(--qc-stock);
}

.reb2-quick-class-tab[data-class="BOND"].active::after {
    background: var(--qc-bond);
}

.reb2-quick-class-tab[data-class="GOLD"].active::after {
    background: var(--qc-gold);
}

.reb2-quick-ticker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow: auto;
    padding: 0.35rem;
    background: rgba(24, 32, 68, 0.55);
    border: 1px solid #2b3a72;
    border-radius: 0 0 8px 8px;
    transition: background 0.2s, border-color 0.2s;
}

.reb2-quick-browse[data-active-class="STOCK"] .reb2-quick-ticker-list {
    background: linear-gradient(180deg, rgba(92, 130, 190, 0.14), rgba(24, 32, 68, 0.72));
    border-color: rgba(92, 130, 190, 0.45);
}

.reb2-quick-browse[data-active-class="BOND"] .reb2-quick-ticker-list {
    background: linear-gradient(180deg, rgba(124, 147, 200, 0.12), rgba(16, 24, 52, 0.78));
    border-color: rgba(124, 147, 200, 0.4);
}

.reb2-quick-browse[data-active-class="GOLD"] .reb2-quick-ticker-list {
    background: linear-gradient(180deg, rgba(255, 209, 10, 0.1), rgba(42, 34, 8, 0.78));
    border-color: rgba(255, 209, 10, 0.38);
}

.reb2-quick-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.reb2-quick-group-title {
    font-size: 0.72rem;
    color: #7ea6dc;
    font-weight: 700;
    letter-spacing: 0.02rem;
}

.reb2-quick-group-market-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.64rem;
    line-height: 1.1;
    font-weight: 700;
    white-space: nowrap;
}

.reb2-quick-group-market-pill-milan {
    color: #0c5b2f;
    background: #e8f6ee;
    border-color: #b9e5cb;
}

.reb2-quick-group-market-pill-frankfurt {
    color: #7a2400;
    background: #fff1ea;
    border-color: #ffd1bf;
}

.reb2-quick-group-market-pill-paris {
    color: #2b3f91;
    background: #eef2ff;
    border-color: #ccd7ff;
}

.reb2-quick-group-market-pill-amsterdam {
    color: #005b73;
    background: #e8f8fc;
    border-color: #bde9f4;
}

.reb2-quick-group-market-pill-default {
    color: #394a6d;
    background: #eef1f7;
    border-color: #d7dfed;
}

.reb2-quick-group-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

/* Clickable ticker card */
.reb2-quick-ticker-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.1rem 0.35rem;
    align-items: center;
    border: 1px solid #000;
    border-left: 4px solid transparent;
    border-radius: 6px;
    padding: 0.28rem 0.4rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
    user-select: none;
}

.reb2-quick-ticker-card[data-asset-class="STOCK"] {
    border-left-color: var(--asset-stock-color, #5c82be);
}

.reb2-quick-ticker-card[data-asset-class="BOND"] {
    border-left-color: var(--asset-bond-color, #0b122e);
}

.reb2-quick-ticker-card[data-asset-class="GOLD"] {
    border-left-color: var(--asset-gold-color, #d4a843);
}

.reb2-quick-ticker-card:hover {
    border-color: #000;
    background: #f4f6fb;
}

.reb2-quick-ticker-card.selected {
    border-color: #000;
    background: #eaf1ff;
    box-shadow: inset 0 0 0 1px rgba(92, 130, 190, 0.3);
}

.reb2-quick-ticker-card.selected:hover {
    background: #e1ebff;
    transform: translateY(-1px);
}

.reb2-quick-ticker-card.selected[data-asset-class="BOND"] {
    background: #eef1f8;
    box-shadow: inset 0 0 0 1px rgba(11, 18, 46, 0.22);
}

.reb2-quick-ticker-card.selected[data-asset-class="BOND"]:hover {
    background: #e7ecf7;
}

.reb2-quick-ticker-card.selected[data-asset-class="GOLD"] {
    background: #fff8e8;
    box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35);
}

.reb2-quick-ticker-card.selected[data-asset-class="GOLD"]:hover {
    background: #fff2d8;
}

.reb2-qtc-ticker {
    color: #0b122e;
    font-size: 0.78rem;
    font-weight: 600;
    grid-column: 1;
    grid-row: 1;
}

.reb2-qtc-name {
    color: #4b587f;
    font-size: 0.65rem;
    line-height: 1.1;
    grid-column: 1;
    grid-row: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reb2-qtc-market-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    margin-left: 0.2rem;
    padding: 0.01rem 0.24rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.54rem;
    line-height: 1.05;
    font-weight: 700;
    vertical-align: baseline;
    white-space: nowrap;
}

.reb2-qtc-market-pill-milan {
    color: #0c5b2f;
    background: #e8f6ee;
    border-color: #b9e5cb;
}

.reb2-qtc-market-pill-frankfurt {
    color: #7a2400;
    background: #fff1ea;
    border-color: #ffd1bf;
}

.reb2-qtc-market-pill-paris {
    color: #2b3f91;
    background: #eef2ff;
    border-color: #ccd7ff;
}

.reb2-qtc-market-pill-amsterdam {
    color: #005b73;
    background: #e8f8fc;
    border-color: #bde9f4;
}

.reb2-qtc-market-pill-default {
    color: #394a6d;
    background: #eef1f7;
    border-color: #d7dfed;
}

.reb2-quick-ticker-card.selected .reb2-qtc-name {
    color: #21355f;
}

.reb2-qtc-icon {
    grid-column: 2;
    grid-row: 1 / 3;
    font-size: 0.65rem;
    color: #4b587f;
    transition: color 0.15s, background 0.15s;
}

.reb2-quick-ticker-card.selected .reb2-qtc-icon {
    color: #fff;
    background: rgba(92, 130, 190, 0.7);
    border-radius: 999px;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reb2-quick-empty {
    color: #8894b8;
    font-size: 0.78rem;
    padding: 0.35rem;
}

/* Selected assets panel */
.reb2-quick-selected-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    background: rgba(24, 32, 68, 0.55);
    border: 1px solid #2b3a72;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    min-height: 2.6rem;
}

.reb2-quick-selected-label {
    font-size: 0.72rem;
    color: #7ea6dc;
    font-weight: 700;
    white-space: nowrap;
    padding-top: 0.2rem;
}

.reb2-quick-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
}

.reb2-quick-no-selection {
    font-size: 0.75rem;
    color: #8894b8;
    font-style: italic;
}

.reb2-quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.35rem 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    background: rgba(43, 58, 114, 0.7);
    border: 1px solid #2b3a72;
    color: #c2c7d6;
}

.reb2-pill-class {
    font-size: 0.63rem;
    font-weight: 700;
    opacity: 0.75;
    letter-spacing: 0.03rem;
}

.reb2-pill-ticker {
    color: #fff;
}

.reb2-pill-remove {
    background: none;
    border: none;
    color: #8894b8;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.1rem;
    cursor: pointer;
    transition: color 0.12s;
    display: flex;
    align-items: center;
}

.reb2-pill-remove:hover {
    color: #ffd0d0;
}

/* Per-class pill accent colors */
.reb2-quick-pill-stock { border-color: rgba(92, 130, 190, 0.6); }
.reb2-quick-pill-bond  { border-color: rgba(72, 187, 140, 0.6); }
.reb2-quick-pill-gold  { border-color: rgba(240, 185, 60, 0.6); }

.reb2-quick-pill-stock .reb2-pill-class { color: #7ea6dc; }
.reb2-quick-pill-bond  .reb2-pill-class { color: #48bb8c; }
.reb2-quick-pill-gold  .reb2-pill-class { color: #f0b93c; }

.reb2-quick-clear-btn {
    background: none;
    border: 1px solid rgba(212, 77, 77, 0.4);
    color: #d47070;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    align-self: flex-start;
    margin-top: 0.05rem;
}

.reb2-quick-clear-btn:hover {
    background: rgba(212, 77, 77, 0.15);
    color: #ffd0d0;
}

.reb2-quick-message {
    margin-top: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    background: rgba(92, 130, 190, 0.18);
    border: 1px solid rgba(92, 130, 190, 0.45);
    color: #c7d8f3;
    font-size: 0.76rem;
}

.reb2-quick-message.is-error {
    background: rgba(212, 77, 77, 0.18);
    border-color: rgba(212, 77, 77, 0.45);
    color: #ffd0d0;
}

.reb2-quick-chart-wrap {
    margin-top: 0.65rem;
    height: 420px;
}

.reb2-credit-status {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    text-align: center;
}

.reb2-pref-btn {
    margin-top: 0.52rem;
    width: 100%;
    border: 1px solid #2b3a72;
    background: #182044;
    color: #c2c7d6;
    border-radius: 8px;
    padding: 0.38rem;
    font-size: 0.76rem;
}

.reb2-pref-btn:disabled {
    opacity: 0.6;
}

.reb2-pref-note {
    margin: 0.28rem 0 0;
    text-align: center;
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-create-portfolio-wrap {
    display: block;
    margin: 0;
}

.reb2-create-portfolio-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    border: 1px solid #48bfa3;
    background: rgba(72, 191, 163, 0.16);
    color: #c7f3e7;
    border-radius: 8px;
    padding: 0.38rem 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.reb2-create-portfolio-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.reb2-create-portfolio-title {
    line-height: 1.15;
}

.reb2-create-portfolio-subtitle {
    font-size: 0.74rem;
    font-weight: 500;
    color: #a6d9cc;
    line-height: 1.2;
}

.reb2-suggestions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    width: 100%;
}

.reb2-suggestion-card {
    background: #182044;
    border: 1px solid #2b3a72;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 0.48rem;
    width: 100%;
    height: 100%;
}

.reb2-suggestion-card.sell { border-left-color: #dc7070; }
.reb2-suggestion-card.buy { border-left-color: #48bfa3; }
.reb2-suggestion-card.hold { border-left-color: #8894b8; }
.reb2-suggestion-card.asset-stock {
    border-left-color: #5c82be;
    box-shadow: inset 0 0 0 1px rgba(92, 130, 190, 0.22);
}

.reb2-suggestion-card.asset-bond {
    border-left-color: #c2c7d6;
    box-shadow: inset 0 0 0 1px rgba(194, 199, 214, 0.16);
}

.reb2-suggestion-card.asset-gold {
    border-left-color: #d4a843;
    box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.2);
}

.reb2-suggestion-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: start;
}

.reb2-suggestion-main strong {
    color: #fff;
    display: block;
}

.reb2-suggestion-card.asset-stock .reb2-suggestion-main strong { color: #7ea6dc; }
.reb2-suggestion-card.asset-bond .reb2-suggestion-main strong { color: #c2c7d6; }
.reb2-suggestion-card.asset-gold .reb2-suggestion-main strong { color: #d4a843; }

.reb2-suggestion-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}

.reb2-suggestion-head strong {
    color: #fff;
}

.reb2-suggestion-card.asset-stock .reb2-suggestion-head strong { color: #7ea6dc; }
.reb2-suggestion-card.asset-bond .reb2-suggestion-head strong { color: #c2c7d6; }
.reb2-suggestion-card.asset-gold .reb2-suggestion-head strong { color: #d4a843; }

.reb2-suggestion-value-wrap .value {
    font-size: 1.05rem;
    font-weight: 700;
}

.reb2-suggestion-value-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.05;
    text-align: right;
}

.reb2-suggestion-value-wrap .weight {
    margin-top: 0.08rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #a8b2cf;
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}

.reb2-suggestion-value-wrap .weight small {
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.03rem;
    text-transform: uppercase;
    color: #8894b8;
}

.reb2-suggestion-value-wrap .value.sell { color: #dc7070; }
.reb2-suggestion-value-wrap .value.buy { color: #48bfa3; }
.reb2-suggestion-value-wrap .value.hold { color: #8894b8; }

.reb2-suggestion-sub {
    margin-top: 0.18rem;
    font-size: 0.76rem;
    color: #8894b8;
}

.reb2-suggestion-sub.trade {
    font-weight: 700;
    letter-spacing: 0.01rem;
    font-size: 0.84rem;
    line-height: 1.2;
}

.reb2-suggestion-card.buy .reb2-suggestion-sub.trade { color: #48bfa3; }
.reb2-suggestion-card.sell .reb2-suggestion-sub.trade { color: #dc7070; }
.reb2-suggestion-card.hold .reb2-suggestion-sub.trade { color: #8894b8; }

.reb2-transaction-cost {
    margin-top: 0.5rem;
    border: 1px solid #2b3a72;
    border-radius: 8px;
    background: #111a3c;
    padding: 0.44rem;
    text-align: center;
}

.reb2-transaction-cost span {
    display: block;
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-transaction-cost strong {
    color: #c2c7d6;
    font-size: 0.8rem;
}

.reb2-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.reb2-summary-box {
    border-radius: 8px;
    background: #182044;
    border: 1px solid #2b3a72;
    padding: 0.5rem;
}

.reb2-summary-box small {
    font-size: 0.66rem;
    color: #8894b8;
}

.reb2-summary-box strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    margin: 0.15rem 0;
}

.reb2-summary-box.sell { border-top: 3px solid #dc7070; }
.reb2-summary-box.buy { border-top: 3px solid #48bfa3; }

.reb2-summary-box p {
    margin: 0;
    font-size: 0.72rem;
    color: #8894b8;
}

.reb2-net {
    margin-top: 0.45rem;
    border: 1px solid #2b3a72;
    border-radius: 8px;
    background: #111a3c;
    padding: 0.45rem;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
}

.reb2-net small {
    color: #8894b8;
}

.reb2-net p {
    margin: 0.1rem 0 0;
    color: #5b6690;
    font-size: 0.68rem;
}

.reb2-net strong {
    color: #fff;
    font-size: 1.3rem;
}

.reb2-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #2b3a72;
}

.reb2-mode-toggle .form-check-label {
    font-size: 0.78rem;
    color: #b0b8d8;
}

.reb2-mode-toggle .form-check-input:checked ~ .form-check-label {
    color: #fff;
}

/* Intro.js tutorial: force readable tooltip text */
.rebalance2-page .introjs-tooltip,
.rebalance2-page .introjs-tooltip * {
    color: #000 !important;
}

@media (max-width: 1023.98px) {
    .rebalance2-grid {
        grid-template-columns: 1fr;
    }
    .reb2-bridge-action,
    .reb2-track-gate {
        grid-column: 1 / -1;
        min-height: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 0;
    }

    .reb2-bridge-action small,
    .reb2-track-gate small {
        flex: 0 0 100%;
        text-align: center;
    }
    .rebalance2-col-right {
        grid-column: 1 / -1;
    }

    .reb2-suggestions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .rebalance2-grid {
        grid-template-columns: 1fr;
    }
    .reb2-card-tall .reb2-card-body {
        min-height: auto;
    }

    .reb2-quick-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .reb2-quick-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .reb2-quick-ticker-list {
        gap: 0.45rem;
    }

    .reb2-quick-group-grid {
        grid-template-columns: 1fr 1fr;
    }

    .reb2-quick-chart-wrap {
        height: 320px;
    }

    .reb2-quick-class-tab {
        font-size: 0.72rem;
        padding: 0.35rem 0.3rem;
    }

}

/* ===================================
   MODAL CONTEXT OVERRIDES
   =================================== */

/* Force padding on modal body (overrides p-0 class from HTML) */
#rebalance2Modal .modal-body {
    padding: 1.5rem !important;
}

/* Adjust shell for modal context */
.modal .rebalance2-shell-modal {
    padding: 0; /* Remove padding qui, lo gestiamo nel modal-body */
    background: var(--bg-dark);
    min-height: auto;
}

.modal #rebalance2Content {
    /* Remove page-level padding */
    padding: 0;
}

.modal .rebalance2-header {
    margin-bottom: 1.5rem;
}

.modal .rebalance2-header h1 {
    font-size: 1.75rem; /* Slightly smaller in modal */
}

/* Full-screen on mobile */
@media (max-width: 767px) {
    .reb2-ticker-cell.input-group,
    .reb2-ticker-cell {
        flex-wrap: nowrap;
    }

    .reb2-ticker-cell .input-param-box {
        min-width: 0;
        flex: 1 1 auto;
    }

    .reb2-ticker-cell .btn {
        flex: 0 0 36px;
    }

    .reb2-asset-table thead th:nth-child(3) {
        min-width: 74px;
        width: 74px;
    }

    .reb2-shares-input {
        min-width: 64px;
        max-width: 74px;
        margin-left: auto;
    }

    #rebalance2Modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    #rebalance2Modal .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    #rebalance2Modal .modal-body {
        padding: 1rem !important; /* Padding su mobile, con !important */
    }
}

/* Adaptive sizing on desktop */
@media (min-width: 768px) {
    #rebalance2Modal .modal-dialog {
        max-width: min(90vw, 2000px); /* 90% della viewport, max 2000px */
        width: 90vw;
    }
    
    #rebalance2Modal .modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding: 1.5rem !important; /* Padding su desktop, con !important */
    }
}

/* Save Transaction button styling (similar to Create Portfolio) */
#reb2SaveTransactionBtn {
    /* Inherits from .reb2-create-portfolio-btn */
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

#reb2SaveTransactionBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

#reb2SaveTransactionBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Add margin to the button wrapper for spacing inside the panel */
.modal .reb2-create-portfolio-wrap {
    margin: 1rem; /* Margine interno al pannello blu */
}

/* Fix bridge label visibility in modal */
#rebalance2Modal .reb2-bridge-action small,
#rebalance2Modal .reb2-track-gate small {
    color: rgba(194, 199, 214, 0.92);
    font-weight: 600;
    text-align: center;
}

/* Ensure SweetAlert appears above Bootstrap modals */
.swal2-container {
    z-index: 9999 !important;
}

.swal-high-z-index {
    z-index: 9999 !important;
}

/* Reduce empty space in center panel (DISCOVER) in modal */
#rebalance2Modal .reb2-card-tall {
    min-height: auto !important; /* Remove fixed min-height */
    height: auto !important; /* Allow natural height */
}

#rebalance2Modal .reb2-card-tall .reb2-card-body {
    min-height: auto !important; /* Remove fixed min-height from body */
    padding-bottom: 1rem; /* Reduce bottom padding */
    flex-grow: 0; /* Don't expand to fill space */
}

/* Compact the center panel content */
#rebalance2Modal #reb2CenterPanel {
    height: fit-content; /* Only as tall as content needs */
}

#rebalance2Modal #reb2CenterPanel .reb2-card-body {
    padding-bottom: 0.5rem; /* Less bottom padding */
}
