.foundation-view-head h1 {
    font-family: 'Prompt', sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: #2e3f7f;
    margin: 0;
}
/* ============================================================
   foundation.css — DrawDream
   ============================================================ */

.foundation-view-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 56px;
}

.foundation-view-head {
    margin-bottom: 18px;
}

.foundation-view-head h1 {
    margin: 0;
    font-size: 38px;
    font-family: 'Prompt', sans-serif;
    color: #2e3f7f;
}

.foundation-view-head p {
    margin: 6px 0 14px;
    color: #5b6470;
    font-family: 'Sarabun', sans-serif;
}

.foundation-view-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.foundation-view-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
}

.foundation-manage-btn {
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    padding: 9px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-sizing: border-box;
    font-family: inherit;
}

.foundation-manage-btn-primary {
    background: #3C5099;
    color: #fff;
    padding: 12px 20px;
    font-size: 1.05rem;
}

/* เหมือน .btn-toggle-edit หน้าเด็ก (แก้ไขโปรไฟล์) */
.foundation-manage-btn-edit {
    border-radius: 10px !important;
    background: #F1CF54;
    color: #1f2937;
    padding: 12px 20px;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: 0;
    border: none !important;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.foundation-manage-btn-edit:hover,
.foundation-manage-btn-edit:active,
.foundation-manage-btn-edit:focus {
    background: #e8c94a !important;
    color: #1f2937 !important;
    filter: none !important;
    box-shadow: none;
}

.foundation-manage-btn-update {
    background: #597D57;
    color: #fff;
    padding: 12px 20px;
    font-size: 1.05rem;
    border: none !important;
    box-shadow: 0 10px 20px rgba(89, 125, 87, 0.28);
}

.foundation-manage-btn-update:hover,
.foundation-manage-btn-update:active,
.foundation-manage-btn-update:focus {
    background: #4f704d !important;
    color: #fff !important;
    filter: none !important;
    box-shadow: 0 12px 22px rgba(89, 125, 87, 0.35);
}

.foundation-manage-btn-disabled {
    background: #9ca3af;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
    pointer-events: none;
}

.foundation-manage-btn-danger {
    background: #CC583F;
    color: #fff;
    padding: 12px 20px;
    font-size: 1.05rem;
    border: none !important;
    box-shadow: none;
}

.foundation-manage-btn-danger:hover,
.foundation-manage-btn-danger:active,
.foundation-manage-btn-danger:focus {
    background: #CC583F !important;
    color: #fff !important;
    filter: none !important;
    box-shadow: none;
}

.foundation-warn {
    display: inline-block;
    margin-right: 10px;
    color: #b7791f;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
}

.foundation-pending-inline-msg {
    margin: 0;
    color: #6c757d;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
/* ---- shared buttons ---- */
.urgent-item-card {
    background: transparent !important;
    border-radius: 18px;
    box-shadow: none !important;
    padding: 0;
    margin: 0 10px;
    position: relative;
    display: flex;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
    width: auto;
}

.foundation-owner-btn-primary { background: #3C5099; color: #fff; }
.foundation-owner-btn-primary:hover { background: #334584; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(60,80,153,0.3); }

.foundation-owner-btn-edit {
    background: #F1CF54; color: #1f2937; border: 0; border-radius: 10px;
    font-weight: 800; padding: 12px 20px; font-size: 1.05rem;
    min-width: 220px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.foundation-owner-btn-edit:hover { background: #e0be40; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(241,207,84,0.4); }

.foundation-owner-btn-update {
    background: #597D57; color: #fff; border: 0; border-radius: 10px;
    font-weight: 800; padding: 12px 20px; font-size: 1.05rem;
    min-width: 220px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.foundation-owner-btn-update:hover { background: #4f704d; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(89,125,87,0.3); }

.foundation-owner-btn-profile { background: #6b7280; color: #fff; }
.foundation-owner-btn-profile:hover { background: #4b5563; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(75,85,99,0.28); }

.foundation-owner-btn-need {
    background: #3C5099;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 700;
    padding: 12px 32px;
    box-shadow: 0 4px 15px rgba(60,80,153,0.18);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    text-decoration: none;
    margin-right: 12px;
}
.foundation-owner-btn-need:hover {
    background: #2e3d78;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(60,80,153,0.28);
    color: #fff;
}
.foundation-owner-warn { color: #b7791f; font-family: 'Sarabun', sans-serif; font-size: 14px; font-weight: 600; }

.btn-propose {
    background: #4A5BA8; box-shadow: 0 4px 15px rgba(74,91,168,0.3); color: white;
    padding: 12px 20px; border-radius: 10px; text-decoration: none; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; min-width: 220px; gap: 6px; transition: all 0.3s;
}
.admin-btn { background: #4CAF50; }
.admin-btn:hover { background: #45a049; transform: translateY(-2px); }

/* ---- foundation list / cards ---- */
.foundation-list { display: flex; flex-direction: column; gap: 40px; width: 100%; }
.foundation-empty-msg {
    text-align: center;
    color: #64748b;
    padding: 40px 24px;
    font-family: 'Sarabun', sans-serif;
    max-width: 720px;
    margin: 0 auto;
}

/* Hero carousel (one foundation slide every 10s) */
.foundation-hero-carousel {
    max-width: 1400px;
    margin: 0 auto 48px;
    padding: 0 24px;
    width: 100%;
}
.foundation-hero-track {
    position: relative;
}
.foundation-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #2e3f7f;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.16);
    z-index: 4;
}
.foundation-hero-nav--prev { left: 10px; }
.foundation-hero-nav--next { right: 10px; }
.foundation-hero-nav:hover { background: #fff; }
/* ต้องชนะ .foundation-card { display: grid } มิฉะนั้นสไลด์ที่ปิดจะยังกินพื้นที่ → เห็นการ์ดซ้อนลงมา */
.foundation-hero-track .foundation-card.foundation-slide:not(.is-active) {
    display: none;
    opacity: 0;
    pointer-events: none;
}
.foundation-hero-track .foundation-card.foundation-slide.is-active {
    display: grid;
    opacity: 1;
    pointer-events: auto;
}
.foundation-slide {
    transition: opacity 0.45s ease;
}
.foundation-hero-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.foundation-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #cbd5e1;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, background 0.2s;
}
.foundation-hero-dot.is-active {
    background: #3C5099;
    transform: scale(1.2);
}
.foundation-hero-dot:focus-visible {
    outline: 2px solid #3C5099;
    outline-offset: 2px;
}

/* Carousel slides: จัดชิดบนคุมความสูงให้แถบความคืบหน้า/รูปไม่กระโดดตำแหน่งเมื่อสลับมูลนิธิ */
.foundation-hero-track .foundation-slide .fc-left {
    display: flex;
    flex-direction: column;
}
.foundation-hero-track .foundation-slide .fc-title {
    margin: 0 0 12px;
    line-height: 1.2;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.foundation-hero-track .foundation-slide .fc-desc {
    margin: 0 0 22px;
    line-height: 1.6;
    min-height: 4.8em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.foundation-hero-track .foundation-slide .fc-urgent-zone {
    min-height: 220px;
    margin-bottom: 18px;
    flex-shrink: 0;
}
.foundation-hero-track .foundation-slide .fc-urgent-zone .items.urgent-items {
    margin-bottom: 0;
}
/* การ์บด่วนในสไลด์ — โชว์รูปสิ่งของใหญ่ขึ้น แบ่ง 3 คอลัมน์เต็มพื้นที่ซ้าย */
.foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 420px;
    margin-bottom: 0;
}
.foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid .urgent-item-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
}
.foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid .urgent-item-card .item-img.urgent-img-big,
.foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid .urgent-item-card .noimg.urgent-img-big {
    width: 100%;
    height: 152px;
    min-height: 152px;
    object-fit: cover;
    border-radius: 6px;
    margin: 0;
}
.foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid .urgent-item-card .noimg.urgent-img-big {
    object-fit: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* —— มือถือ / แท็บเล็ก: การ์ดมูลนิธิในสไลด์ — ภาพใหญ่ด้านบน, รายการด่วนเรียงแนวตั้ง อ่านง่าย —— */
@media (max-width: 1024px) {
    .foundation-hero-track .foundation-slide.foundation-card .fc-right {
        order: -1;
    }
    .foundation-hero-track .foundation-slide .fc-left {
        padding-top: 4px;
    }
}

@media (max-width: 768px) {
    .foundation-hero-carousel {
        padding-left: 12px;
        padding-right: 12px;
        margin-bottom: 28px;
    }

    .foundation-hero-track .foundation-slide .fc-progress-block {
        max-width: 100%;
    }

    .foundation-hero-track .foundation-slide .fc-amount-row {
        text-align: center;
        font-size: 0.95rem;
        line-height: 1.45;
        margin-bottom: 14px;
    }

    .foundation-hero-track .foundation-slide .fc-title {
        font-size: clamp(1.2rem, 5.2vw, 1.65rem);
        min-height: 0;
        -webkit-line-clamp: unset;
        display: block;
    }

    .foundation-hero-track .foundation-slide .fc-desc {
        min-height: 0;
        -webkit-line-clamp: unset;
        display: block;
        margin-bottom: 16px;
        font-size: 0.96rem;
        line-height: 1.55;
    }

    .foundation-hero-track .foundation-slide .fc-urgent-zone {
        min-height: 0;
        margin-bottom: 14px;
    }

    .fd-need-view-switch {
        justify-content: stretch;
    }
    .fd-need-dropdown {
        min-width: 100%;
        max-width: 100%;
    }
    .fd-need-dropdown__label {
        white-space: normal;
    }

    .foundation-hero-track .foundation-slide .fc-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 12px;
    }

    .foundation-hero-track .foundation-slide .fc-right-media .cover.foundation-cover-large,
    .foundation-hero-track .foundation-slide .fc-right-media .foundation-cover-placeholder {
        max-height: 168px;
        aspect-ratio: 16 / 10;
    }

    .foundation-hero-track .foundation-slide .btn-donate {
        padding: 11px 20px;
        font-size: 1rem;
    }

    .foundation-hero-track .foundation-slide .fc-cta-row {
        flex-direction: column;
    }
    .foundation-hero-track .foundation-slide .fc-cta-row .btn-donate {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding-left: 16px;
        padding-right: 16px;
        font-size: clamp(1rem, 4vw, 1.15rem);
        flex: 1 1 auto;
    }
    .foundation-hero-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    .foundation-hero-nav--prev { left: 4px; }
    .foundation-hero-nav--next { right: 4px; }
}

@media (max-width: 480px) {
    .foundation-hero-track .foundation-slide .fc-left,
    .foundation-hero-track .foundation-slide .fc-right {
        padding-left: 14px;
        padding-right: 14px;
    }

    .foundation-hero-track .foundation-slide .fc-urgent-zone .fc-urgent-items-grid .urgent-item-card .urgent-tag-abs {
        font-size: 11px;
        padding: 4px 10px;
    }
}

.foundation-hero-track .foundation-slide .fc-right {
    justify-content: flex-start;
    align-items: stretch;
    align-self: start;
}
.foundation-hero-track .foundation-slide .fc-right-media {
    width: 100%;
    max-width: 595px;
    margin: 0 auto;
}
.foundation-hero-track .foundation-slide .fc-right-media .cover.foundation-cover-large {
    width: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: 595 / 419;
    object-fit: cover;
    display: block;
}
.foundation-hero-track .foundation-slide .fc-right-media .foundation-cover-placeholder {
    width: 100%;
    min-height: 0;
    aspect-ratio: 595 / 419;
    margin: 0 auto;
}
.foundation-hero-track .foundation-slide .fc-right-meta {
    width: 100%;
    max-width: 595px;
    margin: 12px auto 0;
    min-height: 1.5rem;
    font-size: 14px;
    color: #64748b;
}

.fc-progress-block {
    max-width: 420px;
}
.fc-amount-row {
    text-align: right;
    font-weight: 700;
    font-family: 'Sarabun', sans-serif;
    margin-top: 8px;
    margin-bottom: 18px;
    font-size: 1rem;
}
.fc-amount-label {
    color: #64748b;
    font-weight: 600;
    margin-right: 6px;
}
.fc-prog-current { color: #3C5099; }
.fc-prog-slash { color: #94a3b8; margin: 0 3px; }
.fc-prog-goal { color: #CC583F; }

.bar.bar-donate {
    margin-bottom: 0;
}
.bar.bar-donate .bar-fill {
    background: #CC583F;
    height: 100%;
    border-radius: 999px;
    transition: width 0.55s ease;
    min-width: 0;
}
.bar-donate {
    border-radius: 999px;
}

/* แท็บสลับ carousel มูลนิธิ — เปิดรับ vs สำเร็จแล้ว */
.fd-need-tabs-section {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 24px;
    width: 100%;
}
.fd-need-view-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.fd-need-dropdown {
    position: relative;
    min-width: min(100%, 320px);
    max-width: 360px;
}
.fd-need-dropdown__trigger {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid #3C5099;
    background: #3C5099;
    color: #fff;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(60, 80, 153, 0.28);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.fd-need-dropdown__trigger:hover {
    background: #2e3d78;
    border-color: #2e3d78;
    transform: translateY(-1px);
}
.fd-need-dropdown__trigger:focus-visible {
    outline: 3px solid rgba(60, 80, 153, 0.35);
    outline-offset: 2px;
}
.fd-need-dropdown__label {
    text-align: left;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-need-dropdown__chevron {
    flex-shrink: 0;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}
.fd-need-dropdown.is-open .fd-need-dropdown__chevron {
    transform: rotate(180deg);
}
.fd-need-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: #fff;
    border: 1.5px solid #d7dff5;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(60, 80, 153, 0.18);
    z-index: 30;
}
.fd-need-dropdown__option {
    appearance: none;
    width: 100%;
    border: none;
    background: transparent;
    color: #2e3f7f;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: clamp(0.88rem, 2vw, 1rem);
    padding: 11px 14px;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.fd-need-dropdown__option:hover {
    background: #eef2ff;
}
.fd-need-dropdown__option.is-active {
    background: #3C5099;
    color: #fff;
}
.fd-need-dropdown__option:focus-visible {
    outline: 2px solid rgba(60, 80, 153, 0.45);
    outline-offset: 1px;
}
.fc-items-scroll-hint {
    display: none;
}
.fd-need-tab-panel {
    display: none;
}
.fd-need-tab-panel.is-active {
    display: block;
}
.foundation-empty-msg--panel {
    margin: 24px auto 8px;
    text-align: center;
}
.fc-goal-met-hint {
    margin: 8px 0 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #eef2ff;
    color: #2e3f7f;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

/* “มูลนิธิที่คุณอาจสนใจ” — image + pill + navy body */
.fd-interest-section {
    max-width: 1400px;
    margin: 0 auto 56px;
    padding: 0 24px;
    width: 100%;
}
.fd-interest-title {
    text-align: center;
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #222;
    margin: 0 0 10px;
}
.fd-interest-sub {
    text-align: center;
    color: #5f6b7a;
    font-size: 1rem;
    margin: 0 0 34px;
    font-family: 'Sarabun', sans-serif;
}
.fd-interest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}
.fd-interest-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}
.fd-interest-viewport {
    width: 100%;
}
.fd-interest-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(22, 27, 45, 0.16);
    background: #fff;
}

.fd-interest-card-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 12px;
    text-decoration: none;
    color: transparent;
    background: transparent;
    -webkit-tap-highlight-color: rgba(60, 80, 153, 0.12);
    touch-action: manipulation;
}

.fd-interest-card-hit:focus-visible {
    outline: 2px solid #3C5099;
    outline-offset: 2px;
}

.fd-interest-nav {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: #3C5099;
    box-shadow: 0 8px 18px rgba(27, 41, 76, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    flex: 0 0 44px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.fd-interest-nav:hover {
    transform: translateY(-1px);
    background: #f8faff;
    box-shadow: 0 10px 20px rgba(27, 41, 76, 0.23);
}
.fd-interest-nav:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: 0 4px 10px rgba(27, 41, 76, 0.12);
}
.fd-interest-top {
    position: relative;
}
.fd-interest-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: #e9edf2;
}
.fd-interest-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    aspect-ratio: 16 / 10;
}
.fd-interest-pill-btn {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    background: #F1CF54;
    color: #1f2937;
    font-weight: 800;
    padding: 10px 36px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 1rem;
    font-family: 'Sarabun', sans-serif;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
    white-space: nowrap;
    z-index: 2;
}
.fd-interest-pill-btn:hover {
    background: #e0bf4a;
    color: #111;
}
.fd-interest-body {
    background: #3C5099;
    color: #fff;
    padding: 18px 20px 20px;
    text-align: center;
    font-family: 'Sarabun', sans-serif;
}
.fd-interest-name {
    font-family: 'Prompt', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}
.fd-interest-desc {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* section ต่อจากมูลนิธิที่คุณอาจสนใจ (placeholder รอใส่รูปจริง) */
.fd-community-section {
    width: 100vw;
    max-width: none;
    margin: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
}
.fd-community-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 320px;
    border-radius: 0;
    overflow: hidden;
    margin-top: 26px;
}
.fd-community-hero-image {
    background: #d8dee7;
    margin: 0;
    padding: 0;
    min-height: 320px;
    position: relative;
}
.fd-community-hero-img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    object-position: center;
    display: block;
}
.fd-community-hero-text {
    background: #CC583F;
    color: #fff;
    padding: 42px 54px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 500;
}

.fd-community-band {
    background: #F7ECDE;
    text-align: center;
    padding: 96px 24px 92px;
    min-height: 560px;
}
.fd-community-band h3 {
    margin: 0 0 12px;
    font-size: 42px;
    line-height: 1.25;
    color: #171717;
}
.fd-community-band p {
    margin: 0 0 24px;
    color: #333;
    font-size: 15px;
    line-height: 1.55;
}
.fd-community-org-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 38px;
    max-width: 980px;
    margin: 0 auto;
    perspective: 1200px;
}
.fd-community-org-card {
    aspect-ratio: 16 / 9.5;
    min-height: 210px;
    border-radius: 28px;
    background: #e8edf4;
    border: 4px solid #fff;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: relative;
    isolation: isolate;
    animation: fdOrgCardFloat 6.4s ease-in-out infinite;
}
.fd-community-org-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
    transform: translateX(-150%);
    animation: fdOrgAdShine 5.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
.fd-community-org-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-height: 210px;
    transform-origin: center;
    animation: fdOrgAdPan 11s ease-in-out infinite;
    will-change: transform;
}
.fd-community-org-card:nth-child(2) {
    animation-delay: 0.42s;
}
.fd-community-org-card:nth-child(2)::after {
    animation-delay: 0.52s;
}
.fd-community-org-card:nth-child(2) .fd-community-org-card__img {
    animation-delay: 0.45s;
}
.fd-community-org-card:nth-child(3) {
    animation-delay: 0.84s;
}
.fd-community-org-card:nth-child(3)::after {
    animation-delay: 1.04s;
}
.fd-community-org-card:nth-child(3) .fd-community-org-card__img {
    animation-delay: 0.9s;
}
.fd-community-org-card:hover .fd-community-org-card__img,
.fd-community-org-card:hover::after,
.fd-community-org-card:hover {
    animation-play-state: paused;
}

@keyframes fdOrgCardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes fdOrgAdPan {
    0% {
        transform: scale(1.03) translateX(0);
    }
    30% {
        transform: scale(1.08) translateX(-2.4%);
    }
    65% {
        transform: scale(1.08) translateX(2.4%);
    }
    100% {
        transform: scale(1.04) translateX(0);
    }
}

@keyframes fdOrgAdShine {
    0%, 20% {
        transform: translateX(-150%);
        opacity: 0;
    }
    28%, 58% {
        opacity: 1;
    }
    80%, 100% {
        transform: translateX(150%);
        opacity: 0;
    }
}

.fd-community-logos {
    background: #fff;
    text-align: center;
    padding: 80px 32px 64px;
    min-height: 280px;
    box-sizing: border-box;
}
.fd-community-logos h3 {
    margin: 0 0 40px;
    font-size: 44px;
    color: #313131;
}
.fd-community-logo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 56px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}
.fd-community-logo-card {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
    animation: fdLogoFloat 4.8s ease-in-out infinite;
    will-change: transform;
}
.fd-community-logo-card__img {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.fd-community-logo-card:nth-child(2) {
    animation-delay: 0.35s;
}

.fd-community-logo-card:nth-child(3) {
    animation-delay: 0.7s;
}

.fd-community-logo-card:hover .fd-community-logo-card__img {
    transform: translateY(-4px) scale(1.03);
    filter: drop-shadow(0 8px 12px rgba(32, 47, 96, 0.18));
}

@keyframes fdLogoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fd-community-org-card,
    .fd-community-org-card__img,
    .fd-community-org-card::after {
        animation: none;
    }
    .fd-community-logo-card {
        animation: none;
    }
    .fd-community-logo-card__img {
        transition: none;
    }
}

/* ฟุตเตอร์ต่อจากโลโก้ (includes/site_footer.php) */
body.foundation-page .site-footer-outer {
    margin-top: 0;
}
body.foundation-page .site-footer .footer-contact-col {
    padding-top: 0 !important;
}
body.foundation-page .site-footer .footer-address {
    text-align: left;
    max-width: none;
    margin: 0;
}
body.foundation-page .site-footer .social-links.site-footer__social {
    display: flex;
    justify-content: center;
    gap: 18px;
}
body.foundation-page .site-footer .social-link {
    color: #ffffff;
    font-size: 1.85rem;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
body.foundation-page .site-footer .social-link:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .fd-community-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .fd-community-hero-image {
        min-height: 220px;
    }
    .fd-community-hero-img {
        min-height: 220px;
    }
    .fd-community-hero-text {
        min-height: 180px;
        padding: 28px 24px;
        font-size: 18px;
    }
    .fd-community-org-grid {
        grid-template-columns: 1fr;
        max-width: 540px;
    }
    .fd-community-band {
        padding: 78px 24px 72px;
        min-height: 0;
    }
    .fd-community-logo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 560px;
        gap: 32px 28px;
    }
    .fd-community-logos {
        padding: 64px 24px 52px;
        min-height: 240px;
    }
    .fd-community-logo-card__img {
        max-height: 175px;
    }
}

@media (max-width: 480px) {
    .fd-community-band {
        padding: 62px 20px 56px;
    }
    .fd-community-band h3 {
        font-size: 28px;
    }
    .fd-community-logos {
        padding: 56px 20px 48px;
        min-height: 0;
    }
    .fd-community-logos h3 {
        font-size: 28px;
        margin-bottom: 28px;
    }
    .fd-community-logo-grid {
        grid-template-columns: 1fr;
    }
    .fd-community-logo-card__img {
        max-height: 155px;
    }
}

.foundation-cover-placeholder {
    width: 100%;
    max-width: 595px;
    min-height: 240px;
    aspect-ratio: 595 / 419;
}

.items.urgent-items .urgent-item-card {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
    border: 2px solid #5d875d;
    border-radius: 8px;
    padding: 8px 8px 10px;
    background: #fff !important;
    box-shadow: none !important;
    margin: 0 8px 0 0;
    overflow: hidden;
}
.items.urgent-items .urgent-item-card .urgent-img-big {
    width: 100%;
    height: 92px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    margin: 0;
}
.items.urgent-items .urgent-item-card .urgent-tag-abs {
    top: -2px;
    left: -2px;
    border-radius: 0 0 10px 0;
    padding: 3px 8px;
    font-size: 10px;
}

@media (max-width: 1024px) {
    .fd-interest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .fd-interest-grid { grid-template-columns: 1fr; }
}

/* โหมดเลื่อนแนวนอนเมื่อมีหลายมูลนิธิ */
.fd-interest-carousel--scroll .fd-interest-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 2px 8px;
    -ms-overflow-style: none; /* IE/Edge legacy */
    scrollbar-width: none; /* Firefox */
}
.fd-interest-carousel--scroll .fd-interest-grid {
    display: flex;
    gap: 24px;
}
.fd-interest-carousel--scroll .fd-interest-card {
    flex: 0 0 calc((100% - 48px) / 3);
    min-width: 300px;
    scroll-snap-align: start;
}
.fd-interest-carousel--scroll .fd-interest-viewport::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}
.fd-interest-carousel--scroll .fd-interest-viewport::-webkit-scrollbar-thumb {
    background: transparent;
}
.fd-interest-carousel--scroll .fd-interest-viewport::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 900px) {
    .fd-interest-carousel--scroll .fd-interest-card {
        flex-basis: calc((100% - 24px) / 2);
        min-width: 280px;
    }
}
@media (max-width: 640px) {
    .fd-interest-carousel {
        gap: 10px;
    }
    .fd-interest-nav {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        font-size: 1rem;
    }
    .fd-interest-carousel--scroll .fd-interest-card {
        flex-basis: 88%;
        min-width: 250px;
    }
}

.foundation-card, .fc-left, .fc-right { background: transparent; }

.foundation-card {
    border-radius: 20px; overflow: hidden;
    display: grid; grid-template-columns: 1.2fr 1fr;
    min-height: 400px; width: 100%; max-width: 1400px; margin: 0 auto;
    align-items: flex-start;
    border: 2.5px solid #d1d5db;
    box-shadow: 0 2px 12px #0001;
    background: transparent;
}
.fc-left { padding: 32px; min-width: 0; }
.fc-right { padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.fc-title { font-size: 32px; font-weight: bold; color: #333; margin: 0 0 15px 0; }
.fc-desc { color: #666; line-height: 1.6; margin-bottom: 25px; }

.bar { background: #E5D4C1; border-radius: 20px; height: 30px; overflow: hidden; margin-bottom: 10px; }
.bar > div { background: #CC583F; height: 100%; transition: width 0.5s ease; border-radius: 20px; }
.amount { font-weight: 600; color: #333; margin-bottom: 25px; text-align: right; }

.items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.item { background: white; border-radius: 15px; padding: 10px 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: relative; transition: transform 0.3s; min-width: 0; max-width: 140px; margin: 0 auto; }
.item:hover { transform: translateY(-5px); }
.urgent-tag { position: absolute; top: 0; left: 0; background: #CC583F; color: white; padding: 5px 12px; border-radius: 15px 0 15px 0; font-size: 11px; font-weight: bold; z-index: 1; }
.item-img { width: 100%; height: 120px; object-fit: contain; background: #f9f9f9; border-radius: 10px; margin-bottom: 12px; }
.noimg { width: 100%; height: 120px; background: #f0f0f0; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #999; margin-bottom: 12px; font-size: 13px; }
.item-name { font-weight: 600; font-size: 14px; color: #333; margin-bottom: 8px; }
.item-meta { font-size: 12px; color: #666; line-height: 1.5; }

.btn-donate { background: #3C5099; color: white; padding: 14px 48px; border-radius: 15px; font-size: 22px; font-weight: bold; text-align: center; text-decoration: none; display: inline-block; transition: all 0.3s; box-shadow: 0 4px 15px rgba(60,80,153,0.3); border: 2px solid transparent; box-sizing: border-box; }
.btn-donate:hover { background: #2e3d78; transform: translateY(-2px); }
/* การ์ดสไลด์หน้ามูลนิธิ: ปุ่มบริจาคหลัก vs ปุ่มดูผลลัพธ์ (ไม่ชนกับ CTA เดิม) */
.btn-donate.btn-donate--primary-cta { border-color: #3C5099; }
.btn-donate.btn-donate--outcome {
    background: #fff;
    color: #2e3f7f;
    border-color: #3C5099;
    box-shadow: 0 2px 12px rgba(60, 80, 153, 0.14);
}
.btn-donate.btn-donate--outcome:hover {
    background: #eef2ff;
    color: #1f2d5c;
    border-color: #2e3d78;
    transform: translateY(-2px);
}

.fc-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    margin-top: 4px;
}
.fc-cta-row .btn-donate {
    flex: 1 1 160px;
    margin: 0;
    text-align: center;
}

.cover { max-width: 100%; width: 100%; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); max-height: 400px; object-fit: cover; }
.cover-empty { width: 100%; height: 300px; background: #f0f0f0; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 14px; }

@media (max-width: 1024px) { .foundation-card { grid-template-columns: 1fr; } .items { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .items { grid-template-columns: 1fr; } }

@import url('touch_feedback.css');

/* ============================================================
   DONATE PAGE  (fd- prefix = foundation donate)
   used by: payment/foundation_donate.php
   ============================================================ */

body.foundation-donate-page {
    background: #F7ECDE;
    min-height: 100vh;
    font-family: 'Prompt', 'Sarabun', sans-serif;
}

/* outer wrapper — ให้สอดคล้องกับหน้าชำระโครงการ (.payment-container) */
.fd-wrapper {
    max-width: 1320px;
    margin: 24px auto 0 auto;
    padding: 0 4vw 48px;
    box-sizing: border-box;
}

/* two-column layout — ขนาดการ์ดเท่าหน้าโครงการ (.payment-card) */
.fd-layout {
    display: grid;
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
    align-items: stretch;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 420px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* เดสก์ท็อป: ให้คอลัมน์ฟอร์มกว้างพอ — แถวสิ่งของ + ปุ่ม +/- เห็นครบ */
@media (min-width: 769px) {
    .fd-layout {
        max-width: 1240px;
        grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
    }

    .fd-item-picker-list {
        overflow-x: visible;
        overflow-y: auto;
        max-height: min(56vh, 520px);
    }

    .fd-picker-row {
        grid-template-columns: minmax(0, 1fr) auto minmax(100px, auto);
        gap: 12px 16px;
        padding: 14px 16px;
    }

    .fd-picker-qty {
        flex-shrink: 0;
    }

    .fd-qty-btn {
        width: 40px;
        height: 40px;
    }

    .fd-qty-input {
        width: 56px;
        height: 40px;
        font-size: 1.05rem;
    }

    .fd-picker-line-total {
        min-width: 100px;
        font-size: 1rem;
        flex-shrink: 0;
    }
}

/* ---- LEFT column ---- */
.fd-left {
    min-width: 0;
    min-height: 100%;
    height: 100%;
    padding: 0;
    background: #f7f7f7;
    border-right: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.fd-left-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 28px 28px 24px;
    box-sizing: border-box;
}

.fd-left:has(.fd-cover) .fd-left-main {
    padding-top: 0;
}

.fd-cover {
    display: block;
    width: 100%;
    margin: 0 0 20px 0;
    height: clamp(240px, 31vw, 360px);
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    flex-shrink: 0;
}

.fd-name {
    font-size: 1.9em;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    line-height: 1.2;
}
.fd-name-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.fd-name-link:hover,
.fd-name-link:focus-visible {
    color: #2e3f7f;
    border-bottom-color: #2e3f7f;
}
.fd-foundation-desc {
    margin: -6px 0 16px;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
}

/* progress */
.fd-progress { margin-bottom: 24px; }
.fd-progress-remaining {
    margin: 2px 0 8px;
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}
.fd-progress-remaining strong {
    color: #1f7a4f;
}
.fd-bar { background: #E5D4C1; border-radius: 20px; height: 16px; overflow: hidden; margin-bottom: 8px; }
.fd-bar > div { background: #CC583F; height: 100%; border-radius: 20px; transition: width 0.5s; }
.fd-progress-text {
    font-size: 24px;
    line-height: 1.2;
    color: #334155;
    font-weight: 700;
}
.fd-progress-text strong {
    color: #CC583F;
    font-size: 28px;
    font-weight: 800;
}

.fd-impact-preview {
    margin: 12px 0 14px;
    padding: 10px 12px;
    border: 1px solid #d7deff;
    border-radius: 10px;
    background: #f8faff;
}
.fd-impact-preview__title {
    margin: 0 0 6px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #2e3f7f;
}
.fd-impact-preview__empty {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}
.fd-impact-preview__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fd-impact-preview__list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #1f2937;
}
.fd-impact-preview__list li strong {
    color: #0f766e;
    white-space: nowrap;
}

/* items list */
.fd-items-wrap {
    background: #f8f8f8;
    border-radius: 14px;
    padding: 18px 20px;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.fd-items-title { font-size: 0.95em; font-weight: 700; color: #333; margin: 0 0 14px 0; }

.fd-item-row {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #ebebeb;
}
.fd-item-row:last-child { border-bottom: none; padding-bottom: 0; }
.fd-item-row.fd-item-urgent { background: #fff9f8; border-radius: 8px; padding: 10px 8px; margin-bottom: 4px; border-bottom: 1px solid #fde0d8; }
.fd-item-urgent-row { margin-bottom: 6px; }

/* รูปสิ่งของหน้าบริจาคมูลนิธิ — carousel ภาพเดียว (เลื่อน/เลื่อนสัมผัสได้) */
.fd-item-carousel {
    flex-shrink: 0;
    width: clamp(100px, 24vw, 128px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.fd-item-carousel-viewport {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    aspect-ratio: 1;
    border-radius: 10px;
    background: #eaeaea;
    box-sizing: border-box;
    scrollbar-width: thin;
}
@media (prefers-reduced-motion: reduce) {
    .fd-item-carousel-viewport {
        scroll-behavior: auto;
    }
}
.fd-item-carousel-viewport::-webkit-scrollbar {
    height: 4px;
}
.fd-item-carousel-viewport::-webkit-scrollbar-thumb {
    background: #bcc3cc;
    border-radius: 4px;
}
.fd-item-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    min-height: 0;
    align-self: stretch;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    box-sizing: border-box;
}
.fd-item-carousel-img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}
.fd-item-carousel-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #b0b0b0;
    font-size: 1rem;
    border-radius: 10px;
    box-sizing: border-box;
}
.fd-item-carousel-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}
.fd-item-carousel-btn {
    flex-shrink: 0;
    border: none;
    background: #e2e8f0;
    width: 28px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    color: #1e293b;
    font-family: inherit;
}
.fd-item-carousel-btn:hover {
    background: #cbd5e1;
}
.fd-item-carousel-dots {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}
.fd-item-carousel-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
}
.fd-item-carousel-dot.is-active {
    background: #3c5099;
    transform: scale(1.1);
}
.fd-item-carousel-viewport:focus-visible {
    outline: 2px solid #3c5099;
    outline-offset: 2px;
}
.fd-item-carousel-viewport:focus:not(:focus-visible) {
    outline: none;
}
.fd-item-detail { flex: 1; min-width: 0; }
.fd-item-name { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fd-item-meta { font-size: 12px; color: #888; line-height: 1.6; }
.fd-item-lines {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}
.fd-item-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
}
.fd-item-line-name {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-item-line-meta {
    color: #334155;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .fd-item-line {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .fd-item-line-name,
    .fd-item-line-meta {
        white-space: normal;
    }
}
.fd-urgent-badge { background: #CC583F; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }

/* ---- RIGHT column — เทียบเท่า .payment-box หน้าโครงการ ---- */
.fd-right {
    position: relative;
    min-width: 0;
    min-height: 100%;
    height: 100%;
    padding: 28px 28px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: #fff;
    border-left: 1.5px solid #F1CF54;
}

body.foundation-donate-page .fd-right #foundationDonateForm {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

/* ปุ่มย้อนกลับวงกลมมุมขวาบน — สไตล์เดียวกับหน้าโครงการ (ปุ่มบนภาพโครงการ) */
body.foundation-donate-page .fd-donate-back-circle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.07);
    text-decoration: none;
    border: none;
    box-sizing: border-box;
}
body.foundation-donate-page .fd-donate-back-circle:hover {
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.12);
}
body.foundation-donate-page .fd-donate-back-circle span {
    font-size: 1.5em;
    color: #3C5099;
    line-height: 1;
}

/* หัวข้อฝั่งฟอร์ม ให้สไตล์ใกล้ .payment-box h3 */
.fd-donate-section-title {
    font-size: 1.26em;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px 0;
    padding-right: 52px;
}

.fd-form-sub {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 18px 0;
}

/* กริด 2×2 เหมือนหน้าโครงการ — ทุกช่องสูงเท่ากัน */
body.foundation-donate-page #foundationDonateForm .fd-amount-presets-grid {
    align-items: stretch;
}

body.foundation-donate-page #foundationDonateForm .fd-amount-presets-grid > .preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    box-sizing: border-box;
}

body.foundation-donate-page .fd-preset-custom-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    padding: 10px 8px 8px;
    box-sizing: border-box;
}

body.foundation-donate-page .fd-preset-custom-label {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px 0;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

body.foundation-donate-page .fd-preset-custom-cell input {
    font-size: 1.05em;
    text-align: center;
    width: 92%;
    max-width: 200px;
    border: none;
    border-bottom: 2px solid #aaa;
    background: transparent;
    outline: none;
    margin: 0 auto;
    display: block;
    font-family: 'Prompt', sans-serif;
    color: #222;
}

body.foundation-donate-page .amount-presets-grid .preset-btn.preset-selected {
    outline: 2px solid #3C5099;
    background: #f0f2fa;
}

body.foundation-donate-page #foundationDonateForm .payment-method {
    flex-shrink: 0;
    margin-top: 4px;
}

body.foundation-donate-page #foundationDonateForm .btn-pay {
    flex-shrink: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* ตัวเลือกสิ่งของ + จำนวนชิ้น (หลายรายการ) */
.fd-cap-hint {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #334155;
    font-weight: 600;
    font-family: 'Sarabun', sans-serif;
}

.fd-item-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.fd-donate-all-wrap {
    margin-bottom: 12px;
}

.fd-donate-all-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 2px solid #3C5099;
    border-radius: 12px;
    background: #fff;
    color: #3C5099;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.fd-donate-all-btn:hover {
    background: #3C5099;
    color: #fff;
    box-shadow: 0 4px 14px rgba(60, 80, 153, 0.22);
}

.fd-donate-all-btn.is-active {
    background: #3C5099;
    color: #fff;
    box-shadow: 0 4px 14px rgba(60, 80, 153, 0.22);
}

.fd-donate-all-btn.is-active:hover {
    background: #2d4580;
    border-color: #2d4580;
}

.fd-donate-all-hint {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}

.fd-picker-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}

.fd-picker-row--active {
    border-color: #3C5099;
    background: #f0f2fa;
}

.fd-picker-info {
    min-width: 0;
}

.fd-picker-name {
    display: block;
    font-weight: 700;
    font-size: 0.98rem;
    color: #1e293b;
    line-height: 1.35;
}

.fd-picker-meta {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 2px;
}

.fd-picker-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.fd-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.fd-qty-btn:hover {
    background: #e2e8f0;
}

.fd-qty-input {
    width: 44px;
    height: 36px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Prompt', sans-serif;
    color: #1e293b;
    -moz-appearance: textfield;
}

.fd-qty-input::-webkit-outer-spin-button,
.fd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fd-picker-line-total {
    min-width: 72px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 700;
    color: #CC583F;
    white-space: nowrap;
}

.fd-picker-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    margin-top: auto;
    flex-shrink: 0;
}

.fd-picker-summary-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.fd-picker-summary-label {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
}

.fd-picker-summary-amt {
    font-size: 1.65rem;
    color: #CC583F;
    line-height: 1.1;
}

.fd-picker-summary-unit {
    font-size: 0.95rem;
    color: #64748b;
}

.fd-picker-summary-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fd-picker-summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
    color: #334155;
}

.fd-picker-summary-list li strong {
    color: #1e293b;
    white-space: nowrap;
}

.fd-picker-summary-hint {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
}

.fd-picker-summary-hint--warn {
    color: #b45309;
    font-weight: 600;
}

.fd-picker-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .fd-item-picker-list {
        gap: 6px;
        margin-bottom: 10px;
    }

    .fd-picker-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info info"
            "qty total";
        gap: 5px 8px;
        padding: 8px 10px;
        align-items: center;
        border-radius: 10px;
    }

    .fd-picker-info {
        grid-area: info;
        min-width: 0;
    }

    .fd-picker-name {
        font-size: 0.9rem;
        line-height: 1.28;
    }

    .fd-picker-meta {
        font-size: 0.72rem;
        margin-top: 1px;
        line-height: 1.3;
    }

    .fd-picker-qty {
        grid-area: qty;
        justify-self: start;
        border-radius: 8px;
    }

    .fd-picker-line-total {
        grid-area: total;
        justify-self: end;
        align-self: center;
        text-align: right;
        font-size: 0.82rem;
        min-width: 0;
    }

    .fd-qty-btn {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }

    .fd-qty-input {
        width: 38px;
        height: 34px;
        font-size: 0.9rem;
    }

    .fd-picker-summary {
        padding: 10px 12px;
        margin-bottom: 10px;
        border-radius: 10px;
    }

    .fd-picker-summary-head {
        gap: 6px;
    }

    .fd-picker-summary-label {
        font-size: 0.88rem;
    }

    .fd-picker-summary-amt {
        font-size: 1.35rem;
    }

    .fd-picker-summary-unit {
        font-size: 0.85rem;
    }

    .fd-picker-summary-hint {
        font-size: 0.78rem;
        margin-top: 6px;
    }

    .fd-cap-hint {
        font-size: 0.88rem;
        margin-bottom: 8px;
    }

    .fd-donate-all-wrap {
        margin-bottom: 8px;
    }

    .fd-donate-all-btn {
        padding: 10px 12px;
        font-size: 0.92rem;
        border-radius: 10px;
    }
}

/* QR section */
.fd-qr-section { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fd-qr-section h3 { font-size: 1.15em; font-weight: 700; color: #222; margin: 0 0 12px 0; }
.fd-qr-amount { color: #555; margin-bottom: 14px; }
.fd-qr-amount strong { color: #CC583F; font-size: 1.2em; }
.fd-qr-img { width: 220px; height: 220px; object-fit: contain; border: 1px solid #eee; border-radius: 12px; padding: 10px; background: #fff; margin-bottom: 12px; }
.fd-qr-hint { font-size: 13px; color: #aaa; margin-bottom: 4px; }
.fd-qr-charge { font-size: 11px; color: #ccc; margin-bottom: 20px; }
.fd-btn-paid {
    display: block;
    width: min(100%, 320px);
    padding: 12px 16px;
    background: #F1CF54;
    color: #222;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    margin: 0 auto 10px;
    font-size: 1em;
}
.fd-btn-paid:hover { background: #e6c040; }
.fd-btn-cancel { display: block; text-align: center; color: #aaa; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* alert */
.fd-alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.fd-alert-error { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.fd-alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }

/* responsive */
@media (max-width: 768px) {
    .fd-layout {
        display: flex;
        flex-direction: column;
    }
    .fd-left {
        height: auto;
        min-height: 0;
    }
    .fd-left-main {
        padding: 0 20px 24px;
    }
    .fd-left:has(.fd-cover) .fd-left-main {
        padding-top: 0;
    }
    .fd-left:not(:has(.fd-cover)) .fd-left-main {
        padding-top: 24px;
    }
    .fd-left {
        border-right: none;
        border-bottom: 1.5px solid #F1CF54;
    }
    .fd-cover {
        width: 100%;
        margin: 0 0 18px 0;
        height: clamp(210px, 44vw, 300px);
    }
    .fd-right {
        height: auto;
        min-height: 0;
        border-left: none;
        padding: 28px 20px 24px;
    }
    body.foundation-donate-page .fd-right #foundationDonateForm {
        flex: none;
    }
    .fd-item-picker-list {
        flex: none;
        max-height: min(46vh, 360px);
    }
    .fd-picker-summary {
        margin-top: 0;
    }
    .fd-right {
        padding: 20px 14px 18px;
    }
    .fd-items-wrap {
        flex: none;
    }
    .fd-progress-remaining {
        font-size: 15px;
    }
    .fd-progress-text {
        font-size: 20px;
    }
    .fd-progress-text strong {
        font-size: 24px;
    }
}
@media (max-width: 500px) {
    .fd-wrapper { padding: 0 14px 40px; }
}

/* ============================================================
   foundation add need page
   used by: foundation_add_need.php
   ============================================================ */
body.foundation-add-need-page { font-family: 'Prompt', 'Sarabun', sans-serif; background: #F7ECDE; min-height: 100vh; margin: 0; }
body.foundation-add-need-page .add-need-container { width: min(1100px, calc(100% - 48px)); margin: 36px auto 48px; padding: 28px; background: white; border-radius: 20px; border: 1.5px solid #F1CF54; box-shadow: 0 10px 26px rgba(25,48,77,0.08); }
body.foundation-add-need-page .add-need-back { margin: 0 0 10px; }
body.foundation-add-need-page .add-need-back-link { color: #3C5099; font-weight: 700; text-decoration: none; font-size: 15px; }
body.foundation-add-need-page .add-need-back-link:hover { text-decoration: underline; }
body.foundation-add-need-page h2 { color: #24314a; margin: 0 0 18px; font-size: 34px; font-weight: 800; }
body.foundation-add-need-page .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 14px; }
body.foundation-add-need-page .form-col { flex: 1; }
body.foundation-add-need-page .form-group { margin-bottom: 16px; }
body.foundation-add-need-page .form-group label { display: block; margin-bottom: 6px; font-weight: 700; color: #1f3654; }
body.foundation-add-need-page .item-other-input { margin-bottom: 10px; }
body.foundation-add-need-page .form-group input[type="text"],
body.foundation-add-need-page .form-group input[type="number"],
body.foundation-add-need-page .form-group select,
body.foundation-add-need-page .form-group textarea { width: 100%; padding: 12px 14px; border: 1.5px solid #F1CF54; border-radius: 12px; font-size: 1rem; box-sizing: border-box; font-family: inherit; background: #fff; }
body.foundation-add-need-page .category-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.foundation-add-need-page .category-check-item,
body.foundation-add-need-page .item-check-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #d9dee7; border-radius: 10px; background: #fff; }
body.foundation-add-need-page .item-check-groups { display: grid; gap: 10px; }
body.foundation-add-need-page .item-check-group { border: 1px solid #e4e7ed; border-radius: 12px; padding: 10px; background: #fbfcff; }
body.foundation-add-need-page .item-check-group-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
body.foundation-add-need-page .noimg { width: 100%; height: 140px; background: #f0f0f0; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #999; margin-bottom: 12px; font-size: 15px; }
body.foundation-add-need-page textarea { resize: vertical; min-height: 96px; }
body.foundation-add-need-page .form-group input:focus,
body.foundation-add-need-page .form-group textarea:focus,
body.foundation-add-need-page .form-group select:focus { outline: none; border-color: #3C5099; box-shadow: 0 0 0 4px rgba(60,80,153,0.14); }
body.foundation-add-need-page .checkbox-group { display: flex; align-items: center; margin-bottom: 10px; }
body.foundation-add-need-page .checkbox-group input { width: 18px; height: 18px; margin-right: 8px; }
body.foundation-add-need-page .checkbox-group label { margin: 0; font-weight: 500; }
body.foundation-add-need-page .foundation-need-images--prominent {
    padding: 14px 14px 16px;
    border-radius: 14px;
    border: 1.5px solid #e8dc9a;
    background: linear-gradient(180deg, #fffdf6 0%, #fff 100%);
    margin-bottom: 18px;
}
body.foundation-add-need-page .need-images-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}
/* กรอบปุ่มอัปโหลดสองฝั่งสูงเท่ากัน (แถวเดียวกันยืดตามคอลัมน์ที่สูงกว่า) */
body.foundation-add-need-page .need-images-duo__col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
body.foundation-add-need-page .need-images-duo__col .image-upload-box {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.foundation-add-need-page .need-images-duo__col .image-upload-box .upload-label {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
body.foundation-add-need-page .need-images-duo__col .image-upload-box .image-upload-toolbar {
    margin-top: auto;
}
/* ฝั่งมูลนิธิ: กรอบเทาไม่ยืดตามความสูงแถวเมื่อฝั่งซ้ายมีพรีวิวหลายรูป */
body.foundation-add-need-page .need-images-duo__col--fdn .image-upload-box {
    flex: 0 0 auto;
}
body.foundation-add-need-page .need-images-duo__col--fdn .image-upload-box .upload-label {
    flex: 0 0 auto;
}
body.foundation-add-need-page .need-images-duo__col--fdn .image-upload-box .image-upload-toolbar {
    margin-top: 14px;
}
@media (max-width: 768px) {
    body.foundation-add-need-page .need-images-duo {
        grid-template-columns: 1fr;
    }
}
body.foundation-add-need-page .need-images-duo__label {
    display: block;
    font-weight: 700;
    color: #1a3352;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
body.foundation-add-need-page .need-img-lead--compact {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.4;
}
body.foundation-add-need-page .image-upload-box--compact {
    padding: 14px 12px 12px;
}
body.foundation-add-need-page .upload-label--compact .upload-icon--sm {
    font-size: 28px;
    margin-bottom: 2px;
}
body.foundation-add-need-page .upload-label--compact .upload-hint {
    margin-top: 2px;
}
body.foundation-add-need-page .btn-need-pick-img--secondary {
    border-color: #c9a227;
    color: #5c4d1a;
}
body.foundation-add-need-page .btn-need-pick-img--secondary:hover:not(:disabled) {
    background: #fffbeb;
    border-color: #a67c00;
}
body.foundation-add-need-page .foundation-need-fdn-preview {
    margin-top: 10px;
}
body.foundation-add-need-page .foundation-fdn-preview-item {
    max-width: 148px;
}
body.foundation-add-need-page .need-img-optional {
    font-weight: 600;
    font-size: 0.88rem;
    color: #5c6570;
}
body.foundation-add-need-page .need-img-lead {
    margin: 4px 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #4b5563;
    font-weight: 500;
}
body.foundation-add-need-page .foundation-need-images .image-upload-box {
    position: relative;
    border: 2px dashed #cfd5dd;
    border-radius: 14px;
    padding: 22px 16px 18px;
    text-align: center;
    background: #f9f9f9;
    cursor: default;
    transition: border-color 0.2s, background 0.2s;
}
body.foundation-add-need-page .need-image-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
body.foundation-add-need-page .image-upload-toolbar { margin-top: 14px; }
body.foundation-add-need-page .btn-need-pick-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 999px;
    border: 2px solid #3C5099;
    background: #fff;
    color: #24314a;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
body.foundation-add-need-page .btn-need-pick-img:hover:not(:disabled) {
    background: #eef1ff;
    border-color: #2f3d7a;
}
body.foundation-add-need-page .btn-need-pick-img:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
body.foundation-add-need-page .need-upload-count {
    color: #2e7d32;
    font-weight: 700;
    font-size: 15px;
}
body.foundation-add-need-page .need-upload-names {
    word-break: break-word;
    text-align: left;
    max-height: 3.2em;
    overflow: hidden;
}
body.foundation-add-need-page .upload-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}
body.foundation-add-need-page .upload-preview-item {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: 168px;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
    box-sizing: border-box;
}
body.foundation-add-need-page .upload-preview-img {
    width: 100%;
    max-height: 160px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
body.foundation-add-need-page .upload-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(35, 49, 74, 0.88);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    font-family: inherit;
}
body.foundation-add-need-page .upload-preview-remove:hover {
    background: #c62828;
}
body.foundation-add-need-page .upload-preview-urgent {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    max-width: calc(100% - 44px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.foundation-add-need-page .upload-preview-cap { margin-top: 6px; font-size: 12px; color: #4b5563; text-align: center; }
body.foundation-add-need-page .upload-icon { font-size: 40px; margin-bottom: 8px; }
body.foundation-add-need-page .upload-hint { font-size: 12px; color: #999; margin-top: 5px; line-height: 1.45; }
body.foundation-add-need-page .total-box { background: linear-gradient(135deg, #4a5cb8 0%, #3C5099 52%, #2e407f 100%); color: white; padding: 14px; border-radius: 10px; text-align: center; font-size: 1.9rem; font-weight: 800; margin-bottom: 16px; }
body.foundation-add-need-page .btn-submit { background: #F5DD86; color: #1a1a1a; padding: 16px 40px; border: none; border-radius: 999px; font-size: 1.15rem; font-weight: 800; cursor: pointer; display: block; margin: 16px auto 0; font-family: 'Prompt', sans-serif; transition: transform 0.15s ease, background 0.15s ease; box-shadow: none; width: 100%; max-width: 420px; }
body.foundation-add-need-page .btn-submit:hover { background: #edd66f; transform: translateY(-1px); box-shadow: none; }
body.foundation-add-need-page .alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; }
body.foundation-add-need-page .alert-error { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
body.foundation-add-need-page .alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
@media (max-width: 768px) {
    body.foundation-add-need-page .form-row { grid-template-columns: 1fr; }
    body.foundation-add-need-page .add-need-container { width: calc(100% - 24px); margin: 14px auto 26px; padding: 18px; }
}

/* ============================================================
   foundation post update page
   used by: foundation_post_update.php
   ============================================================ */
body.foundation-post-update-page { background: #f4f6f9; font-family: 'Prompt', 'Sarabun', sans-serif; margin: 0; }
body.foundation-post-update-page .wrap { max-width: 800px; margin: 30px auto; padding: 0 20px; }
body.foundation-post-update-page .page-title { font-size: 22px; font-weight: 700; color: #333; margin-bottom: 24px; }
body.foundation-post-update-page .back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #eef1fc;
    border: 1px solid #d5dbf5;
    color: #4A5BA8;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
body.foundation-post-update-page .back-link:hover {
    text-decoration: none;
    background: #e3e8fb;
    border-color: #c5ceed;
    transform: translateX(-2px);
}
body.foundation-post-update-page .alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }

/* =============================
     Responsive สำหรับ Mobile
     ============================= */
@media (max-width: 600px) {
    /* ปรับ layout card หลัก */
    .foundation-card {
        grid-template-columns: 1fr;
        min-height: unset;
        padding: 0 2vw;
    }
    .fc-left, .fc-right {
        padding: 16px 6vw;
    }
    .fc-title {
        font-size: 1.2rem;
    }
    .fc-desc {
        font-size: 0.95rem;
    }
    .items {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .item {
        max-width: 95vw;
        font-size: 0.95rem;
    }
    .cover, .cover-empty {
        max-width: 95vw;
        max-height: 40vw;
    }
    .btn-donate {
        font-size: 1rem;
        padding: 10px 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* ปุ่มและ input */
    .foundation-owner-btn-edit,
    .foundation-owner-btn-update,
    .foundation-owner-btn-need,
    .btn-propose,
    .admin-btn {
        min-width: 60vw;
        font-size: 1rem;
        padding: 10px 0;
    }
    /* ฟอร์มและ input */
    .fd-left, .fd-right {
        padding: 16px 4vw;
    }
    .fd-name {
        font-size: 1.1rem;
    }
    .fd-donate-section-title {
        font-size: 1rem;
    }
    body.foundation-donate-page #foundationDonateForm .btn-pay,
    .fd-btn-paid {
        font-size: 1rem;
        padding: 10px 0;
    }
    .fd-qr-img {
        width: 60vw;
        height: 60vw;
        min-width: 120px;
        min-height: 120px;
        max-width: 90vw;
        max-height: 90vw;
    }
}
body.foundation-post-update-page .alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
body.foundation-post-update-page .alert-error { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
body.foundation-post-update-page .form-box { background: white; border-radius: 16px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); margin-bottom: 30px; }
body.foundation-post-update-page .outcome-rainbow-strip {
    position: relative;
    /* เต็มความกว้างการ์ดขาว — ชดเชย padding ของ .form-box (28px) */
    width: calc(100% + 56px);
    max-width: none;
    margin: -28px -28px 16px -28px;
    height: 110px;
    border-radius: 16px 16px 12px 12px;
    background: linear-gradient(165deg, #4a5cb8 0%, #3C5099 38%, #2e407f 100%);
    overflow: hidden;
}
body.foundation-post-update-page .outcome-rainbow-strip__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 10px rgba(60, 80, 153, 0.28));
}
body.foundation-post-update-page .outcome-target-card {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-left: 4px solid #4A5BA8;
}
body.foundation-post-update-page .outcome-target-card__label {
    font-size: 13px;
    color: #4A5BA8;
    font-weight: 600;
    margin-bottom: 4px;
}
body.foundation-post-update-page .outcome-target-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}
body.foundation-post-update-page .outcome-target-card__meta {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}
body.foundation-post-update-page .form-box h2 { font-size: 17px; font-weight: 700; margin: 0 0 20px; color: #333; }
body.foundation-post-update-page .form-group { margin-bottom: 18px; }
body.foundation-post-update-page .form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
body.foundation-post-update-page .form-group select,
body.foundation-post-update-page .form-group input[type="text"],
body.foundation-post-update-page .form-group textarea { width: 100%; padding: 10px 14px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 14px; font-family: inherit; box-sizing: border-box; transition: border 0.2s; }
body.foundation-post-update-page .form-group select:focus,
body.foundation-post-update-page .form-group input:focus,
body.foundation-post-update-page .form-group textarea:focus { border-color: #4A5BA8; outline: none; }
body.foundation-post-update-page .form-group textarea { resize: vertical; min-height: 100px; }
body.foundation-post-update-page .btn-submit { width: 100%; padding: 13px; background: #4A5BA8; color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; font-family: inherit; }
body.foundation-post-update-page .btn-submit:hover { background: #3a4a98; }
body.foundation-post-update-page .no-project { text-align: center; padding: 40px; color: #999; background: white; border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.07); line-height: 1.8; }
body.foundation-post-update-page .updates-title { font-size: 17px; font-weight: 700; color: #333; margin-bottom: 16px; }
body.foundation-post-update-page .update-card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 1px 6px rgba(0,0,0,0.07); margin-bottom: 16px; border-left: 4px solid #4A5BA8; }
body.foundation-post-update-page .update-proj { font-size: 12px; color: #4A5BA8; font-weight: 600; margin-bottom: 6px; }
body.foundation-post-update-page .update-title { font-size: 16px; font-weight: 700; color: #222; margin-bottom: 8px; }
body.foundation-post-update-page .update-desc { font-size: 14px; color: #555; line-height: 1.6; margin-bottom: 10px; }
body.foundation-post-update-page .update-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
body.foundation-post-update-page .update-date { font-size: 12px; color: #aaa; }

/* ============================================================
   foundation_child_outcome.php — ธีมจดหมาย
   ============================================================ */
body.foundation-child-letter-page {
    background: #e8ecf4;
    font-family: 'Prompt', 'Sarabun', sans-serif;
    margin: 0;
    min-height: 100vh;
}
body.foundation-child-letter-page .child-letter-wrap {
    max-width: 560px;
    margin: 24px auto 48px;
    padding: 0 16px 32px;
    position: relative;
}
body.foundation-child-letter-page .child-letter-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d5dbf5;
    color: #3c5099;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(60, 80, 153, 0.12);
}
body.foundation-child-letter-page .child-letter-back:hover {
    background: #f0f4ff;
    text-decoration: none;
}
body.foundation-child-letter-page .child-letter-page-title {
    margin: 0 0 18px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #2d3a5c;
}
body.foundation-child-letter-page .child-letter-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
body.foundation-child-letter-page .child-letter-alert--ok {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}
body.foundation-child-letter-page .child-letter-alert--err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
body.foundation-child-letter-page .child-letter-airmail {
    max-width: 544px;
    margin: 0 auto;
    padding: 11px;
    border-radius: 12px;
    background: repeating-linear-gradient(
        -45deg,
        #c41e3a 0,
        #c41e3a 9px,
        #fff 9px,
        #fff 18px,
        #1e40af 18px,
        #1e40af 27px,
        #fff 27px,
        #fff 36px
    );
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
body.foundation-child-letter-page .child-letter-paper {
    position: relative;
    background: #fffdf8;
    border-radius: 8px;
    padding: 28px 24px 32px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
body.foundation-child-letter-page .child-letter-paper__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
body.foundation-child-letter-page .child-letter-paper__close:hover {
    color: #64748b;
    background: #f1f5f9;
    text-decoration: none;
}
body.foundation-child-letter-page .child-letter-paper__kicker {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}
body.foundation-child-letter-page .child-letter-paper__hello {
    margin: 0 0 20px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.35;
}
body.foundation-child-letter-page .child-letter-compose {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 18px;
    align-items: flex-start;
    margin-bottom: 8px;
}
body.foundation-child-letter-page .child-letter-polaroid {
    position: relative;
    flex: 0 0 auto;
    width: 132px;
    padding: 10px 10px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    transform: rotate(-2deg);
}
body.foundation-child-letter-page .child-letter-paperclip {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: block;
    line-height: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
body.foundation-child-letter-page .child-letter-paperclip__svg {
    display: block;
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
}
body.foundation-child-letter-page .child-letter-polaroid__img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f1f5f9;
}
body.foundation-child-letter-page .child-letter-polaroid__placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #f8fafc;
    color: #cbd5e1;
}
body.foundation-child-letter-page .child-letter-fields {
    flex: 1 1 220px;
    min-width: 0;
}
body.foundation-child-letter-page .child-letter-fields__label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
body.foundation-child-letter-page .child-letter-fields__label--file {
    margin-top: 14px;
    margin-bottom: 6px;
}
body.foundation-child-letter-page .child-letter-fields__textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    border: none;
    border-radius: 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: #334155;
    font-family: inherit;
    font-weight: 500;
    resize: vertical;
    box-sizing: border-box;
    background: transparent;
}
body.foundation-child-letter-page .child-letter-fields__textarea:focus {
    outline: none;
}
body.foundation-child-letter-page .child-letter-fields__file {
    width: 100%;
    font-size: 0.85rem;
    color: #64748b;
}
body.foundation-child-letter-page .child-letter-deco {
    pointer-events: none;
    position: absolute;
    opacity: 0.35;
}
body.foundation-child-letter-page .child-letter-deco--postmark {
    left: 8px;
    bottom: 72px;
    width: 100px;
    color: #94a3b8;
}
body.foundation-child-letter-page .child-letter-deco__svg {
    width: 100%;
    height: auto;
    display: block;
}
body.foundation-child-letter-page .child-letter-deco--seal {
    right: 12px;
    bottom: 72px;
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    transform: rotate(-8deg);
    opacity: 0.9;
}
body.foundation-child-letter-page .child-letter-deco__seal-img {
    display: block;
    width: 64px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}
body.foundation-child-letter-page .child-letter-form {
    position: relative;
    padding-bottom: 8px;
}
body.foundation-child-letter-page .child-letter-submit {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 20px auto 0;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: #597d57;
    box-shadow:
        0 4px 0 #465f44,
        0 8px 20px rgba(89, 125, 87, 0.35);
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
body.foundation-child-letter-page .child-letter-submit:hover {
    transform: translateY(-1px);
    background: #4f7150;
    box-shadow:
        0 5px 0 #465f44,
        0 10px 24px rgba(89, 125, 87, 0.4);
}
body.foundation-child-letter-page .child-letter-submit:active {
    transform: translateY(2px);
    background: #597d57;
    box-shadow:
        0 2px 0 #465f44,
        0 4px 12px rgba(89, 125, 87, 0.3);
}
@media (max-width: 520px) {
    body.foundation-child-letter-page .child-letter-airmail {
        padding: 9px;
    }
    body.foundation-child-letter-page .child-letter-paper {
        padding: 24px 16px 28px;
    }
    body.foundation-child-letter-page .child-letter-compose {
        flex-direction: column;
        align-items: center;
    }
    body.foundation-child-letter-page .child-letter-fields {
        width: 100%;
    }
    body.foundation-child-letter-page .child-letter-polaroid {
        transform: rotate(-1deg);
    }
}

/* ============================================================
   My Needlist Section  (foundation page)
   ============================================================ */
body.foundation-page .my-needlist-section { margin: 28px 0 10px; padding: 0 4px; }
body.foundation-page .my-needlist-title { font-size: 1.2rem; font-weight: 800; color: #3C5099; margin-bottom: 16px; font-family: 'Prompt', 'Sarabun', sans-serif; }
body.foundation-page .foundation-needlist-empty {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 14px 18px;
    color: #8b9098;
    font-family: 'Sarabun', sans-serif;
    font-size: 1.1rem;
    text-align: left;
    box-sizing: border-box;
    margin: 0 0 14px;
}
body.foundation-page .my-needlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 20px; }
body.foundation-page .need-card { position: relative; background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(60,80,153,0.10); border: 1.5px solid #e5e7eb; overflow: hidden; display: flex; flex-direction: column; font-family: 'Sarabun', sans-serif; }
body.foundation-page .need-card-tap-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
body.foundation-page .need-card-tap-link:focus-visible {
    outline: 2px solid #3C5099;
    outline-offset: 2px;
}
body.foundation-page .need-card .need-card-img-wrap,
body.foundation-page .need-card .need-card-body {
    position: relative;
    z-index: 0;
}
body.foundation-page .need-card .need-card-status-overlay,
body.foundation-page .need-card .need-urgent-badge {
    z-index: 2;
}
body.foundation-page .need-edit-wrap {
    position: relative;
    z-index: 3;
}
body.foundation-page .need-card:hover {
    box-shadow: 0 4px 16px rgba(60, 80, 153, 0.14);
}
/* รูปสิ่งของหลายภาพ — หมุนอัตโนมัติทุก 3 วินาที */
.need-img-rotator {
    position: relative;
    width: 100%;
    height: 100%;
}
.need-img-rotator__viewport {
    position: relative;
    width: 100%;
    height: 100%;
}
.need-img-rotator__slide {
    width: 100%;
    height: 100%;
}
.need-img-rotator__slide .need-card-img,
.need-img-rotator__slide .item-img.urgent-img-big,
.need-img-rotator__slide .noimg.urgent-img-big {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.need-img-rotator__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    position: relative;
    z-index: 3;
}
.need-img-rotator__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.need-img-rotator__dot.is-active {
    background: #3C5099;
    transform: scale(1.15);
}
.need-img-rotator__dot:focus-visible {
    outline: 2px solid #3C5099;
    outline-offset: 2px;
}

.need-card-img-rotator.need-img-rotator--multi .need-img-rotator__viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.need-card-img-rotator .need-img-rotator__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.need-card-img-rotator .need-img-rotator__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}
.need-card-img-rotator .need-img-rotator__dots--card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    margin: 0;
    gap: 4px;
    z-index: 4;
}
.need-card-img-rotator .need-img-rotator__dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.need-card-img-rotator .need-img-rotator__dot.is-active {
    background: #fff;
}

/* เดสก์ท็อป: การ์ดสไลด์มูลนิธิ — แสดงรูปสิ่งของ 3 ภาพพร้อมกัน */
@media (min-width: 769px) {
    .fc-needlist-showcase-carousel .need-img-rotator__viewport {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        max-width: 420px;
    }
    .fc-needlist-showcase-carousel .need-img-rotator__slide {
        position: relative;
        opacity: 1;
        pointer-events: auto;
    }
    .fc-needlist-showcase-carousel .need-img-rotator__dots {
        display: none;
    }
}

/* มือถือ: สไลด์รูปสิ่งของทีละภาพ — เห็นภาพเต็ม (contain) ขนาดพอดี */
@media (max-width: 768px) {
    .fc-needlist-showcase-carousel .need-img-rotator__viewport {
        position: relative;
        height: clamp(158px, 42vw, 182px);
        max-width: min(100%, 292px);
        margin: 0 auto;
        aspect-ratio: unset;
        border-radius: 0;
        overflow: visible;
        background: transparent;
        display: block;
    }
    .fc-needlist-showcase-carousel .need-img-rotator__slide.urgent-item-card {
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
        margin: 0;
        width: 100%;
        max-width: none;
        border: 2px solid #5d875d;
        border-radius: 10px;
        padding: 8px 10px 10px;
        background: #fff !important;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        box-shadow: none !important;
    }
    .fc-needlist-showcase-carousel .need-img-rotator__slide.is-active {
        opacity: 1;
        pointer-events: auto;
    }
    .fc-needlist-showcase-carousel .urgent-item-card .item-img.urgent-img-big,
    .fc-needlist-showcase-carousel .urgent-item-card .noimg.urgent-img-big {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        aspect-ratio: unset;
        border-radius: 4px;
        margin: 0;
        object-fit: contain;
        object-position: center center;
        background: #fff;
    }
    .fc-needlist-showcase-carousel .urgent-item-card .noimg.urgent-img-big {
        object-fit: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: #999;
    }
    .fc-needlist-showcase-carousel .urgent-item-card .urgent-tag-abs {
        top: 0;
        left: 0;
        border-radius: 8px 0 8px 0;
        z-index: 2;
    }

    .need-img-rotator__slide .need-card-img,
    .need-img-rotator__slide .item-img.urgent-img-big {
        object-fit: contain;
        object-position: center center;
        background: #fff;
    }

    body.foundation-page .need-card {
        display: grid;
        grid-template-columns: clamp(96px, 30vw, 118px) minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: start;
    }
    body.foundation-page .need-card-img-wrap {
        grid-column: 1;
        grid-row: 1;
        aspect-ratio: 4 / 5;
        height: clamp(112px, 32vw, 132px);
        width: 100%;
        background: #fff;
    }
    body.foundation-page .need-card-body {
        grid-column: 2;
        grid-row: 1;
        padding: 8px 10px 10px;
        gap: 4px;
    }
    body.foundation-page .need-card-name {
        font-size: 0.92rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    body.foundation-page .need-card-goal {
        font-size: 0.82rem;
    }
    body.foundation-page .need-card-desc {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        font-size: 0.72rem;
    }
    body.foundation-page .need-window-hint {
        font-size: 0.68rem;
    }
    body.foundation-page .need-card-edit-link {
        font-size: 0.78rem;
        padding: 5px 10px;
        margin-top: 4px;
    }
    body.foundation-page .need-card .foundation-status-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
    }
    body.foundation-page .need-urgent-badge {
        font-size: 9px;
        padding: 2px 7px;
        top: 4px;
        left: 4px;
    }
    body.foundation-page .need-card-status-overlay {
        left: 4px;
        bottom: 4px;
        gap: 4px;
    }
    body.foundation-page .my-needlist-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .need-card-img-rotator .need-img-rotator__dots--card {
        bottom: 4px;
    }
    .need-card-img-rotator .need-img-rotator__dot {
        width: 5px;
        height: 5px;
    }
}

body.foundation-page .need-card-img-wrap { position: relative; width: 100%; aspect-ratio: 4/3; background: #f3f4f6; overflow: hidden; }
body.foundation-page .need-card-img-split {
    display: grid;
    grid-template-columns: 1fr minmax(72px, 30%);
    aspect-ratio: 4/3;
}
body.foundation-page .need-card-img-primary {
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}
body.foundation-page .need-card-img-split .need-card-img,
body.foundation-page .need-card-img-split .need-card-noimg {
    width: 100%;
    height: 100%;
}
body.foundation-page .need-card-img-foundation {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef1f8 0%, #e2e8f3 100%);
    min-width: 0;
    min-height: 0;
}
body.foundation-page .need-card-fdn-label {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    font-size: 9px;
    font-weight: 800;
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px 7px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
body.foundation-page .need-card-img-fdn {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
body.foundation-page .need-card-img { width: 100%; height: 100%; object-fit: contain; object-position: center center; display: block; background: #fff; }
body.foundation-page .need-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 12px; text-align: center; padding: 8px; line-height: 1.35; }
body.foundation-page .need-urgent-badge { position: absolute; top: 8px; left: 8px; z-index: 2; background: #CE573F; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; pointer-events: none; }
/* สถานะบนรูป — สไตล์เดียวกับ .foundation-status-pill การ์ดโครงการ (project.css) */
body.foundation-page .need-card-status-overlay {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    max-width: calc(100% - 20px);
    pointer-events: none;
}
body.foundation-page .need-card .foundation-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin: 0;
    border-radius: 999px;
    padding: 5px 12px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    font-family: 'Prompt', sans-serif;
    line-height: 1.2;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
    box-sizing: border-box;
}
body.foundation-page .need-card .foundation-status-pill.st-approved {
    background: linear-gradient(135deg, #799677, #597D57);
    color: #fff;
}
body.foundation-page .need-card .foundation-status-pill.st-pending { background: #e3a91f; }
body.foundation-page .need-card .foundation-status-pill.st-rejected { background: #d66565; }
body.foundation-page .need-card .foundation-status-pill.st-need-closed {
    background: #475569;
    color: #fff;
}
body.foundation-page .need-card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
body.foundation-page .need-window-hint { font-size: 11px; color: #6b7280; display: block; margin-top: 0; }
body.foundation-page .need-card-name { font-size: 16px; font-weight: 700; color: #1f2937; line-height: 1.4; }
body.foundation-page .need-card-cat { font-size: 13px; color: #6b7280; line-height: 1.4; }
body.foundation-page .need-card-goal { font-size: 15px; font-weight: 700; color: #3C5099; }
body.foundation-page .need-period { font-size: 12px; font-weight: 400; color: #6b7280; }
body.foundation-page .needlist-cycle-hint {
    margin: -4px 0 10px;
    font-size: 13px;
    color: #556070;
    font-family: 'Sarabun', sans-serif;
}
body.foundation-page .need-card-desc { font-size: 12px; color: #6b7280; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.foundation-page .need-edit-wrap { display: none; margin-top: 10px; }
body.mode-edit-need.foundation-page .need-edit-wrap { display: block; }
body.mode-edit-need.foundation-page .need-card-tap-link { pointer-events: none; }
body.foundation-page .need-card-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    background: #F1CF54;
    color: #1f2937;
    font-family: 'Prompt', 'Sarabun', sans-serif;
}
body.foundation-page .need-card-edit-link:hover { background: #e8c94a; color: #1f2937; }
body.foundation-page .need-card-edit-link--disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.85;
}
body.foundation-page .need-card-edit-link--disabled:hover {
    background: #d1d5db;
    color: #6b7280;
}
body.foundation-page .needlist-flash {
    margin: 0 4px 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
    font-family: 'Sarabun', sans-serif;
}
body.foundation-page .foundation-view-actions .foundation-manage-btn-edit.btn-mode-active {
    background: #e8c94a;
    color: #1f2937;
    box-shadow: inset 0 0 0 2px rgba(31, 41, 55, 0.22);
}

body.foundation-add-need-page .need-current-files { margin-bottom: 14px; }
body.foundation-add-need-page .need-current-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
body.foundation-add-need-page .need-current-thumb {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}