.csd-page {
    background-color: var(--dash-bg, #eff6f0);
    min-height: 100vh;
    padding-bottom: 80px;
    font-family: var(--pa-font-default, 'Inter', sans-serif);
}

.csd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.csd-hero__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 1230px) {

    .csd-container {
        padding: 0 40px;
    }

    .csd-hero__container {
        padding: 0 40px;
    }
}

.csd-hero {
    background: linear-gradient(180deg, #02723f 0%, #038248 18%, #049551 38%, #0bb265 100%);
    padding: 180px 0 280px;
    position: relative;
}

/* Breadcrumb sits above the hero row, same spacing as the dashboard heroes */
.csd-hero__breadcrumb {
    display: inline-flex;
    margin: 0 0 20px;
}

.csd-hero__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 32px;
    align-items: center;
}

.csd-hero__photo {
    width: 200px;
    height: 200px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.csd-hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center 20%;
}

.csd-hero__info {
    min-width: 0;
    color: #fff;
}

.csd-page .csd-hero__name {
    font-family: var(--pa-font-default, 'Inter', sans-serif) !important;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin: 0 0 24px;
}

.csd-hero__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.csd-hero__meta li {
    display: flex;
    gap: 8px;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    flex-wrap: wrap;
}

.csd-hero__meta-label {
    font-weight: 700;
    color: #fff;
}

.csd-hero__meta-value {
    color: rgba(255, 255, 255, 0.92);
}

/* Sponsor-status mini card on the right of the hero row */
.csd-status {
    background: #FFFFFF1A;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 364px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.csd-status__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
}

.csd-status__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.csd-status__icon {
    width: 18px;
    height: 18px;
}

.csd-status__icon svg,
.csd-status__icon path {
    fill: #fff;
}

.csd-status__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.csd-status__pill-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.csd-status__pill--open {
    background: #fff8ee;
    color: #e08000;
}

.csd-status__pill--done {
    background: #E6F4EA;
    color: var(--pa-primary, #049551);
}

.csd-status__pill-check {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

/* ---- About card: overlaps the bottom of the hero ---- */
.csd-about {
    margin-top: -160px;
    position: relative;
    z-index: 2;
    margin-bottom: 32px;
}

.csd-about__card {
    background: #fff;
    border-radius: 24px;
    padding: 32px clamp(20px, 4vw, 48px);
    max-width: 1100px;
    margin: 0 auto;
}

.csd-about__title {
    font-family: var(--pa-font-headline, inherit);
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
}

.csd-about__text {
    color: #333;
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
    /* Clamp to 4 lines when not expanded */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.csd-about__text.is-expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.csd-about__text p {
    margin: 0 0 12px;
    color: #333;
}

.csd-about__text p:last-child {
    margin-bottom: 0;
}

.csd-about__expand {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    color: var(--pa-primary, #049551);
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 18px auto 0;
    padding: 6px 8px;
    font-family: inherit;
}

.csd-about__expand-chev {
    width: 14px;
    height: 14px;
    color: var(--pa-primary, #049551);
    transition: transform 0.2s;
}

.csd-about__expand.is-open .csd-about__expand-chev {
    transform: rotate(180deg);
}

.csd-about__expand[hidden] {
    display: none !important;
}

/* Center the expand button */
.csd-about__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}

.csd-about__expand {
    align-self: center;
}

/* ---- Sponsor form card ---- */
.csd-sponsor {
    margin-bottom: 32px;
}

.csd-sponsor__card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(4, 149, 81, 0.18);
    padding: clamp(20px, 4vw, 48px);
    max-width: 1100px;
    margin: 0 auto;
}

.csd-sponsor__title {
    font-family: var(--pa-font-headline, inherit);
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 0 0 28px;
}

.csd-sponsor__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: stretch;
}

.csd-sponsor__count {
    font-size: 16px;
    color: #333;
    margin: 0 0 16px;
}

@media (max-width: 1230px) {
    .csd-sponsor__count {
        text-align: center;
    }
}

.csd-sponsor__count strong {
    font-weight: 700;
}

.csd-needs-card {
    margin: 0 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.csd-needs {
    list-style: none;
    margin: 0;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

.csd-needs__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.csd-needs__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--pa-primary, #049551);
    font-size: 16px;
    font-weight: 700;
}

.csd-needs__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.csd-needs__icon svg,
.csd-needs__icon path {
    fill: var(--pa-primary, #049551);
}

.csd-needs__amount {
    color: #333;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.csd-needs__done {
    color: #333;
    font-weight: 400;
    font-size: 16px;
}

.csd-needs__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid #E2E2E2;
}

.csd-needs__total-label {
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

.csd-needs__total-amount {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

/* Right col CTA (mint) */
.csd-sponsor__right {
    display: flex;
}

.csd-cta {
    background: #04955114;
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.csd-cta__label {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.csd-cta__amount {
    font-size: clamp(22px, 3vw, 24px);
    font-weight: 800;
    color: #333;
    margin: 0;
}

.csd-cta__period {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-left: 2px;
}

.csd-cta__btn {
    appearance: none;
    -webkit-appearance: none;
    background: var(--pa-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.15s, transform 0.15s, box-shadow 0.2s;
    border: 1px solid var(--pa-primary);
}

.csd-cta__btn:hover {
    background: white;
    color: var(--pa-primary);
    border: 1px solid var(--pa-primary);
}

.csd-cta__btn:active {
    transform: translateY(0);
}

.csd-cta__trust {
    font-size: 13px;
    color: #333;
    margin: 0;
    display: block;
    text-align: center;
    line-height: 1.4;
}

.csd-cta__trust svg {
    color: var(--pa-primary);
    width: 20px;
    height: 20px;
    display: inline;
    vertical-align: middle;
}

.csd-cta__trust-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    display: inline;
    vertical-align: middle;
}

.csd-cta__trust>svg,
.csd-cta__trust-icon {
    margin-right: 6px;
}

.csd-cta__trust-icon svg,
.csd-cta__trust-icon path {
    fill: var(--pa-primary);
}

/* Hidden form scaffolding for legacy `get_buy_form()` compat */
.csd-form__hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fully-sponsored fallback */
.csd-all-sponsored {
    background: #EDF6EE;
    border-radius: 18px;
    padding: 28px 24px;
    text-align: center;
    color: #333;
}

.csd-all-sponsored__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--pa-primary, #049551);
}

.csd-all-sponsored__icon svg,
.csd-all-sponsored__icon path {
    /* fill: var(--pa-primary, #049551); */
}

.csd-all-sponsored__msg {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1230px) {
    .csd-hero {
        padding: 120px 0 200px;
        background: #32BF7E;
    }

    body:has(.csd-page) .hv2-header,
    body:has(.csd-page) .hv2-header--overlay {
        background: #32BF7E;
    }

    .csd-hero__breadcrumb {
        margin: 0 0 14px;
    }

    .csd-hero__row {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: left;
        justify-items: stretch;
    }

    .csd-hero__photo {
        width: 160px;
        height: 160px;
        border-radius: 20px;
        justify-self: center;
    }

    .csd-hero__info {
        width: 100%;
        text-align: center;
    }

    .csd-page .csd-hero__name {
        text-align: center;
        margin: 4px 0 24px;
    }

    .csd-hero__meta {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 16px 16px;
        text-align: left;
        justify-items: end;
    }

    .csd-hero__meta li {
        flex-direction: column;
        gap: 4px;
    }

    .csd-hero__meta-label {
        font-size: 16px;
        white-space: nowrap;
    }

    .csd-hero__meta-value {
        font-size: 16px;
    }

    .csd-status {
        min-width: 0;
        width: 100%;
    }

    .csd-about {
        margin-top: -120px;
    }

    .csd-sponsor__grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 640px) and (max-width: 1230px) {
    .csd-hero {
        padding: 140px 0 220px;
    }

    .csd-hero__photo {
        width: 220px;
        height: 220px;
        border-radius: 24px;
    }

    .csd-page .csd-hero__name {
        font-size: 36px;
    }

    .csd-hero__meta {
        grid-template-columns: auto auto;
        justify-content: space-between;
        gap: 18px 24px;
        max-width: 560px;
        margin: 0 auto;
        width: 100%;
    }

    .csd-hero__meta-label {
        font-size: 17px;
    }

    .csd-status {
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (max-width: 1230px) {
    .csd-hero {
        padding: 30px 0 180px;
    }

    .csd-hero__photo {
        width: 100px;
        height: 100px;
        border: 2px solid #049551
    }

    .csd-status__row {
        flex-wrap: nowrap;
    }

    .csd-status__label {
        flex: 0 0 auto;
    }

    .csd-status__pill {
        flex: 0 1 auto;
    }

    .csd-needs__total-amount {
        font-size: 18px;
    }
}