/* ======================================================
   children.css — CSS ร่วมสำหรับหน้าที่เกี่ยวกับเด็ก
   ใช้ใน: children_.php, children_donate.php,
           foundation_add_children.php
   ====================================================== */
@import url('touch_feedback.css');

/* ── ตัวแปรสีร่วม ─────────────────────────────────── */
:root {
    --theme-primary:      #3C5099;
    --theme-primary-dark: #2e407f;
    --theme-soft:         #F1CF54;
    --theme-accent:       #18a999;
    --theme-ink:          #27364b;
    --theme-bg:           #F7ECDE;
    --theme-card:         #fff;
    --theme-border:       #F1CF54;
}

/* พื้นหลังหน้าเด็กทุกหน้า */
body {
    background: #F7ECDE;
}


/* =====================================================
   1. children_.php — รายการเด็ก
   ===================================================== */

body.donation-page {
    background: #fff;
    overflow-x: hidden;
}

body.admin-sidebar-page.donation-page {
    background: #F7ECDE;
}

.donation-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 56px;
    width: 100%;
    box-sizing: border-box;
}

/* แอดมิน children_.php — ตารางเด็กทั้งหมด (สไตล์เดียวกับ admin_directory) */
.donation-shell .children-admin-directory {
    margin-top: 0;
}

/* หัวข้อหน้า (แสดงก่อนปุ่มสำหรับมูลนิธิ) */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 38px;
    font-weight: 700;
    font-family: 'Prompt', sans-serif;
    color: #2e3f7f;
    line-height: 1.2;
}

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

.foundation-outcome-notice {
    margin-top: 12px;
    background: #fff6e7;
    border: 1px solid #f0c87a;
    color: #6b4b11;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: 'Sarabun', sans-serif;
}

.foundation-outcome-notice__list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.foundation-outcome-notice__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #2e3f7f;
    background: #ffffff;
    border: 1px solid #dfc28a;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.93rem;
    font-weight: 700;
}

.foundation-outcome-notice__item:hover {
    background: #f4f7ff;
}

.donation-shell .container {
    max-width: 100% !important;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    background: transparent !important;
    border-radius: 0;
    box-shadow: none;
}

.donation-band {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    margin-bottom: 0;
}

/* banner title used in children_.php */
.section-title {
    width: 100%;
    padding: 18px;
    text-align: center;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
    box-sizing: border-box;
}

.section-title.danger { background: #CC583F; }

.donation-band {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    margin-bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.donation-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.foundation-child-section-title {
    margin: 8px 0 14px;
    font-family: 'Prompt', 'Sarabun', sans-serif;
    font-size: 1.4rem;
    color: #2e3f7f;
    font-weight: 700;
}

.foundation-child-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-bottom: 14px;
}

.btn-create-profile {
    background: #3C5099;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    padding: 12px 20px;
    min-height: 46px;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-delete-selected {
    background: #CC583F;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    padding: 12px 20px;
    min-height: 46px;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-selected:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-update-outcome {
    background: #597D57;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    padding: 12px 20px;
    min-height: 46px;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 10px 20px rgba(89, 125, 87, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-update-outcome:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(89, 125, 87, 0.35);
    filter: brightness(1.03);
}

.btn-update-outcome--disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none;
}

.btn-toggle-edit {
    background: #F1CF54;
    color: #1f2937;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    padding: 12px 20px;
    min-height: 46px;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Grid การ์ดเด็ก ─── */
.donation-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px 14px;
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
}

.donation-grid > [class*="col-"] {
    display: flex;
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.donation-grid .child-card { width: 100%; }

.child-card {
    text-decoration: none;
    color: inherit;
    text-align: left;
    display: block;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(60, 80, 153, 0.14);
    touch-action: manipulation;
    transition: transform 0.2s ease, filter 0.12s ease;
    position: relative;
    z-index: 1;
}

.child-card:hover { transform: translateY(-4px); }

@media (hover: none) and (pointer: coarse) {
    .child-card:active {
        transform: scale(0.98);
        filter: brightness(0.96);
    }
}

body.mode-delete .child-card,
body.mode-edit .child-card {
    cursor: default;
}

.child-card-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.child-card-wrap .child-card { flex: 1; }

/* ชั้นลิงก์โปร่งใสครอบการ์ด — กดบนมือถือได้เสถียร (ไม่ซ้อนปุ่มใน <a>) */
.child-card-hit {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 12px;
    text-decoration: none;
    color: transparent;
    background: transparent;
    -webkit-tap-highlight-color: rgba(60, 80, 153, 0.12);
    touch-action: manipulation;
}

body.mode-delete .child-card-hit,
body.mode-edit .child-card-hit,
body.mode-outcome .child-card-hit {
    pointer-events: none;
    visibility: hidden;
}

.child-card-wrap .delete-corner {
    z-index: 5;
}

.child-card-wrap .edit-pill-wrap,
.child-card-wrap .inline-delete-actions,
.child-card-wrap .child-card-outcome-actions,
.child-card-wrap .btn-edit-pill,
.child-card-wrap .btn-card-outcome {
    position: relative;
    z-index: 3;
}

.card-actions {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 4px 2px;
}

body.mode-edit .card-actions.edit-mode { display: flex; }

/* ── delete corner checkbox ─── */
.delete-corner {
    display: none !important;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    padding: 0;
}

.delete-corner input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #CC583F;
    border-radius: 6px;
    cursor: pointer;
}

body.mode-delete .delete-corner { display: inline-flex !important; }

.delete-check:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.mode-edit .child-card[data-sponsored-locked="1"] {
    cursor: not-allowed;
}

body.mode-edit .child-card-wrap--sponsored-lock .child-card[data-sponsored-locked="1"] {
    outline: 2px dashed rgba(46, 127, 90, 0.35);
    outline-offset: 4px;
    border-radius: 12px;
}

body.mode-delete .child-card-wrap--bulk-protected {
    outline: 2px dashed rgba(100, 120, 80, 0.35);
    outline-offset: 4px;
    border-radius: 12px;
}
body.mode-delete .child-status-pill { display: none; }
body.mode-edit   .child-status-pill { display: none; }
body.mode-outcome .child-status-pill { display: none; }

/* ── edit pill ─── */
.edit-pill-wrap { display: none; margin-top: 8px; }
body.mode-edit .edit-pill-wrap { display: block; }

.btn-edit-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F1CF54, #e8b923);
    color: #3b2f09;
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
    min-height: 42px;
    min-width: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(15,23,42,0.10);
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* =============================
     Responsive สำหรับ Mobile
     ============================= */
@media (max-width: 600px) {
    .donation-shell {
        padding: 16px 2vw 24px;
    }
    .page-header h1 {
        font-size: 1.2rem;
    }
    .section-title {
        font-size: 1rem;
        padding: 10px;
    }
    .donation-top-actions, .foundation-action-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .btn-create-profile, .btn-delete-selected, .btn-toggle-edit {
        font-size: 1rem;
        padding: 8px 0;
        width: 100%;
    }
    .donation-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px 6px;
    }
    .child-card {
        font-size: 0.95rem;
    }
}

.btn-edit-pill:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(135deg, #e8e0c8, #dcd3b8);
    color: #6b6558;
}

/* ── inline delete actions ─── */
.inline-delete-actions {
    display: none;
    margin-top: 10px;
    gap: 8px;
    width: 100%;
}

/* ใช้ 2 คอลัมน์เพื่อให้ปุ่มยืนยันลบ/ยกเลิกอยู่ข้างกันเสมอ */
body.mode-delete .inline-delete-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.inline-delete-actions .confirm-inline {
    background: #CC583F;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 8px 10px;
    min-height: 42px;
    min-width: 0;
    width: 100%;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 14px rgba(15,23,42,0.10);
    text-align: center;
}

.inline-delete-actions .cancel-inline {
    background: #fff;
    color: #24324a;
    border: 1.5px solid #c7cdd7;
    border-radius: 999px;
    padding: 8px 10px;
    min-height: 42px;
    min-width: 0;
    width: 100%;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 14px rgba(15,23,42,0.10);
    text-align: center;
}

.btn-edit-profile {
    background: #F1CF54;
    color: #1f2937;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
}

.delete-check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #24324a;
    white-space: nowrap;
}

.delete-check-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #CC583F;
}

.reject-reason {
    margin-top: 7px;
    font-size: 0.84rem;
    color: #b3422f;
    font-weight: 700;
    line-height: 1.25;
}

/* ── card info inside grid ─── */
.donation-grid .card-info  { padding-top: 6px; }

.donation-grid .card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    position: relative;
}

.donation-grid .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.danger-bg { background-color: #CC583F; }

.donation-grid .card-info h3 {
    font-size: 1.6rem;
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #13213a;
}

.donation-grid .card-info p {
    font-size: 1.02rem;
    margin: 3px 0;
}

/* ── meta icons ─── */
.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #24324a;
    line-height: 1.25;
    font-weight: 600;
}

.meta-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex: 0 0 24px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.meta-icon.age        { background: #ffe5cf; color: #d9602f; }
.meta-icon.dream      { background: #e5f0ff; color: #2f59c7; }
.meta-icon.foundation { background: #e6f8ed; color: #2f8f55; }

/* ── status pill ─── */
.child-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 18px;
    margin-top: 10px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.3px;
    width: 100%;
    min-width: 0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

.child-status-pill.status-approved { background: linear-gradient(135deg, #799677, #597D57); color: #fff; }
.child-status-pill.status-pending  { background: linear-gradient(135deg, #f7cc47, #e8b923); color: #3b2f09; }
.child-status-pill.status-rejected { background: #CC583F; color: #fff; }

/* Responsive — children grid */
@media (max-width: 1199.98px) { .donation-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width:  991.98px) { .donation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width:  767.98px) {
    .donation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .donation-grid .card-info h3 { font-size: 1.05rem; }
    .donation-grid .card-info p  { font-size: 0.84rem; }
}
@media (max-width:  575.98px) { .donation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* =====================================================
   2. children_donate.php — โปรไฟล์เด็ก/หน้าบริจาค
   ===================================================== */

/* admin review card */
.admin-review-card {
    max-width: 1100px;
    margin: 24px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-review-header {
    background: #1e2f97;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    text-align: center;
}

.admin-review-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.admin-review-title h4,
.admin-review-title div { color: #fff; }

.admin-review-body { padding: 24px; }

.admin-review-layout {
    max-width: 760px;
    margin: 0 auto;
    justify-content: center;
}

.admin-image-col {
    display: flex;
    justify-content: center;
    width: 100%;
    flex: 0 0 100%;
}

.admin-details-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.admin-child-image {
    width: 100%;
    max-width: 320px;
    max-height: 360px;
    object-fit: cover;
    border-radius: 14px;
    background: #f3f3f3;
    box-shadow: 0 8px 22px rgba(15,23,42,0.08);
}

/* data grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.data-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
}

.data-item.full { grid-column: 1 / -1; }

.label {
    display: block;
    font-size: 0.86rem;
    color: #5b6470;
    margin-bottom: 4px;
}

.value {
    font-weight: 600;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* admin action buttons */
.admin-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-actions .btn {
    min-width: 150px;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(15,23,42,0.12);
}

.admin-actions .btn-primary { background: #597D57; color: #fff; }
.admin-actions .btn-danger  { background: #CC583F; color: #fff; border-color: #CC583F; }
.admin-actions .btn-danger:hover,
.admin-actions .btn-danger:focus { background: #b04a33; border-color: #b04a33; color: #fff; }
.admin-actions .btn:hover   { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(15,23,42,0.14); }

/* extra info panel */
.extra-info-panel {
    margin-top: 18px;
    width: 100%;
    background: rgba(255,255,255,0.35);
    border-radius: 16px;
    padding: 16px 18px;
    text-align: left;
}

.extra-info-panel h4 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; color: #182338; }

.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.extra-grid div { font-size: .94rem; color: #27364b; font-weight: 600; }

.qr-preview {
    margin-top: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(24,36,58,0.15);
    padding: 8px;
    display: inline-flex;
}

.qr-preview img { width: 110px; height: 110px; object-fit: contain; }

main.child-profile-main {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 1100px !important;
    border-radius: 0 !important;
}

/* donation stats panel */
.donation-stats-panel { width: 100%; margin-top: 18px; margin-bottom: 18px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }

.stat-box { flex: 1; min-width: 140px; border-radius: 12px; padding: 16px 12px; text-align: center; }
.stats-row .stat-box:nth-child(1) { background: #d7eef8; }
.stats-row .stat-box:nth-child(2) { background: #f8d8e5; }
.stats-row .stat-box:nth-child(3) { background: #f8dca8; }
.stats-row .stat-box:nth-child(4) { background: #e8f5e9; }

.stat-box .stat-num   { font-size: 2rem;  font-weight: 900; color: #1a1f3a; line-height: 1; }
.stat-box .stat-label { font-size: 1rem;  color: #4b5563;   font-weight: 800; margin-top: 6px; }

.stats-row .stat-box:nth-child(1) .stat-icon,
.stats-row .stat-box:nth-child(1) .stat-num,
.stats-row .stat-box:nth-child(1) .stat-label { color: #3C5099; }

.stats-row .stat-box:nth-child(2) .stat-icon,
.stats-row .stat-box:nth-child(2) .stat-num,
.stats-row .stat-box:nth-child(2) .stat-label { color: #597D57; }

.stats-row .stat-box:nth-child(3) .stat-icon,
.stats-row .stat-box:nth-child(3) .stat-num,
.stats-row .stat-box:nth-child(3) .stat-label { color: #CC583F; }

.stats-row .stat-box:nth-child(4) .stat-icon,
.stats-row .stat-box:nth-child(4) .stat-num,
.stats-row .stat-box:nth-child(4) .stat-label { color: #2e7d32; }

.foundation-sponsors-details { margin-top: 8px; }
.foundation-sponsors-details__summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: #3C5099;
    user-select: none;
}
.foundation-sponsors-details__summary::-webkit-details-marker { display: none; }
.foundation-sponsors-details__body {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(60, 80, 153, 0.15);
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.5;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin-bottom: 8px;
    font-size: 34px;
    background: transparent;
    line-height: 1;
}

/* admin_approve_projects.php — ตรวจสอบโครงการ (รูปแบบเดียวกับตรวจสอบเด็ก) */
body.admin-approve-projects-page {
    background: #f5f0e8;
    min-height: 100vh;
}

.admin-project-review .admin-review-layout {
    max-width: 1100px;
}

.admin-project-review .admin-details-col .data-grid {
    max-width: 100%;
}

.admin-project-review .admin-image-col {
    align-items: flex-start;
}

.admin-project-cover {
    width: 100%;
    max-width: 320px;
    max-height: 360px;
    object-fit: cover;
    border-radius: 14px;
    background: #f3f3f3;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    display: block;
}

.admin-project-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-project-review .admin-actions textarea[name="remark"] {
    min-width: 280px;
    min-height: 96px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    font-family: inherit;
    resize: vertical;
}

/* Unified review actions (foundation/child/project/need inspect pages) */
.admin-review-actions-note {
    max-width: 620px;
    margin: 0 auto 8px;
    text-align: center;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.45;
}

.admin-review-actions-form {
    margin-top: 8px;
}

.admin-review-actions-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(112px, 132px) minmax(112px, 132px);
    gap: 10px 12px;
    align-items: start;
}

.admin-review-actions-grid textarea {
    width: 100%;
    min-height: 76px;
    border-radius: 10px;
    border: 1px solid #dfe5ee;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
}

.admin-review-actions-grid textarea:focus {
    outline: 2px solid rgba(60, 80, 153, 0.28);
    border-color: #3C5099;
}

.admin-review-actions-grid .admin-review-action-btn.btn {
    width: 100%;
    min-height: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.admin-review-action-btn.btn-success {
    background: #597D57;
    border-color: #597D57;
    color: #fff;
}

.admin-review-action-btn.btn-danger {
    background: #CC583F;
    border-color: #CC583F;
    color: #fff;
}

.admin-review-action-btn.btn-danger:hover,
.admin-review-action-btn.btn-danger:focus {
    background: #b04a33;
    border-color: #b04a33;
}

.admin-review-action-btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .admin-review-actions-grid {
        grid-template-columns: 1fr;
    }
    .admin-review-actions-grid .admin-review-action-btn.btn {
        min-height: 0;
        padding: 10px 14px;
        font-size: 0.98rem;
    }
}

.admin-project-review .stat-num--date {
    font-size: 1.35rem;
    line-height: 1.15;
}

/* child admin review: compact layout (match legacy card) */
body.admin-child-review-page {
    background: #F7ECDE;
}

body.admin-child-review-page .admin-child-review-main {
    max-width: 860px;
    margin: 18px auto 28px;
}

body.admin-child-review-page .admin-review-card {
    max-width: 760px;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

body.admin-child-review-page .admin-review-header {
    padding: 10px 16px;
}

body.admin-child-review-page .admin-review-title h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

body.admin-child-review-page .admin-review-title div {
    font-size: 0.78rem;
    margin-top: 2px;
    opacity: 0.95;
}

body.admin-child-review-page .admin-review-body {
    padding: 14px 16px 16px;
}

body.admin-child-review-page .admin-review-layout {
    max-width: 640px;
    margin: 0 auto;
}

body.admin-child-review-page .admin-image-col {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

body.admin-child-review-page .admin-child-image {
    width: 140px;
    height: 170px;
    border-radius: 10px;
    max-width: none;
    max-height: none;
    box-shadow: none;
    border: 1px solid #d7dee8;
}

body.admin-child-review-page .admin-details-col {
    width: 100%;
}

body.admin-child-review-page .data-grid {
    max-width: 560px;
    gap: 8px 10px;
}

body.admin-child-review-page .data-item {
    border-radius: 8px;
    padding: 8px 10px;
}

body.admin-child-review-page .label {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

body.admin-child-review-page .value {
    font-size: 0.92rem;
}

body.admin-child-review-page .donation-stats-panel {
    margin-top: 10px !important;
    margin-bottom: 10px;
}

body.admin-child-review-page .stats-row {
    gap: 8px;
}

body.admin-child-review-page .stat-box {
    min-width: 120px;
    border-radius: 8px;
    padding: 10px 8px;
}

body.admin-child-review-page .stat-box .stat-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

body.admin-child-review-page .stat-box .stat-num {
    font-size: 1.75rem;
}

body.admin-child-review-page .stat-box .stat-label {
    font-size: 0.82rem;
    line-height: 1.25;
}

body.admin-child-review-page .admin-review-actions-note {
    margin-bottom: 6px;
    font-size: 0.76rem;
}

body.admin-child-review-page .admin-review-actions-grid {
    grid-template-columns: minmax(150px, 1fr) 106px 106px;
    gap: 8px;
}

body.admin-child-review-page .admin-review-actions-grid textarea {
    min-height: 52px;
    font-size: 0.84rem;
    padding: 7px 9px;
}

body.admin-child-review-page .admin-review-actions-grid .admin-review-action-btn.btn {
    padding: 8px 8px;
    font-size: 0.92rem;
    border-radius: 8px;
}

.foundation-sponsors-list {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(60, 80, 153, 0.18);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    color: #1f2b46;
}

.foundation-sponsors-list strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.foundation-sponsors-list p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.foundation-sponsors-latest {
    margin: 0 0 6px;
    font-size: 0.92rem;
    color: #2f3f7a;
    font-weight: 600;
}

.foundation-sponsors-latest__name {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #edf2ff;
    border: 1px solid #cfd9ff;
    color: #1f2b46;
    font-weight: 700;
}

.foundation-sponsors-latest__time {
    margin-left: 6px;
    color: #516080;
    font-size: 0.85rem;
    font-weight: 500;
}

.foundation-sponsors-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.foundation-sponsors-status-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(60, 80, 153, 0.12);
    font-size: 0.92rem;
    line-height: 1.45;
}
.foundation-sponsors-status-item:last-child { border-bottom: 0; }
.foundation-sponsors-status-item__name {
    font-weight: 700;
    color: #1f2b46;
}
.foundation-sponsors-status-item__detail {
    width: 100%;
    font-size: 0.85rem;
    color: #516080;
}
.foundation-sponsor-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: normal;
}
.foundation-sponsor-badge--active {
    background: #e8f5e9;
    border-color: #81c784;
    color: #1b5e20;
}
.foundation-sponsor-badge--paused {
    background: #fff8e1;
    border-color: #ffcc80;
    color: #e65100;
}
.foundation-sponsor-badge--cancelled {
    background: #fce4ec;
    border-color: #f48fb1;
    color: #880e4f;
}
.foundation-sponsor-badge--onetime {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
}
.foundation-sponsor-badge--other {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* foundation contact info */
.foundation-full-info { width: 100%; margin-top: 16px; margin-bottom: 12px; text-align: left; }
.foundation-full-info h4 { margin: 0 0 10px; font-size: 1.35rem; font-weight: 800; color: #1f2937; }
.foundation-full-info p  { margin: 0 0 6px; font-size: 1.25rem; color: #27364b; font-weight: 600; line-height: 2.1; }

/* profile card (donor view) */
.custom-profile-card {
    background-color: #F8CE32;
    border-radius: 40px;
    padding: 50px;
    position: relative;
    max-width: 1000px;
    margin: auto;
}

.profile-labels {
    position: absolute;
    top: -44px;
    left: 50px;
    display: flex;
    gap: 8px;
}
.profile-label-tab {
    background-color: #e7c84d;
    padding: 10px 24px;
    border-radius: 18px 18px 0 0;
    font-weight: 700;
    font-size: 1rem;
    color: #6f6030;
    text-decoration: none;
}
.profile-label-tab.is-active {
    background-color: #F8CE32;
    color: #333;
}
.profile-label-tab:hover {
    text-decoration: none;
    color: #333;
}

.profile-inner { display: flex; flex-direction: row; gap: 40px; align-items: flex-start; }

.col-left { flex: 0 0 300px; min-width: 260px; display: flex; flex-direction: column; }

.child-img-container {
    background-color: #E56B51;
    border-radius: 24px;
    width: 100%;
    height: 310px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.child-img-container img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.child-details { margin-top: 18px; color: #333; font-size: 1.25rem; line-height: 2.1; }
.child-details p { margin: 0; }
.child-details strong { font-size: 1.25rem; }
.child-cancel-below-wish-form,
.child-cancel-below-photo-form {
    margin-top: 12px;
}
.col-left {
    display: flex;
    flex-direction: column;
}
.child-img-container {
    order: 1;
}
.child-details {
    order: 2;
}
.child-cancel-below-photo-form {
    order: 3;
}

.col-right { flex: 1; display: flex; flex-direction: column; align-items: stretch; text-align: center; min-width: 0; }

.brand-header { font-size: 3.5rem; font-weight: 900; color: #222; margin-bottom: 10px; letter-spacing: -1px; line-height: 1.1; }
.donate-text  { font-size: 1rem; color: #333; margin-bottom: 28px; line-height: 1.7; }

.money-row { display: flex; gap: 14px; width: 100%; margin-bottom: 14px; }

.btn-money-choice {
    background-color: #fff;
    border: none;
    border-radius: 18px;
    padding: 18px 10px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #222;
    flex: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn-money-choice.active { background-color: #3C5099; color: #fff; }

.amount-box {
    background-color: #fff;
    border-radius: 18px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 75px;
}

.amount-box input {
    border: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 800;
    color: #222;
    width: 80%;
    outline: none;
}

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

.amount-box input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.currency-label { font-size: 1.2rem; font-weight: 600; color: #aaa; }

.btn-submit-donation {
    background-color: #3C5099;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 20px;
    font-size: 1.8rem;
    font-weight: 800;
    width: 100%;
    margin-top: 18px;
    box-shadow: none;
    cursor: pointer;
}

.btn-submit-donation:hover {
    background-color: #344788;
    color: #fff;
}

/* Payment method selector (แสดงใน children_donate.php) */
.payment-methods-wrap {
    display: flex;
    gap: 12px;
    width: 100%;
    margin: 14px 0 4px;
}

.payment-method-option {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    background: #fff;
    border: 2.5px solid transparent;
    border-radius: 14px;
    padding: 13px 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    transition: border-color .15s, background .15s;
    position: relative;
    user-select: none;
}

.payment-method-option.active {
    border-color: #4A5CB5;
    background: #eef0fb;
}

.pm-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.pm-check {
    margin-left: auto;
    color: #4A5CB5;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity .15s;
}

.payment-method-option.active .pm-check { opacity: 1; }

/* อุปการะรายรอบ Omise (children_donate) — เต็มความกว้างคอลัมน์ขวา ให้แถวปุ่มกับ summary/ปุ่มบริจาคเสมอกัน */
.child-subscription-box {
    width: 100%;
    max-width: none;
    align-self: stretch;
    box-sizing: border-box;
}
.child-omise-test-hint {
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #854d0e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    text-align: left;
}
.child-omise-test-hint__mono {
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 600;
    color: #713f12;
}
.child-sub-active-notice {
    padding: 14px 16px;
    background: #eef7ee;
    border-radius: 14px;
    border: 1px solid #b9d9b8;
    font-size: 1rem;
    line-height: 1.5;
}
.child-sub-cancelled-notice {
    margin: 12px 0 16px;
    padding: 14px 16px;
    background: #f5f7ff;
    border-radius: 14px;
    border: 1px solid #c7d1f7;
}
.child-sub-cancelled-notice__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
    color: #21327b;
    margin-bottom: 6px;
}
.child-sub-cancelled-notice__meta,
.child-sub-cancelled-notice__progress,
.child-sub-cancelled-notice__hint {
    color: #223;
    font-size: 0.95rem;
    line-height: 1.5;
}
.child-sub-cancelled-notice__hint {
    margin-top: 4px;
    font-weight: 700;
    color: #1f2b63;
}
/* แถวปุ่มแพ็ก — เต็มแถว ปุ่มใหญ่สมส่วนกับกล่องเหลือง */
.sub-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.sub-plan-btn {
    margin: 0;
    border: 1px solid #c9ccd4;
    background: #fff;
    border-radius: 14px;
    padding: 18px 12px;
    font-size: 1.55rem;
    font-weight: 800;
    color: #111;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    line-height: 1.15;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.sub-plan-btn:hover {
    border-color: #9aa3b5;
    background: #fafbfd;
}
.sub-plan-btn.active {
    border-width: 2px;
    border-color: #4054b2;
    background: #eef0fb;
    color: #1a237e;
    box-shadow: 0 0 0 1px rgba(64, 84, 178, 0.12);
}
/* แถวสรุป — ขอบกว้างเท่าแถวปุ่ม */
.sub-plan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    min-height: 64px;
    background: #fff;
    border: 1px solid #c9ccd4;
    border-radius: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.sub-summary-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}
.sub-summary-sep {
    color: #999;
    font-weight: 400;
}
.sub-summary-period {
    color: #444;
}
.sub-summary-amt {
    font-size: 1.35rem;
    font-weight: 800;
    color: #111;
    white-space: nowrap;
}
.sub-plan-summary--prominent {
    min-height: 92px;
    padding: 22px 26px;
    margin-bottom: 16px;
}
.sub-plan-summary--prominent .sub-summary-main {
    font-size: 1.2rem;
    font-weight: 700;
}
.sub-plan-summary--prominent .sub-summary-period {
    color: #222;
    font-size: 1.22rem;
}
.sub-plan-summary--prominent .sub-summary-amt {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}
.sub-hint {
    line-height: 1.45;
}
/* ปุ่มบริจาค — ความกว้างเท่าแถวด้านบน */
.child-sub-form {
    width: 100%;
    box-sizing: border-box;
}
.child-sub-form .btn-submit-donation--sub {
    border-radius: 14px;
    padding: 18px 22px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    background-color: #4054b2;
}
.child-sub-form .btn-submit-donation--sub:hover {
    background-color: #344397;
}

.sub-section--hidden {
    display: none !important;
}

/* รายวัน — กรอกยอดเอง → PromptPay */
.sub-daily-amount-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    min-height: 64px;
    border: 1px solid #c9ccd4;
    border-radius: 14px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: #111;
    margin-bottom: 8px;
    font-family: inherit;
}
.sub-daily-amount-input::placeholder {
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
}

.child-daily-form {
    width: 100%;
    box-sizing: border-box;
}
.sub-daily-limit-note {
    font-size: 0.86rem;
    color: #374151;
    margin: 4px 0 10px;
    font-weight: 600;
}
/* การ์ด PromptPay — ให้ตรงกับ payment_project.php + css/payment.css */
.child-daily-payment-method {
    margin-bottom: 12px;
}
.child-daily-payment-method .method-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid rgba(60, 80, 153, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #f5f7fd 0%, #eef0fb 100%);
    color: #24314a;
    box-shadow: 0 2px 12px rgba(60, 80, 153, 0.12);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: default;
    user-select: none;
}
.child-daily-payment-method .method-card.active {
    border-color: #3c5099;
    background: linear-gradient(180deg, #eef1fc 0%, #e4e9f8 100%);
    box-shadow: 0 3px 14px rgba(60, 80, 153, 0.2);
}
.child-daily-payment-method .method-icon {
    height: 30px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}
.child-daily-form .btn-submit-donation--sub {
    border-radius: 14px;
    padding: 18px 22px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    background-color: #4054b2;
}
.child-daily-form .btn-submit-donation--sub:hover {
    background-color: #344397;
}

/* รายเดือน — เลือก 700 หรือ 4200 ในปุ่มเดียวกัน (คอลัมน์) */
.sub-cycle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.sub-cycle-btn {
    margin: 0;
    border: 1px solid #c9ccd4;
    background: #fff;
    border-radius: 14px;
    padding: 14px 10px;
    min-height: 72px;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.sub-cycle-btn:hover {
    border-color: #9aa3b5;
    background: #fafbfd;
}
.sub-cycle-btn.active {
    border-width: 2px;
    border-color: #4054b2;
    background: #eef0fb;
    box-shadow: 0 0 0 1px rgba(64, 84, 178, 0.12);
}
.sub-cycle-amt {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111;
    line-height: 1.1;
}
.sub-cycle-note {
    font-size: 0.8rem;
    font-weight: 700;
    color: #444;
    line-height: 1.2;
    text-align: center;
}

/* Responsive — children_donate */
@media (max-width: 768px) {
    .data-grid { grid-template-columns: 1fr; }
    .profile-inner { flex-direction: column; }
    .col-left { width: 100%; }
    .admin-review-header { flex-direction: column; align-items: center; padding-top: 56px; }
    .admin-details-col { width: 100%; }
}

/*
 * children_donate.php — มือถือ: รูป+ข้อมูลใหญ่ขึ้น ปุ่มยกเลิกใต้รูป ข้อความ Drawdream เล็กลง
 */
@media (max-width: 768px) {
    main.child-profile-main.container {
        max-width: 100% !important;
        padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
        margin-top: 1rem !important;
        margin-bottom: 2rem !important;
    }

    main.child-profile-main .custom-profile-card {
        padding: 24px 16px 20px;
        border-radius: 28px;
        margin-left: auto;
        margin-right: auto;
    }

    /* แท็บ «เด็กรายบุคคล» — ไม่ซ้อนทับขอบบน (มือถือ) */
    main.child-profile-main .profile-labels {
        position: static;
        left: auto;
        top: auto;
        margin: 0 0 14px;
        padding: 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    main.child-profile-main .profile-label-tab {
        padding: 9px 18px;
        font-size: 0.95rem;
        border-radius: 14px 14px 0 0;
    }

    main.child-profile-main .profile-inner {
        gap: 20px;
        align-items: stretch;
    }

    main.child-profile-main .col-left {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        width: 100%;
        display: grid;
        grid-template-columns: clamp(132px, 36vw, 172px) minmax(0, 1fr);
        column-gap: 14px;
        row-gap: 8px;
        align-items: start;
    }

    main.child-profile-main .child-img-container {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: clamp(132px, 36vw, 172px);
        max-height: none;
        border-radius: 18px;
    }

    main.child-profile-main .child-cancel-below-photo-form {
        display: block;
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        width: 100%;
        min-width: 0;
    }

    main.child-profile-main .col-right {
        padding: 0 2px;
        width: 100%;
    }

    main.child-profile-main .brand-header {
        font-size: clamp(1.25rem, 5.5vw, 1.55rem);
        letter-spacing: -0.01em;
        margin-bottom: 4px;
        font-weight: 800;
    }

    main.child-profile-main .child-details {
        grid-column: 2;
        grid-row: 1 / span 2;
        margin-top: 0;
        font-size: 0.98rem;
        line-height: 1.45;
        display: flex;
        flex-direction: column;
        gap: 3px;
        align-content: start;
    }

    main.child-profile-main .child-details > p {
        margin: 0;
        width: 100%;
    }

    main.child-profile-main .child-details > form,
    main.child-profile-main .child-cancel-below-wish-form {
        margin-top: 4px;
        width: 100%;
    }

    main.child-profile-main .child-details strong {
        font-size: 0.98rem;
        font-weight: 700;
    }

    main.child-profile-main .btn-subscription-cancel--compact {
        font-size: 0.72rem;
        padding: 6px 8px;
        border-radius: 999px;
    }

    main.child-profile-main .donate-text {
        font-size: 0.8rem;
        line-height: 1.5;
        margin-bottom: 14px;
        padding: 0 2px;
        color: #444;
    }

    main.child-profile-main .donation-stats-panel {
        margin-top: 12px;
        margin-bottom: 14px;
    }

    main.child-profile-main .stats-row {
        gap: 10px;
    }

    main.child-profile-main .stat-box {
        min-width: calc(50% - 8px);
        flex: 1 1 calc(50% - 8px);
        padding: 12px 8px;
    }

    main.child-profile-main .stat-box .stat-num {
        font-size: 1.45rem;
    }

    main.child-profile-main .stat-box .stat-label {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    main.child-profile-main .foundation-full-info {
        text-align: left;
        padding: 0 2px;
    }

    main.child-profile-main .foundation-full-info h4 {
        font-size: 1.15rem;
    }

    main.child-profile-main .foundation-full-info p {
        font-size: 1.05rem;
        line-height: 1.65;
    }

    main.child-profile-main .foundation-sponsors-list {
        font-size: 0.92rem;
        text-align: left;
    }

    main.child-profile-main .child-sub-cancelled-notice {
        margin: 10px 0 14px;
        padding: 12px 14px;
    }

    main.child-profile-main .child-subscription-box {
        margin-top: 10px !important;
    }
}

@media (max-width: 480px) {
    main.child-profile-main .custom-profile-card {
        padding: 18px 12px 16px;
        border-radius: 22px;
    }

    main.child-profile-main .col-left {
        grid-template-columns: clamp(118px, 34vw, 148px) minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 6px;
    }

    main.child-profile-main .child-img-container {
        height: clamp(118px, 34vw, 148px);
        border-radius: 16px;
    }

    main.child-profile-main .child-details {
        font-size: 0.92rem;
        line-height: 1.42;
        gap: 3px;
    }

    main.child-profile-main .child-details strong {
        font-size: 0.92rem;
    }

    main.child-profile-main .btn-subscription-cancel--compact {
        font-size: 0.68rem;
        padding: 5px 6px;
    }

    main.child-profile-main .brand-header {
        font-size: clamp(1.15rem, 5vw, 1.4rem);
    }

    main.child-profile-main .donate-text {
        font-size: 0.76rem;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    main.child-profile-main .sub-plan-btn {
        padding: 14px 6px;
        font-size: 1.2rem;
        min-height: 52px;
    }

    main.child-profile-main .sub-plan-grid {
        gap: 8px;
    }

    main.child-profile-main .sub-cycle-btn {
        min-height: 64px;
        padding: 12px 8px;
    }

    main.child-profile-main .sub-cycle-amt {
        font-size: 1.2rem;
    }

    main.child-profile-main .sub-plan-summary--prominent {
        padding: 16px 14px;
        min-height: 76px;
    }

    main.child-profile-main .sub-plan-summary--prominent .sub-summary-amt {
        font-size: 1.55rem;
    }

    main.child-profile-main .btn-submit-donation--sub,
    main.child-profile-main .child-daily-form .btn-submit-donation--sub,
    main.child-profile-main .child-sub-form .btn-submit-donation--sub {
        font-size: 1.2rem;
        padding: 16px 16px;
    }
}


/* =====================================================
   3. foundation_add_children.php — สร้างโปรไฟล์เด็ก
   ===================================================== */

.form-container { display: flex; gap: 42px; padding: 42px 40px; max-width: 1280px; margin: auto; }
.left-box { width: 32%; flex-shrink: 0; }

.left-panel-title {
    color: #24314a;
    margin-bottom: 8px;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.left-foundation-name {
    color: #000;
    font-size: 1.2rem;
    margin-bottom: 18px;
    font-weight: 600;
    text-align: center;
}

.upload-preview {
    width: 100%;
    aspect-ratio: 1;
    background: #de8168;
    border: 4px dashed #597D57;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
}

.upload-preview img  { width: 100%; height: 100%; object-fit: cover; }
.upload-preview span { color: #fff; font-size: 16px; font-weight: 600; }

.left-info-card {
    margin-top: 14px;
    background: #fff;
    border: 1.5px solid var(--theme-border);
    border-radius: 14px;
    padding: 14px 14px 10px;
    box-shadow: 0 4px 12px rgba(16,53,90,0.05);
    text-align: center;
}

.left-info-card.has-error {
    border-color: #CC583F;
    box-shadow: 0 0 0 3px rgba(204,88,63,0.15);
}

.left-info-card h3 { margin: 0 0 9px; font-size: 1.35rem; color: #17406a; font-weight: 800; }

/* consent */
.consent-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 10px;
    font-size: 1.18rem;
    font-weight: 700;
}

.consent-check input[type="checkbox"] { width: 20px; height: 20px; accent-color: #2c7be5; cursor: pointer; }
.consent-link { color: #3C5099; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.consent-link:hover { color: #304083; }
.consent-note { margin-top: 8px; font-size: 1rem; color: #CC583F; line-height: 1.45; font-weight: 700; }

/* toast alert */
.top-alert {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -16px);
    background: #CC583F;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(204,88,63,0.34);
    font-size: 1rem;
    font-weight: 700;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    max-width: min(92vw, 720px);
}

.top-alert.show { opacity: 1; transform: translate(-50%, 0); }

/* right form box */
.right-box {
    flex: 1;
    background: var(--theme-card);
    padding: 34px;
    border-radius: 22px;
    border: 1.5px solid var(--theme-border);
    box-shadow: 0 10px 26px rgba(25,48,77,0.08);
}

.right-box h2 { margin: 0 0 22px; font-size: 1.45rem; color: var(--theme-ink); }

.grid-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field-group { display: flex; flex-direction: column; }
.field-group label { font-weight: 700; font-size: 1rem; margin-bottom: 6px; color: #1f3654; }

.field-group input,
.field-group textarea,
.field-group select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--theme-border);
    font-size: 1.08rem;
    box-sizing: border-box;
    background: #fff;
}

.field-group input::placeholder,
.field-group textarea::placeholder { font-size: 1.02rem; }

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
    border-color: var(--theme-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(60,80,153,.14);
}

.field-group textarea { resize: vertical; }
.field-group small    { color: #7c8aa0; font-size: 0.85rem; margin-top: 4px; }

.full-width { grid-column: span 2; }

/* date picker */
.date-input-wrap { position: relative; }
.date-input-wrap #birth_date_display { padding-right: 54px; }

.date-picker-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #27364b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.date-picker-btn:hover { background: rgba(60,80,153,0.08); }

.native-date-picker {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    border: 0;
}

/* bank dropdown */
.bank-select-wrapper { position: relative; }
.bank-select-wrapper select { padding-left: 54px; }

.bank-logo-preview {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    pointer-events: none;
    display: none;
    background: #fff;
}

/* category tag pills */
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 22px;
    border: 1.8px solid var(--theme-border);
    background: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: all .16s;
    color: #324a68;
    font-weight: 600;
}

.cat-tag:hover  { border-color: var(--theme-primary); background: #eef2ff; }
.cat-tag.active { border-color: var(--theme-primary); background: var(--theme-soft); color: var(--theme-primary); }
.cat-tag .cat-icon { font-size: 1.07rem; }

.item-select-wrap  { display: grid; grid-template-columns: 1fr; gap: 8px; }
.wish-custom-wrap  { display: none; }
.item-hint         { color: #5f6f87; font-size: 0.9rem; }
select.dream-sel   { width: 100%; }
.dream-other-wrap  { display: none; margin-top: 8px; }

/* submit button */
.btn-submit {
    background: var(--theme-primary);
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 13px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 800;
    width: 100%;
    margin-top: 12px;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 7px 14px rgba(60,80,153,0.28);
}

.btn-submit:hover    { transform: translateY(-1px); background: var(--theme-primary-dark); box-shadow: 0 10px 18px rgba(60,80,153,0.32); }
.btn-submit:disabled { background: #F1CF54; color: #000; cursor: not-allowed; box-shadow: none; transform: none; opacity: .78; }

/* error highlighting */
.has-error input,
.has-error select,
.has-error textarea { border-color: #CC583F !important; box-shadow: 0 0 0 3px rgba(204,88,63,.15) !important; }
.has-error label    { color: #CC583F; }
.has-error .cat-tags { outline: 2.5px solid #CC583F; border-radius: 10px; }

/* size picker */
.size-pick-wrap {
    margin-top: 8px;
    background: #fdf8ee;
    border: 1.5px solid var(--theme-border);
    border-radius: 12px;
    padding: 10px 13px;
}

.size-pick-wrap.has-error            { border-color: #CC583F; }
.size-pick-wrap.has-error .size-pick-label { color: #CC583F; }
.size-pick-label { display: block; font-weight: 700; font-size: .95rem; color: #1f3654; margin-bottom: 7px; }
.size-btn-group  { display: flex; flex-wrap: wrap; gap: 8px; }

.size-btn {
    min-width: 42px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1.8px solid var(--theme-border);
    background: #fff;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    color: #324a68;
    transition: all .14s;
    line-height: 1;
}

.size-btn:hover  { border-color: var(--theme-primary); background: #eef2ff; }
.size-btn.active { border-color: var(--theme-primary); background: var(--theme-soft); color: var(--theme-primary); }

/* Responsive — add children form */
@media (max-width: 860px) {
    .form-container { flex-direction: column; padding: 20px; }
    .left-box { width: 100%; }
    .grid-inputs { grid-template-columns: 1fr; }
    .full-width  { grid-column: span 1; }
}


/* =====================================================
   4. กลุ่มฟอร์มสำรอง (legacy style)
   ===================================================== */

/* scoped ไว้ใน .wrap เพื่อไม่ให้ input/label ทับ global */
.wrap {
    max-width: 900px;
    margin: 26px auto;
    background: #fff;
    border: 1px solid #f1cf54;
    border-radius: 16px;
    padding: 22px;
}

.wrap .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wrap .group { display: flex; flex-direction: column; }
.wrap .group.full { grid-column: 1 / -1; }
.wrap label { font-weight: 700; margin-bottom: 6px; }

.wrap input,
.wrap select,
.wrap textarea { border: 1.5px solid #f1cf54; border-radius: 10px; padding: 10px 12px; font-size: 1rem; }

.wrap textarea { min-height: 90px; resize: vertical; }
.wrap .actions { display: flex; gap: 10px; margin-top: 16px; }

.wrap .actions .btn {
    padding: 12px 20px;
    min-height: 50px;
    font-size: 1.08rem;
    font-weight: 800;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-save { background: #3C5099; color: #fff; }
.btn-back { background: #CC583F; color: #fff; }

.wrap .alert     { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-weight: 700; }
.wrap .alert.err { background: #fde8e8; color: #b32525; }

.note { color: #6b7280; font-size: .9rem; margin-top: 5px; }

@media (max-width: 780px) { .wrap .grid { grid-template-columns: 1fr; } }


/* =====================================================
   5. admin_children.php — เพิ่มโปรไฟล์เด็ก (foundation)
   ===================================================== */

body.admin-children-page .form-container {
    display: flex;
    gap: 60px;
    padding: 40px;
    max-width: 1200px;
    margin: auto;
}

body.admin-children-page .left-box { width: 35%; }

body.admin-children-page .admin-title { color: #333; }

body.admin-children-page .admin-foundation { color: #777; }

body.admin-children-page .upload-preview {
    width: 100%;
    height: 350px;
    background: #f0f0f0;
    border: 2px dashed #bbb;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body.admin-children-page .upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.admin-children-page .right-box {
    width: 65%;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.admin-children-page .grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

body.admin-children-page label {
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

body.admin-children-page input,
body.admin-children-page textarea,
body.admin-children-page select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    box-sizing: border-box;
}

body.admin-children-page .full-width { grid-column: span 2; }

body.admin-children-page .edu-help { color: #777; }

body.admin-children-page button {
    background: #e5c24c;
    padding: 15px 50px;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    margin-top: 10px;
}

body.admin-children-page button:hover { background: #d4b13a; }

@media (max-width: 860px) {
    body.admin-children-page .form-container {
        flex-direction: column;
        gap: 18px;
        padding: 20px;
    }

    body.admin-children-page .left-box,
    body.admin-children-page .right-box {
        width: 100%;
    }

    body.admin-children-page .grid-inputs { grid-template-columns: 1fr; }
    body.admin-children-page .full-width { grid-column: span 1; }
}

/* โมดัลนโยบาย (foundation_add_children) */
.consent-link--btn {
    font: inherit;
    font-size: 0.95rem;
    color: var(--theme-primary, #3C5099);
    text-decoration: underline;
    background: #eef1f4;
    border: 1px solid #d8dde3;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    box-sizing: border-box;
    text-align: left;
    max-width: 100%;
}
.consent-link--btn:hover {
    color: var(--theme-primary-dark, #2e407f);
    background: #e4e8ed;
}

.policy-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.policy-modal.policy-modal--open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}
.policy-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 40, 0.55);
}
.policy-modal__panel {
    position: relative;
    width: min(720px, 100%);
    max-height: min(88vh, 900px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.policy-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e8e4dc;
    background: #faf8f4;
}
.policy-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #24314a;
}
.policy-modal__close {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #5c6570;
    padding: 4px 8px;
    border-radius: 8px;
}
.policy-modal__close:hover {
    background: #eee;
    color: #222;
}
.policy-modal__body {
    overflow: auto;
    flex: 1;
    padding: 0;
}
.policy-modal__paper {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
}

/* หัวข้อแบ่งกลุ่มเด็ก (children_.php) — ขนาดฟอนต์เท่าแถบบริจาคให้เด็กรายบุคคล */
.child-section-wrap {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 32px;
    box-sizing: border-box;
}
.child-section-bar {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    color: #fff;
    text-align: center;
    font-weight: 800;
    font-size: 1.4rem;
    padding: 18px 16px;
    border-radius: 0;
    margin-top: 0;
    font-family: 'Prompt', 'Sarabun', sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}
.child-section-bar--waiting {
    background: #CC583F;
}
.child-section-bar--sponsored {
    background: #4a5d3a;
}
.child-section-wrap .donation-grid {
    border-radius: 0 0 10px 10px;
    background: #fff;
    padding-top: 8px;
}
.child-card--sponsored .card-img {
    background: #5a6b48 !important;
}

/* ── มูลนิธิ: อัปเดตผลลัพธ์ (เด็กอุปการะแล้ว) ─────────────────── */
.foundation-outcome-cta {
    margin-top: 18px;
    width: 100%;
    text-align: center;
}
.btn-foundation-outcome {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    min-height: 42px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff !important;
    background: linear-gradient(135deg, #799677, #597D57);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
    border: 0;
    box-sizing: border-box;
}
.btn-foundation-outcome:hover {
    filter: brightness(1.05);
    color: #fff !important;
}
.foundation-outcome-cta__hint {
    margin: 10px 0 0;
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.45;
}

.child-outcome-public {
    margin-top: 22px;
    width: 100%;
    max-width: 520px;
    text-align: left;
    background: #fff;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(60, 80, 153, 0.12);
}
.child-outcome-public--tab {
    max-width: 100%;
    margin-top: 0;
}

.child-outcome-timeline-hint {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: #6b7280;
}

.child-outcome-timeline {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.child-outcome-timeline__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 12px;
    flex: 1;
    min-width: 0;
}

.child-outcome-timeline__card {
    flex: 0 0 min(420px, 88vw);
    scroll-snap-align: start;
    max-width: none;
    margin-top: 0;
}

.child-outcome-timeline__nav {
    flex: 0 0 36px;
    width: 36px;
    border: 1px solid rgba(60, 80, 153, 0.25);
    border-radius: 10px;
    background: #fff;
    color: #3C5099;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    align-self: center;
    padding: 0;
    height: 72px;
}

.child-outcome-timeline__nav:hover {
    background: #f0f4ff;
}

@media (max-width: 768px) {
    .child-outcome-timeline__nav {
        display: none;
    }
    .child-outcome-timeline__card {
        flex-basis: min(320px, 92vw);
    }
}
.child-outcome-tab-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.child-outcome-tab-layout__media {
    flex: 0 0 280px;
    max-width: 46%;
}
.child-outcome-tab-layout__img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}
.child-outcome-tab-layout__content {
    flex: 1;
    min-width: 0;
}
@media (max-width: 768px) {
    .child-outcome-tab-layout {
        flex-direction: column;
    }
    .child-outcome-tab-layout__media {
        max-width: 100%;
        width: 100%;
        flex-basis: auto;
    }
}
.child-outcome-public__label {
    font-weight: 800;
    font-size: 1.05rem;
    color: #3C5099;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.child-outcome-public__text {
    font-size: 1.05rem;
    color: #27364b;
    line-height: 1.65;
    font-weight: 600;
}
.child-outcome-public__meta {
    margin: 12px 0 0;
    font-size: 0.88rem;
    color: #6b7280;
}

.child-outcome-history {
    margin-top: 28px;
    padding-top: 8px;
    border-top: 1px dashed rgba(60, 80, 153, 0.25);
}
.child-outcome-history__title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #3c5099;
}
.child-outcome-history__card {
    background: #fff;
    border: 1px solid #e8e0d4;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.child-outcome-history__label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #3c5099;
    margin-bottom: 10px;
}
.child-outcome-history__layout {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
}
.child-outcome-history__media {
    flex: 0 0 140px;
    max-width: 42%;
}
.child-outcome-history__img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}
.child-outcome-history__body {
    flex: 1 1 200px;
    min-width: 0;
}
.child-outcome-history__text {
    font-size: 0.98rem;
    color: #334155;
    line-height: 1.6;
    font-weight: 600;
}
.child-outcome-history__attribution {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #64748b;
}
.child-outcome-history__meta {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ผู้อุปการะ: เปิดจากแจ้งเตือนจดหมาย — โฟกัสคอลขวา ซองมองเห็นชัด */
body.child-letter-notif-view .col-right {
    min-height: 40vh;
}
body.child-letter-notif-view .child-mail-experience {
    scroll-margin-top: 88px;
}
.child-mail-experience--paper-only {
    max-width: 560px;
}
.child-mail-experience--paper-only .child-mail-letter-paper--donor {
    margin-top: 4px;
}

/* ผู้อุปการะ: ประสบการณ์จดหมายจากแจ้งเตือน (ซอง → กระดาษ airmail) */
.child-mail-experience {
    max-width: 520px;
    margin: 8px auto 28px;
    padding: 8px 4px 4px;
}
.child-mail-envelope-scene {
    text-align: center;
    padding: 16px 12px 8px;
    margin-bottom: 0;
}
.child-mail-envelope-scene__cta {
    margin-top: 4px;
}
.child-mail-envelope-scene__title {
    margin: 20px 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a5f;
}
.child-mail-envelope-scene__sub {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #475569;
}
.child-mail-envelope-scene__btn {
    display: inline-block;
    padding: 12px 36px;
    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 18px rgba(89, 125, 87, 0.35);
}
.child-mail-envelope-scene__btn:hover {
    background: #4f7150;
}
.child-mail-envelope {
    position: relative;
    width: min(300px, 88vw);
    height: 168px;
    margin: 0 auto;
    cursor: pointer;
    outline: none;
    perspective: 520px;
}
.child-mail-envelope:focus-visible {
    box-shadow: 0 0 0 3px rgba(60, 80, 153, 0.35);
    border-radius: 8px;
}
.child-mail-envelope__shadow {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -10px;
    height: 22px;
    background: rgba(15, 23, 42, 0.14);
    border-radius: 50%;
    filter: blur(5px);
}
.child-mail-envelope__pocket {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 108px;
    background: linear-gradient(180deg, #9ed4e8 0%, #6eb5cf 55%, #5aa3bc 100%);
    border-radius: 6px 6px 10px 10px;
    box-shadow:
        inset 0 -5px 0 rgba(0, 0, 0, 0.07),
        0 10px 22px rgba(30, 58, 95, 0.18);
    z-index: 3;
}
.child-mail-envelope__flap {
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    height: 86px;
    background: linear-gradient(180deg, #b8e4f0 0%, #7ec5db 100%);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top center;
    transition: transform 0.5s ease;
    z-index: 4;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}
.child-mail-envelope__peek-letter {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 6px;
    z-index: 2;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    box-shadow: 0 -3px 10px rgba(15, 23, 42, 0.12);
    pointer-events: none;
}
.child-mail-envelope__peek-strip {
    height: 10px;
    background: repeating-linear-gradient(
        -45deg,
        #c41e3a 0,
        #c41e3a 5px,
        #fff 5px,
        #fff 10px,
        #1e40af 10px,
        #1e40af 15px,
        #fff 15px,
        #fff 20px
    );
}
.child-mail-envelope__peek-body {
    height: 52px;
    background: linear-gradient(180deg, #fffdf8 0%, #f8f4ea 100%);
}
.child-mail-envelope-scene.is-opening .child-mail-envelope__flap,
.child-mail-experience.is-opened .child-mail-envelope__flap {
    transform: rotateX(175deg);
}
.child-mail-experience.is-opened .child-mail-envelope-scene {
    padding-bottom: 0;
    margin-bottom: -12px;
}
.child-mail-experience.is-opened .child-mail-envelope {
    height: 120px;
    cursor: default;
    pointer-events: none;
}
.child-mail-experience.is-opened .child-mail-envelope__peek-letter {
    opacity: 0;
    visibility: hidden;
}

/* กระดาษจดหมาย (หลังเปิดซอง) — กรอบ airmail แบบข้อความจากมูลนิธิ */
.child-mail-letter-paper--donor.is-visible,
.child-mail-experience.is-opened .child-mail-letter-paper--donor {
    animation: childMailPaperIn 0.5s ease;
}
@keyframes childMailPaperIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.child-mail-experience .child-mail-letter-paper--donor {
    margin-top: 0;
}
.child-mail-letter-airmail {
    padding: 11px;
    border-radius: 12px;
    margin-top: 0;
    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.12);
}
.child-mail-letter-airmail__inner {
    background: #fff;
    border-radius: 8px;
    padding: 18px 18px 22px;
}
.child-mail-experience .child-outcome-public--letter {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}
.child-mail-experience .child-outcome-public__label {
    font-size: 1.12rem;
    margin-bottom: 14px;
}
.child-mail-experience .child-outcome-public__text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.45;
}
.child-mail-experience .child-outcome-tab-layout__media {
    flex: 0 0 200px;
    max-width: 42%;
}
.child-mail-experience .child-impression-card__attribution {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #374151;
}
.child-outcome-public--letter {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.child-outcome-public--plan-sponsored {
    margin-top: 14px;
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 48%);
    border-color: rgba(22, 163, 74, 0.22);
}

/* บอกเล่าความประทับใจ — วางบนพื้นเหลืองของหน้า ไม่มีกล่องขาว */
.child-impression-card {
    margin-top: 14px;
    width: 100%;
    max-width: none;
    text-align: left;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    box-sizing: border-box;
}
.child-impression-card--subscriber-only {
    padding: 0;
    margin-top: 14px;
    background: transparent;
    border: none;
    box-shadow: none;
}
.child-impression-card__label {
    font-weight: 800;
    font-size: 1.2rem;
    color: #3C5099;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.child-impression-card__label .bi {
    font-size: 1.35rem;
}
.child-impression-card__body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.child-impression-card__photo-wrap {
    flex: 0 0 auto;
    width: min(360px, 48vw);
    max-width: 50%;
}
.child-impression-card__photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    border: none;
    background: transparent;
}
.child-impression-card__text-col {
    flex: 1;
    min-width: 0;
}
.child-impression-card__quote {
    font-size: 1.3rem;
    color: #111111;
    line-height: 1.75;
    font-weight: 700;
}
.child-impression-card__empty-inline {
    font-size: 1.1rem;
    color: #111111;
    line-height: 1.6;
}
.child-impression-card__text-col .child-outcome-public__gallery {
    margin-top: 14px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.child-impression-card__attribution {
    margin: 14px 0 0;
    font-size: 1rem;
    color: #1f1f1f;
    line-height: 1.45;
}
.child-impression-card__meta {
    margin: 10px 0 0;
    font-size: 0.95rem;
    color: #1f1f1f;
}
.child-impression-slider { position: relative; }
.child-impression-slide { display: none; margin: 0; }
.child-impression-slide.active { display: block; }
.child-impression-slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    color: #374151;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}
.child-impression-slider__btn.prev { left: 8px; }
.child-impression-slider__btn.next { right: 8px; }
.child-impression-slider__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.child-impression-slider__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.65);
}
.child-impression-slider__dot.active { background: #fff; }
.child-impression-card__empty {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1.6;
}
.child-impression-card__subscriber {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.12);
    font-size: 1.05rem;
    color: #1f2937;
    line-height: 1.5;
}
.child-impression-card--subscriber-only .child-impression-card__subscriber {
    margin: 0;
    padding-top: 0;
    border-top: none;
}
.child-subscription-manage {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: flex-end;
}
.child-subscription-manage__meta {
    font-size: 0.96rem;
    color: #374151;
    line-height: 1.5;
}
.child-subscription-manage__form {
    margin: 0;
}
.btn-subscription-cancel {
    border: 1px solid #ef9a9a;
    background: #fff3f3;
    color: #b71c1c;
    font-weight: 700;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.92rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.btn-subscription-cancel--large {
    min-height: 46px;
    padding: 10px 18px;
    font-size: 1.02rem;
    font-weight: 800;
}
.btn-subscription-cancel--compact {
    min-height: 0;
    padding: 7px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
}
.btn-subscription-cancel:hover {
    background: #ffe5e5;
    border-color: #e57373;
    transform: translateY(-1px);
}
@media (max-width: 480px) {
    .child-impression-card__body {
        flex-direction: column;
        align-items: stretch;
    }
    .child-impression-card__photo-wrap {
        width: 100%;
        max-width: none;
        max-height: none;
    }
    .child-impression-card__photo {
        max-height: 280px;
        width: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }
    .child-impression-card__quote {
        font-size: 1.12rem;
    }
}

.child-outcome-public__placeholder {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
}

.child-outcome-public__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.child-outcome-public__gallery-item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(60, 80, 153, 0.12);
    aspect-ratio: 1;
    background: #f3f4f6;
}
.child-outcome-public__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: middle;
}

.foundation-outcome-pill-wrap {
    display: block;
    margin-top: 8px;
}
.btn-outcome-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff !important;
    background: linear-gradient(135deg, #799677, #597D57);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
    box-sizing: border-box;
}
.btn-outcome-pill:hover {
    filter: brightness(1.05);
    color: #fff !important;
}
body.mode-delete .foundation-outcome-pill-wrap,
body.mode-edit .foundation-outcome-pill-wrap { display: none; }

.child-card-outcome-actions {
    margin-top: 8px;
    display: none;
}

.btn-card-outcome {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff !important;
    background: linear-gradient(135deg, #799677, #597D57);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.btn-card-outcome:hover {
    color: #fff !important;
    filter: brightness(1.05);
}

.btn-card-outcome.is-done {
    background: linear-gradient(135deg, #6d8e6b, #4f6f4d);
}

body.mode-outcome .child-card-outcome-actions {
    display: block;
}

/* หน้า foundation_child_outcome.php — พื้นหลังครีม + โทนแบรนด์ #3C5099 หัวการ์ดฝันดาว/สายรุ้ง/เด็ก */
body.outcome-form-page {
    background: #F7ECDE;
    min-height: 100vh;
}
.outcome-form-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 20px 56px;
    box-sizing: border-box;
}
.outcome-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #3C5099;
    text-decoration: none;
    margin-bottom: 18px;
    font-size: 1.9rem;
    line-height: 1;
}
.outcome-back-link:hover {
    text-decoration: none;
    color: #2e407f;
}
.outcome-hero-card {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(60, 80, 153, 0.12), 0 6px 18px rgba(15, 23, 42, 0.06);
}
.outcome-hero-card__sky {
    position: relative;
    min-height: 168px;
    background: linear-gradient(165deg, #4a5cb8 0%, #3C5099 38%, #2e407f 100%);
    overflow: hidden;
}
.outcome-hero-card__deco--ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: -36px;
    right: -28px;
    pointer-events: none;
}
.outcome-dream-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.outcome-star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 0 20px rgba(255, 230, 150, 0.35);
    animation: outcome-star-twinkle 2.8s ease-in-out infinite;
}
.outcome-star--1 { width: 5px; height: 5px; top: 18%; left: 14%; animation-delay: 0s; }
.outcome-star--2 { width: 4px; height: 4px; top: 28%; left: 78%; animation-delay: 0.4s; }
.outcome-star--3 { width: 6px; height: 6px; top: 12%; left: 42%; animation-delay: 0.8s; }
.outcome-star--4 { width: 3px; height: 3px; top: 42%; left: 22%; animation-delay: 1.1s; }
.outcome-star--5 { width: 4px; height: 4px; top: 36%; left: 88%; animation-delay: 0.2s; }
.outcome-star--6 { width: 5px; height: 5px; top: 52%; left: 8%; animation-delay: 1.5s; }
.outcome-star--7 { width: 3px; height: 3px; top: 22%; left: 58%; animation-delay: 0.6s; }
.outcome-star--8 { width: 4px; height: 4px; top: 48%; left: 68%; animation-delay: 1.9s; }
@keyframes outcome-star-twinkle {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}
.outcome-dream-rainbow {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    width: 124%;
    max-width: 520px;
    height: 92px;
    pointer-events: none;
    opacity: 1;
    animation: outcome-rainbow-breathe 4.4s ease-in-out infinite;
}
.outcome-rainbow-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(60, 80, 153, 0.22));
}
.outcome-rainbow-svg path {
    stroke-dasharray: none;
    animation: none;
}
@keyframes outcome-rainbow-breathe {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
    50% { transform: translateX(-50%) translateY(-2px) scale(1.02); }
}
.outcome-dream-clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.outcome-dream-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(12, 22, 52, 0.12);
}

.outcome-dream-cloud::before,
.outcome-dream-cloud::after {
    content: "";
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.outcome-dream-cloud--a {
    width: 70px;
    height: 24px;
    left: 4%;
    bottom: 18px;
    animation: outcome-cloud-drift-a 5.4s ease-in-out infinite;
}
.outcome-dream-cloud--a::before {
    width: 28px;
    height: 24px;
    left: 8px;
    top: -12px;
}
.outcome-dream-cloud--a::after {
    width: 22px;
    height: 18px;
    right: 10px;
    top: -8px;
}

.outcome-dream-cloud--b {
    width: 60px;
    height: 22px;
    left: 18%;
    top: 16px;
    animation: outcome-cloud-drift-b 6s ease-in-out infinite;
}
.outcome-dream-cloud--b::before {
    width: 24px;
    height: 20px;
    left: 7px;
    top: -10px;
}
.outcome-dream-cloud--b::after {
    width: 18px;
    height: 15px;
    right: 8px;
    top: -7px;
}

.outcome-dream-cloud--c {
    width: 76px;
    height: 27px;
    right: 12%;
    top: 26px;
    animation: outcome-cloud-drift-c 5.8s ease-in-out infinite;
}
.outcome-dream-cloud--c::before {
    width: 30px;
    height: 24px;
    left: 12px;
    top: -12px;
}
.outcome-dream-cloud--c::after {
    width: 20px;
    height: 17px;
    right: 11px;
    top: -7px;
}

.outcome-dream-cloud--d {
    width: 54px;
    height: 20px;
    right: 5%;
    bottom: 16px;
    animation: outcome-cloud-drift-d 6.4s ease-in-out infinite;
}
.outcome-dream-cloud--d::before {
    width: 20px;
    height: 16px;
    left: 6px;
    top: -8px;
}
.outcome-dream-cloud--d::after {
    width: 16px;
    height: 13px;
    right: 6px;
    top: -6px;
}

@keyframes outcome-cloud-drift-a {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-3px) translateX(3px); }
}
@keyframes outcome-cloud-drift-b {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-2px) translateX(-3px); }
}
@keyframes outcome-cloud-drift-c {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-4px) translateX(2px); }
}
@keyframes outcome-cloud-drift-d {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-2px) translateX(-2px); }
}
.outcome-hero-card__cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    bottom: -10px;
    z-index: 1;
}
.outcome-hero-card__cloud--1 {
    width: 72px;
    height: 28px;
    left: 10%;
    box-shadow: 40px 6px 0 -4px rgba(255,255,255,0.78);
}
.outcome-hero-card__cloud--2 {
    width: 56px;
    height: 22px;
    right: 16%;
    opacity: 0.95;
}
.outcome-hero-card__cloud--3 {
    width: 48px;
    height: 20px;
    left: 48%;
    transform: translateX(-50%);
    bottom: -6px;
    opacity: 0.88;
}
.outcome-hero-card__body {
    padding: 26px 24px 30px;
    text-align: center;
}
.outcome-hero-card__title {
    margin: 0 0 12px;
    font-size: 1.85rem;
    font-weight: 900;
    color: #111827;
    letter-spacing: -0.02em;
    font-family: 'Prompt', 'Sarabun', sans-serif;
}
.outcome-hero-card__lead {
    margin: 0 0 18px;
    font-size: 1.02rem;
    color: #6b7280;
    line-height: 1.55;
    font-weight: 600;
}
.outcome-hero-card__lead strong {
    color: #374151;
}
.outcome-hero-card__error {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
}
.outcome-hero-form {
    text-align: left;
}
.outcome-hero-form__label {
    display: block;
    font-weight: 800;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.98rem;
}
.outcome-hero-form__label--sub {
    margin-top: 16px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #4b5563;
}
.outcome-hero-form__file {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 2px dashed #c7d2fe;
    border-radius: 14px;
    background: #f8fafc;
    font-size: 0.92rem;
    cursor: pointer;
    box-sizing: border-box;
}
.outcome-existing-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 10px 0 6px;
}
.outcome-existing-gallery__item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    aspect-ratio: 1;
    background: #f3f4f6;
}
.outcome-existing-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.outcome-existing-gallery__check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e5e7eb;
    color: #b91c1c;
}
.outcome-existing-gallery__check input {
    margin: 0;
}
.outcome-hero-form__textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    padding: 14px 16px;
    font-size: 1rem;
    line-height: 1.55;
    font-family: 'Sarabun', sans-serif;
    resize: vertical;
    min-height: 160px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.outcome-hero-form__textarea:focus {
    outline: none;
    border-color: #3C5099;
    box-shadow: 0 0 0 4px rgba(60, 80, 153, 0.2);
}
.outcome-hero-form__actions {
    margin-top: 18px;
    text-align: center;
}
.outcome-hero-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    background: #e5e7eb;
    color: #374151 !important;
    border: 0;
    cursor: pointer;
}
.outcome-hero-card__btn--primary {
    background: linear-gradient(135deg, #3C5099, #2e407f);
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(60, 80, 153, 0.35);
}
.outcome-hero-card__btn--primary:hover,
.outcome-hero-card__btn--primary:focus {
    background: linear-gradient(135deg, #3C5099, #2e407f) !important;
    filter: none;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(60, 80, 153, 0.35);
}
