.home-page .study-companion-panel {
    width: min(100%, 1120px);
    height: 278px;
    margin: 8px auto clamp(48px, 7vw, 78px);
    display: grid;
    grid-template-columns: minmax(250px, 3fr) minmax(0, 7fr);
    gap: clamp(18px, 2.3vw, 28px);
    align-items: stretch;
}

.home-page .study-stopwatch-card {
    position: relative;
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    isolation: isolate;
}

.home-page .study-stopwatch-visual {
    position: relative;
    width: min(258px, 100%);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.home-page .study-stopwatch-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 15px 30px rgba(40, 179, 191, .13));
    transition: filter .45s ease, opacity .45s ease;
}

.home-page .study-stopwatch-particles {
    transform-box: fill-box;
    transform-origin: center;
    animation: study-particles-drift 19s ease-in-out infinite alternate;
}

.home-page .study-stopwatch-core {
    position: relative;
    z-index: 2;
    width: 148px;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: #f7fbf9;
    text-align: center;
}

.home-page .study-stopwatch-label {
    color: rgba(225, 241, 241, .74);
    font: 800 .62rem/1.2 var(--font-ui);
    letter-spacing: .17em;
    text-transform: uppercase;
}

.home-page .study-stopwatch-duration {
    display: block;
    color: #fff;
    font: 750 clamp(1.62rem, 2.5vw, 2.12rem)/1 var(--font-ui);
    font-variant-numeric: tabular-nums;
    letter-spacing: .025em;
    text-shadow: 0 2px 18px rgba(140, 201, 231, .2);
}

.home-page .study-stopwatch-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 132px;
    gap: 7px;
}

.home-page .study-stopwatch-controls button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(197, 241, 235, .3);
    border-radius: 999px;
    color: #ecfaf7;
    background: rgba(35, 137, 139, .38);
    box-shadow: none;
    font: 800 .66rem/1 var(--font-ui);
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.home-page .study-stopwatch-controls button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(225, 252, 247, .7);
    background: rgba(48, 161, 157, .58);
}

.home-page .study-stopwatch-controls button:focus-visible {
    outline: 2px solid var(--brand-sun);
    outline-offset: 3px;
}

.home-page .study-stopwatch-controls button:disabled {
    opacity: .34;
    cursor: not-allowed;
}

.home-page .study-stopwatch-status {
    position: absolute;
    left: 50%;
    bottom: 1px;
    z-index: 3;
    width: 100%;
    margin: 0;
    transform: translateX(-50%);
    color: rgba(194, 216, 218, .72);
    font: 650 .68rem/1.35 var(--font-ui);
    letter-spacing: .02em;
    text-align: center;
}

.home-page .study-stopwatch-card.is-running .study-stopwatch-svg {
    filter: drop-shadow(0 15px 36px rgba(77, 190, 196, .25));
}

.home-page .study-stopwatch-card.is-running .study-stopwatch-particles {
    animation-duration: 13s;
}

.home-page .study-stopwatch-card.is-locked .study-stopwatch-svg {
    filter: grayscale(1) saturate(.08) opacity(.58) drop-shadow(0 12px 24px rgba(130, 143, 148, .08));
}

.home-page .study-stopwatch-card.is-locked .study-stopwatch-label,
.home-page .study-stopwatch-card.is-locked .study-stopwatch-duration {
    color: rgba(230, 234, 233, .66);
    text-shadow: none;
}

.home-page .study-stopwatch-card.is-locked .study-stopwatch-controls button:first-child {
    opacity: .82;
    color: rgba(247, 249, 248, .82);
    border-color: rgba(220, 227, 226, .2);
    background: rgba(101, 112, 115, .36);
}

.home-page .study-stopwatch-card.has-error .study-stopwatch-status {
    color: #f2b49f;
}

.home-page .ai-mentor-card {
    position: relative;
    min-width: 0;
    height: 100%;
    padding: clamp(24px, 3vw, 34px);
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 22px;
    overflow: hidden;
    border: 1px solid rgba(169, 190, 193, .15);
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 12%, rgba(140, 201, 231, .08), transparent 12rem),
        linear-gradient(145deg, rgba(25, 48, 58, .9), rgba(18, 37, 48, .78));
    box-shadow: 0 24px 55px rgba(0, 0, 0, .16);
}

.home-page .ai-mentor-card::after {
    content: "";
    position: absolute;
    right: -35px;
    top: -54px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(140, 201, 231, .09);
    border-radius: 46% 54% 62% 38% / 52% 42% 58% 48%;
    transform: rotate(19deg);
    pointer-events: none;
}

.home-page .ai-mentor-copy {
    position: relative;
    z-index: 1;
}

.home-page .ai-mentor-kicker {
    margin: 0 0 8px;
    color: rgba(183, 203, 206, .82);
    font: 800 .72rem/1.2 var(--font-ui);
    letter-spacing: .17em;
    text-transform: uppercase;
}

.home-page .ai-mentor-copy h2 {
    margin: 0;
    color: rgba(240, 243, 239, .9);
    font: 600 clamp(1.6rem, 2.7vw, 2.35rem)/1.08 var(--font-display);
    letter-spacing: -.025em;
}

.home-page .ai-mentor-copy p:last-child {
    max-width: 56ch;
    margin: 9px 0 0;
    color: rgba(174, 191, 193, .68);
    font: 500 .88rem/1.55 var(--font-ui);
}

.home-page .ai-mentor-composer {
    position: relative;
    z-index: 1;
    min-height: 84px;
    align-self: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(184, 198, 199, .13);
    border-radius: 17px;
    background: rgba(118, 132, 134, .11);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.home-page .ai-mentor-composer textarea {
    width: 100%;
    min-height: 52px;
    max-height: 52px;
    padding: 8px 3px;
    resize: none;
    border: 0;
    outline: 0;
    color: rgba(205, 214, 213, .54);
    background: transparent;
    font: 500 .88rem/1.45 var(--font-ui);
    cursor: not-allowed;
}

.home-page .ai-mentor-composer textarea::placeholder {
    color: rgba(180, 193, 194, .42);
    opacity: 1;
}

.home-page .ai-mentor-composer button {
    min-width: 74px;
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid rgba(190, 204, 205, .13);
    border-radius: 999px;
    color: rgba(214, 220, 219, .42);
    background: rgba(155, 166, 167, .1);
    font: 800 .68rem/1 var(--font-ui);
    cursor: not-allowed;
}

.home-page .progress-chart-divider--row {
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
    min-height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--brand-sun) 12%,
        var(--brand-sun) 88%,
        transparent
    );
}

.home-page .progress-chart-panel--study {
    grid-column: 1 / -1;
    width: min(100%, 620px);
    justify-self: center;
}

.home-page .progress-chart-panel--study h3 {
    text-align: center;
}

.home-page .progress-chart-panel--study .home-progress-svg {
    margin-inline: auto;
}

.home-page .chart-study-bar {
    fill: rgba(233, 174, 56, .72);
    stroke: rgba(255, 220, 147, .5);
    stroke-width: 1;
    transition: opacity .2s ease;
}

.home-page .chart-study-bar-today {
    fill: var(--brand-sun);
    stroke: rgba(255, 239, 198, .78);
}

@keyframes study-particles-drift {
    0% { transform: rotate(-7deg) scale(.985); opacity: .76; }
    50% { transform: rotate(4deg) scale(1.018); opacity: 1; }
    100% { transform: rotate(9deg) scale(.99); opacity: .82; }
}

@media (max-width: 760px) {
    .home-page .study-companion-panel {
        height: auto;
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 44px;
    }

    .home-page .study-stopwatch-card {
        min-height: 270px;
    }

    .home-page .study-stopwatch-visual {
        width: min(252px, 82vw);
    }

    .home-page .ai-mentor-card {
        min-height: 248px;
    }
}

@media (max-width: 900px) {
    .home-page .progress-chart-divider {
        width: 100%;
        height: 1px;
        min-height: 1px;
        background: linear-gradient(
            to right,
            transparent,
            var(--brand-sun) 12%,
            var(--brand-sun) 88%,
            transparent
        );
    }

    .home-page .progress-chart-panel--study {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .home-page .study-stopwatch-card {
        min-height: 252px;
    }

    .home-page .study-stopwatch-visual {
        width: min(236px, 80vw);
    }

    .home-page .study-stopwatch-status {
        bottom: -2px;
    }

    .home-page .ai-mentor-card {
        min-height: 264px;
        padding: 23px 20px;
    }

    .home-page .ai-mentor-composer {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .home-page .ai-mentor-composer button {
        justify-self: end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page .study-stopwatch-particles {
        animation: none;
    }

    .home-page .study-stopwatch-svg animate {
        display: none;
    }
}
