.home-market-hero,
.chart-showcase {
    --home-chart-overlap: clamp(2.5rem, 8.35vw, 7.5rem);
}

.home-market-hero {
    padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 3.5vw, 4rem);
    padding-bottom: calc(clamp(2rem, 5vw, 5rem) + var(--home-chart-overlap) * .5);
    color: #f8f5ff;
    background:
        radial-gradient(ellipse at 15% 0%, #42216a 0%, transparent 50%),
        radial-gradient(ellipse at 83% 0%, #281945 0%, transparent 55%),
        #120b22;
}

.chart-showcase {
    display: flow-root;
    position: relative;
    padding-bottom: 3rem;
    background-color: #fff;
}

.chart-showcase > .container {
    position: relative;
    margin-top: calc(-1 * var(--home-chart-overlap));
}

.home-market-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.04fr) minmax(0, 1.40fr);
    align-items: stretch;
    gap: clamp(1rem, 2vw, 2rem);
    max-width: 1470px;
    margin-inline: auto;
}

.home-market-intro {
    align-self: center;
    padding: .75rem 0;
}

.home-market-intro h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(1.9rem, 2.75vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -.038em;
    line-height: 1.17;
}

.home-market-intro h1 span { color: #f472b6; }

.home-market-intro p,
.home-market-note,
.home-investment-month {
    color: #cec2e3;
}

.home-market-intro p {
    max-width: 38ch;
    line-height: 1.65;
}

.home-market-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.45rem;
}

.home-market-actions .btn { padding: .65rem 1rem; }

.home-market-primary,
.home-market-primary:hover,
.home-market-primary:focus-visible {
    color: #21112b;
    background: #f472b6;
    border-color: #f472b6;
}

.home-market-primary:hover,
.home-market-primary:focus-visible { background: #f9a8d4; }

.home-market-intro .home-market-trial {
    max-width: none;
    margin: .7rem 0 0;
    font-size: .78rem;
}

.home-portfolio-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 26rem;
    margin-top: 1.3rem;
    padding: .85rem 1rem;
    border: 1px solid #634681;
    border-radius: .85rem;
    background: #32214c;
    color: #f8f5ff;
    text-decoration: none;
}

.home-market-trial + .home-portfolio-link {
    margin-top: 1.65rem;
}

.home-portfolio-link:hover {
    border-color: #c4b5fd;
    background: #3d285b;
    color: #fff;
}

.home-portfolio-link:focus-visible {
    outline: 2px solid #f9a8d4;
    outline-offset: 3px;
}

.home-portfolio-mark {
    display: grid;
    flex: none;
    place-items: center;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    border: 1px solid #8e669e;
    border-radius: .7rem;
    background: linear-gradient(145deg, #56326b, #37244f);
    color: #f9c9ee;
}

.home-portfolio-copy {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: .15rem;
}

.home-portfolio-name {
    color: #f9a8d4;
    font-size: .75rem;
    font-weight: 600;
}

.home-portfolio-detail {
    color: #cec2e3;
    font-size: .78rem;
    line-height: 1.4;
}

.home-portfolio-arrow {
    flex: none;
    color: #e9d5ff;
}

.home-market-panel {
    padding: clamp(1rem, 1.55vw, 1.5rem);
    border: 1px solid #634681;
    border-radius: 1.3rem;
    background: linear-gradient(155deg, #32214c, #1d142e 75%);
    box-shadow: 0 18px 42px #0c051b50;
}

.home-market-panel h2 {
    margin: 0 0 .3rem;
    font-size: clamp(1.16rem, 1.55vw, 1.52rem);
    font-weight: 700;
}

.home-market-note {
    margin: 0 0 1rem;
    font-size: .84rem;
    line-height: 1.5;
}

.home-market-gauges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.45rem, 1vw, .95rem);
}

.home-market-gauge {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #f8f5ff;
    text-decoration: none;
    background: #201631;
    border: 1px solid #563b71;
    border-radius: .9rem;
    padding: .85rem .4rem .9rem;
}

.home-market-gauge:hover {
    color: #fff;
    border-color: #c4b5fd;
    background: #2b1c40;
}

.home-market-gauge:focus-visible,
.home-investment-link:focus-visible {
    outline: 2px solid #f9a8d4;
    outline-offset: 3px;
}

.home-market-gauge h3 {
    margin: 0 0 .4rem;
    font-weight: 600;
    font-size: .87rem;
}

.home-market-gauge svg {
    width: min(100%, 173px);
    margin-top: .15rem;
}

.home-market-gauge svg text,
.home-investment-chart text {
    fill: #c9bbdd;
    font-size: 10px;
}

.home-market-reading {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    column-gap: .4rem;
    line-height: 1.2;
    margin: .35rem 0 .55rem;
}

.home-market-reading strong,
.home-investment-reading strong {
    font-size: clamp(1.5rem, 2.1vw, 2.2rem);
    letter-spacing: -.045em;
    font-variant-numeric: tabular-nums;
}

.home-market-reading span {
    color: #e3cdff;
    font-size: .8rem;
    font-weight: 600;
}

.home-market-gauge time,
.home-market-empty {
    color: #cec2e3;
    font-size: .75rem;
}

#fear-greed-home,
#investment-index,
#latest-market-news {
    scroll-margin-top: 92px;
}

.home-market-drivers {
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid #634681;
}

.home-market-drivers h3 {
    margin: 0;
    font-size: .91rem;
    font-weight: 700;
}

.home-market-drivers table {
    width: 100%;
    margin-top: .25rem;
    color: #e6dbf0;
    font-size: .78rem;
}

.home-market-drivers th,
.home-market-drivers td {
    padding: .3rem 0;
}

.home-market-drivers thead th,
.home-market-drivers td {
    text-align: right;
    min-width: 3rem;
}

.home-market-drivers thead th {
    color: #cec2e3;
    font-size: .72rem;
}

.home-market-drivers tbody th { font-weight: 500; }

.home-market-drivers td {
    color: #f8f5ff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.home-market-drivers tbody tr + tr { border-top: 1px solid #563b71; }

.home-market-empty { margin: 1.25rem 0; }

.home-investment .home-market-note { margin-bottom: .75rem; }

.home-investment-toggle {
    display: inline-flex;
    padding: .18rem;
    gap: .15rem;
    background: #1a112b;
    border: 1px solid #563b71;
    border-radius: 999px;
}

.home-investment-toggle label {
    padding: .23rem .8rem;
    color: #e0d2ee;
    font-size: .77rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
}

#home-investment-us:checked ~ .home-investment-toggle label[for="home-investment-us"],
#home-investment-india:checked ~ .home-investment-toggle label[for="home-investment-india"] {
    color: #1e1231;
    background: #e9d5ff;
}

#home-investment-us:focus-visible ~ .home-investment-toggle label[for="home-investment-us"],
#home-investment-india:focus-visible ~ .home-investment-toggle label[for="home-investment-india"] {
    outline: 2px solid #f9a8d4;
    outline-offset: 2px;
}

.home-investment-view { display: none; }

#home-investment-us:checked ~ .home-investment-view--us,
#home-investment-india:checked ~ .home-investment-view--india { display: block; }

.home-investment-reading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .55rem;
    margin: .6rem 0 0;
}

.home-investment-month { font-size: .73rem; }

.home-investment-assessment {
    color: #e9d5ff;
    font-size: .8rem;
    font-weight: 600;
}

.home-investment-assessment--caution { color: #facc75; }
.home-investment-assessment--high { color: #fca5a5; }

.home-investment-plot { position: relative; }

.home-investment-chart {
    display: block;
    width: 100%;
    max-height: 218px;
    margin-bottom: .65rem;
}

.home-investment-chart:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
    border-radius: .35rem;
}

.home-investment-reference { stroke: #634e7a; stroke-width: .75px; }
.home-investment-reference--overbought { stroke: #f87171; stroke-width: 1.5px; }
.home-investment-reference--oversold { stroke: #4ade80; stroke-width: 1.5px; }
.home-investment-reference--midpoint { stroke: #e6dbf0; stroke-dasharray: 4 4; }

.home-investment-marker--overbought rect { fill: #fee2e2; }
.home-investment-marker--oversold rect { fill: #dcfce7; }
.home-investment-marker--overbought text { fill: #991b1b; }
.home-investment-marker--oversold text { fill: #166534; }
.home-investment-marker text { font-weight: 600; }

.home-investment-line {
    fill: none;
    stroke: #62b1ff;
    stroke-width: 2.25px;
    stroke-linejoin: round;
}

.home-investment-point { fill: #a0d0ff; }

.home-investment-focus { pointer-events: none; }
.home-investment-focus[hidden] { display: none; }
.home-investment-focus line { stroke: #a0d0ff; stroke-dasharray: 2 3; }
.home-investment-focus circle { fill: #a0d0ff; stroke: #201631; stroke-width: 1.5px; }

.home-investment-tooltip {
    position: absolute;
    z-index: 1;
    padding: .3rem .45rem;
    transform: translate(-50%, -100%);
    border-radius: .35rem;
    background: #120b22;
    border: 1px solid #634681;
    color: #f8f5ff;
    font-size: .73rem;
    white-space: nowrap;
    pointer-events: none;
}

.home-investment-tooltip.below { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: no-preference) {
    .home-investment-line {
        stroke-dasharray: 1 1;
        animation: home-investment-draw .95s ease-out both;
    }

    .home-investment-point {
        animation: home-investment-reveal .2s ease-out .85s both;
    }

    @keyframes home-investment-draw {
        from { stroke-dashoffset: 1; }
        to { stroke-dashoffset: 0; }
    }

    @keyframes home-investment-reveal {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

.home-investment-link {
    display: inline-block;
    color: #e9d5ff;
    font-size: .76rem;
    font-weight: 600;
    text-underline-offset: .2em;
}

.home-investment-link:hover { color: #fff; }

.home-market-news {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.home-market-news-panel { border-color: #dbe4f0 !important; }

.home-news-markets {
    display: flex;
    gap: .4rem;
}

.home-news-markets a {
    padding: .32rem .7rem;
    color: #433765;
    border: 1px solid #e0d7ef;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}

.home-news-markets a:hover,
.home-news-markets a[aria-current="true"] {
    color: #fff;
    border-color: #42216a;
    background: #42216a;
}

.fg-home-news-card {
    border-color: #e5e7eb !important;
    background: #fff;
}

.fg-home-news-card:hover,
.fg-home-news-card:focus-visible {
    border-color: #a78bfa !important;
    background: #faf7ff;
}

.fg-home-news-meta { color: #624893; }

@media (max-width: 1020px) {
    .home-market-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
    .home-market-intro { grid-column: 1 / -1; }
    .home-market-intro p { max-width: 56ch; }
}

@media (max-width: 590px) {
    .home-market-layout { grid-template-columns: minmax(0, 1fr); }
    .home-market-panel h2 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-viewport .ticker-wrap { animation: none; }
}
