/* Keep the Rain library profile readable without trimming its description. */
body[data-theme="rain"] .home-library-profile {
    background: #e7eee7;
    border-color: #d7e2d7;
}

body[data-theme="rain"] .home-library-about p {
    display: block;
    max-height: none;
    overflow: visible;
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    text-overflow: clip;
}

@media (min-width: 992px) {
    body[data-theme="rain"] .home-library-summary-section {
        padding: 24px;
        background: linear-gradient(145deg, #ffffff 0%, #f8fbf8 100%);
        border-color: #d9e5da;
        box-shadow: 0 12px 34px rgba(43, 67, 49, 0.08);
    }

    body[data-theme="rain"] .home-library-summary {
        gap: 24px;
    }

    body[data-theme="rain"] .home-library-profile {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 20px;
        min-height: 100%;
        padding: 24px;
        border: 1px solid #d9e5da;
        border-radius: 20px;
        background: linear-gradient(135deg, #edf4ed 0%, #e4eee4 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    body[data-theme="rain"] .home-library-npp {
        align-self: flex-start;
        width: min(100%, 420px);
        min-height: 112px;
        gap: 16px;
        padding: 20px;
        border-color: #dce7dd;
        border-radius: 16px;
        box-shadow: 0 6px 18px rgba(43, 67, 49, 0.06);
    }

    body[data-theme="rain"] .home-library-npp > span {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    body[data-theme="rain"] .home-library-npp svg {
        width: 26px;
        height: 26px;
    }

    body[data-theme="rain"] .home-library-npp small {
        font-size: 0.8rem;
    }

    body[data-theme="rain"] .home-library-npp strong {
        font-size: clamp(1.05rem, 1.25vw, 1.35rem);
        letter-spacing: 0.01em;
    }

    body[data-theme="rain"] .home-library-about {
        position: relative;
        min-width: 0;
        padding: 0 0 0 20px;
    }

    body[data-theme="rain"] .home-library-about::before {
        position: absolute;
        top: 3px;
        bottom: 3px;
        left: 0;
        width: 3px;
        border-radius: 3px;
        background: #647d68;
        content: "";
    }

    body[data-theme="rain"] .home-library-about h2 {
        margin-bottom: 9px;
        font-size: clamp(1.1rem, 1.4vw, 1.45rem);
        letter-spacing: -0.02em;
    }

    body[data-theme="rain"] .home-library-about p {
        max-width: 62ch;
        font-size: clamp(0.92rem, 1vw, 1.05rem);
        line-height: 1.75;
    }

    body[data-theme="rain"] .home-library-statistics {
        justify-content: center;
        gap: 14px;
        padding: 6px 2px;
    }

    body[data-theme="rain"] .home-library-statistics-heading h2 {
        font-size: 1.12rem;
    }

    body[data-theme="rain"] .home-library-statistics-heading p {
        font-size: 0.84rem;
    }
}

/* Mobile: statistic cards form a horizontal scroll-snap rail (2 cards per view). */
@media (max-width: 768px) {
    body[data-theme="rain"] .home-stat-list {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 10px !important;
        padding: 0 0 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body[data-theme="rain"] .home-stat-list::-webkit-scrollbar {
        display: none;
    }

    body[data-theme="rain"] .home-stat-card {
        flex: 0 0 47% !important;
        min-width: 0 !important;
        scroll-snap-align: start !important;
    }

    body[data-theme="rain"] .home-stat-card em {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}
