/* =========================================================================
   หน้าโปรไฟล์ — เลย์เอาต์แบบ bento (โหลดท้ายสุด จึงคุมหน้าตาของหน้านี้ได้จุดเดียว)
   ของเดิมเป็นการ์ดเรียงลงมาคอลัมน์เดียว กว้าง 900px สูงรวม ~3,400px
   ทำให้ต้องเลื่อนยาวมากทั้งที่ข้อมูลไม่เยอะ
   ========================================================================= */

/* กฎเก่าในธีมล็อก .surin-profile-grid ไว้ที่ display:block + max-width 640-900px ด้วย !important
   ต้องเขียนให้เจาะจงกว่า (html body:not(.cust-help) ...) ไม่งั้นแก้ไม่ขึ้น */
html body:not(.cust-help) .main__content.profile {
    max-width: 1200px !important;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- โครงหลัก: ซ้าย = ตัวตน/ความปลอดภัย · ขวา = ฟอร์มแก้ไข ---------- */
@media screen and (min-width: 1000px) {
    html body:not(.cust-help) .main__content.profile .surin-profile-grid {
        display: grid !important;
        width: 100% !important;
        max-width: 1200px !important;
        grid-template-columns: 330px minmax(0, 1fr) !important;
        /* แถวที่ 4 กินพื้นที่ที่เหลือ การ์ดฝั่งซ้ายจะได้เกาะกลุ่มอยู่ด้านบน
           ไม่ถูกยืดกระจายตามความสูงของฟอร์มฝั่งขวา */
        grid-template-rows: min-content min-content min-content 1fr;
        gap: 14px !important;
        align-items: start;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > script { display: none; }

    html body:not(.cust-help) .main__content.profile .surin-profile-grid > .surin-profile-card:not(.surin-profile-mfa):not(.surin-profile-manual) {
        grid-column: 1;
        grid-row: 1;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > .surin-profile-mfa {
        grid-column: 1;
        grid-row: 2;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > .profile-password {
        grid-column: 1;
        grid-row: 3;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > .profile-edit {
        grid-column: 2;
        grid-row: 1 / span 4;
    }
}

/* ---------- การ์ดร่วม: ขอบบาง มุมมน ระยะกระชับ ---------- */
html body:not(.cust-help) .main__content.profile .surin-profile-card,
html body:not(.cust-help) .main__content.profile .right-bar.is-inline {
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #eef2f8 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: none !important;
}

/* ---------- การ์ดตัวตน: รูป + ชื่อ อยู่แถวเดียวกัน ---------- */
html body:not(.cust-help) .main__content.profile .surin-profile-card:not(.surin-profile-mfa):not(.surin-profile-manual) {
    display: block !important;
    padding: 16px !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-summary {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 13px !important;
    margin: 0 !important;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-summary .surin-profile-avatar {
    flex: 0 0 62px !important;
    width: 62px !important;
    height: 62px !important;
    margin: 0 !important;
    font-size: 24px !important;
}
html body:not(.cust-help) .main__content.profile .profile__info_list {
    min-width: 0;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-summary {
    justify-content: flex-start !important;
}

/* กล่องซ่อนต้องซ่อนจริง */
html body:not(.cust-help) .main__content.profile [hidden] { display: none !important; }

/* ลายเซ็น: สูงพอเขียน ไม่กินพื้นที่ครึ่งการ์ด */
html body:not(.cust-help) .main__content.profile .step-2 textarea.form-control {
    min-height: 0 !important;
    height: 118px !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-eyebrow {
    margin: 0 0 1px !important;
    color: #98a2b3 !important;
    font-size: 11.5px !important;
    font-weight: 700;
    letter-spacing: .02em;
}
html body:not(.cust-help) .main__content.profile .surin-profile-summary h3 {
    margin: 0 !important;
    color: #16233a;
    font-size: 16.5px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
}
html body:not(.cust-help) .main__content.profile .surin-profile-summary .info--mail {
    margin: 2px 0 0 !important;
    font-size: 13px;
    overflow-wrap: anywhere;
}
html body:not(.cust-help) .main__content.profile .surin-profile-meta {
    display: inline-flex !important;
    align-items: center;
    margin: 7px 0 0 !important;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}
html body:not(.cust-help) .main__content.profile .surin-profile-actions {
    display: block !important;
    margin: 12px 0 0 !important;
    padding-top: 12px;
    border-top: 1px dashed #eef2f8;
}
html body:not(.cust-help) .main__content.profile .profile-log-out {
    display: flex !important;
    background: #fef3f2 !important;
    box-shadow: none !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin: 0 !important;
    border-radius: 11px;
    background: #fef3f2;
    color: #b42318 !important;
    font-size: 14px;
    font-weight: 700;
}
html body:not(.cust-help) .main__content.profile .profile-log-out:hover { background: #fee4e2 !important; }
html body:not(.cust-help) .main__content.profile .profile-log-out span,
html body:not(.cust-help) .main__content.profile .profile-log-out .icon {
    color: #b42318 !important;
    fill: #b42318 !important;
    stroke: currentColor;
}
html body:not(.cust-help) .main__content.profile .profile-log-out .icon { width: 17px; height: 17px; }

/* ---------- การ์ด MFA: หัวข้อ + สถานะ + ปุ่ม อยู่ในกรอบเดียวกันแบบกระชับ ---------- */
html body:not(.cust-help) .main__content.profile .surin-profile-mfa {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;   /* กฎเก่าเป็น center ทำให้ทุกอย่างในการ์ดถูกดันมากลาง */
    justify-content: flex-start !important;
    gap: 10px;
    padding: 16px !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__info { margin: 0 !important; }
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__info,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__info_list {
    display: block !important;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-mfa h3 {
    margin: 0 0 4px !important;
    color: #16233a;
    font-size: 14.5px !important;
    font-weight: 800;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .info--mail {
    margin: 0 !important;
    font-size: 13px;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__control,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__edit { margin: 0 !important; }
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .profile__edit a { display: block; }
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .btn {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
}

/* ---------- กล่องฟอร์ม (แก้ไขโปรไฟล์ / เปลี่ยนรหัสผ่าน) ---------- */
html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body {
    padding: 16px 18px !important;
}
html body:not(.cust-help) .main__content.profile .right-bar.is-inline > .right-bar__body > h3 {
    margin: 0 0 12px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid #f2f5fa;
    font-size: 15px !important;
    font-weight: 800;
}
html body:not(.cust-help) .main__content.profile .right-bar.is-inline .icon-back { display: none; }

/* หัวข้อย่อยในฟอร์ม: เส้นคั่นบาง ๆ ตัวเล็ก */
html body:not(.cust-help) .main__content.profile .ux-sec-head {
    margin: 14px 0 8px !important;
    color: #98a2b3 !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    letter-spacing: .04em;
    text-transform: none;
}
html body:not(.cust-help) .main__content.profile .step-slider > .ux-sec-head:first-child { margin-top: 0 !important; }

/* ช่องกรอกจัดเป็น 2 คอลัมน์ — ตัดความสูงลงเกือบครึ่ง */
html body:not(.cust-help) .main__content.profile .step-item {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 14px !important;
    margin: 0 !important;
}
html body:not(.cust-help) .main__content.profile .step-item > h5,
html body:not(.cust-help) .main__content.profile .step-item > .item--section,
html body:not(.cust-help) .main__content.profile .step-item > .form-group:has(textarea),
html body:not(.cust-help) .main__content.profile .step-2 > .form-group {
    grid-column: 1 / -1;
}
html body:not(.cust-help) .main__content.profile .step-item .form-group {
    margin: 0 !important;
}
html body:not(.cust-help) .main__content.profile .step-item label {
    margin-bottom: 4px !important;
    font-size: 12.5px;
    font-weight: 700;
}
html body:not(.cust-help) .main__content.profile .step-item .form-control {
    min-height: 42px !important;
}
html body:not(.cust-help) .main__content.profile .step-item textarea.form-control {
    min-height: 96px !important;
}
html body:not(.cust-help) .main__content.profile .step-item > h5 {
    margin: 2px 0 0 !important;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
}

/* กลุ่มติ๊กถูก: 2 คอลัมน์ ชิดกัน อ่านเป็นรายการเดียว */
html body:not(.cust-help) .main__content.profile .item--section {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px 14px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #f2f5fa;
    border-radius: 12px;
    background: #fafbfd;
}
html body:not(.cust-help) .main__content.profile .item--section:empty { display: none; }
html body:not(.cust-help) .main__content.profile .item--section .checkbox-custom,
html body:not(.cust-help) .main__content.profile .item--section .radio-custom { margin: 0 !important; }
html body:not(.cust-help) .main__content.profile .item--section label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
html body:not(.cust-help) .main__content.profile .defaults-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* แถวอัปโหลดรูป: รูปตัวอย่าง + ปุ่มเลือกไฟล์ อยู่แถวเดียวกัน */
html body:not(.cust-help) .main__content.profile .surin-avatar-upload {
    display: grid !important;
    grid-template-columns: 84px minmax(0, 1fr) !important;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px !important;
    padding: 12px 14px !important;
    border: 1px solid #f2f5fa;
    border-radius: 14px;
    background: #fafbfd;
}
html body:not(.cust-help) .main__content.profile .surin-profile-avatar--large {
    width: 84px !important;
    height: 84px !important;
    margin: 0 !important;
}
html body:not(.cust-help) .main__content.profile .surin-avatar-upload p {
    margin: 6px 0 0 !important;
    color: #98a2b3;
    font-size: 11.5px;
    line-height: 1.55;
}

/* แถวปุ่มบันทึก: ติดขอบล่างของการ์ด ไม่ลอยกลาง */
html body:not(.cust-help) .main__content.profile .right-bar__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100% !important;
    margin: 14px 0 0 !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid #f2f5fa;
}
html body:not(.cust-help) .main__content.profile .right-bar__footer .btn { min-height: 44px; }

/* ---------- จอแคบ: เรียงลงมาคอลัมน์เดียวเหมือนเดิม แต่ยังกระชับ ---------- */
@media screen and (max-width: 999px) {
    html body:not(.cust-help) .main__content.profile .surin-profile-grid {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        max-width: 100% !important;
    }
}
@media screen and (max-width: 760px) {
    html body:not(.cust-help) .main__content.profile .step-item,
    html body:not(.cust-help) .main__content.profile .item--section {
        grid-template-columns: 1fr !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload {
        grid-template-columns: 66px minmax(0, 1fr);
        gap: 12px;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-avatar--large {
        width: 66px !important;
        height: 66px !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body { padding: 14px !important; }
}


/* ===== เก็บรายละเอียดท้ายสุด (ต้องอยู่ล่างกฎอื่นในไฟล์นี้) ===== */

/* กลุ่มติ๊กถูกที่ธีมพิมพ์ทิ้งไว้แบบไม่มีเนื้อหา — ซ่อนไม่ให้เป็นแถบเทาว่าง ๆ */
html body:not(.cust-help) .main__content.profile .item--section:not(:has(*)) {
    display: none !important;
}

/* การ์ดทุกใบสูงตามเนื้อหาจริง ไม่ต้องมีความสูงขั้นต่ำเหลือเป็นที่ว่าง */
html body:not(.cust-help) .main__content.profile .surin-profile-card,
html body:not(.cust-help) .main__content.profile .right-bar.is-inline,
html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body,
html body:not(.cust-help) .main__content.profile .right-bar.is-inline .form {
    min-height: 0 !important;
    height: auto !important;
}
html body:not(.cust-help) .main__content.profile .right-bar.is-inline .form {
    padding-bottom: 0 !important;
}


/* ===== สกินมือถือ: กันกฎกลางที่จัดทุกอย่างไว้กึ่งกลาง ===== */
@media screen and (max-width: 899px) {
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload,
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload * {
        text-align: left !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload label {
        display: block;
        margin-bottom: 6px !important;
        font-size: 13px !important;
        font-weight: 800 !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload p {
        font-size: 11.5px !important;
        line-height: 1.5 !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload input[type="file"] {
        width: 100% !important;
        font-size: 12.5px;
    }
}

/* =========================================================================
   ภาษาดีไซน์ pastel-app-ui — การ์ดมน แบน ไอคอน inline SVG พาสเทลอยู่ที่ไอคอน
   (สร้างโครงการ์ดโดย profileSections() ใน js/ux-enhance.js)
   ========================================================================= */

html body:not(.cust-help) .main__content.profile .pf-sec {
    margin: 0 0 12px;
    padding: 14px 16px 16px;
    border: 1px solid #f0f2f6;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(16, 24, 40, .04);
}
html body:not(.cust-help) .main__content.profile .pf-sec:last-child { margin-bottom: 0; }

html body:not(.cust-help) .main__content.profile .pf-sec__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 0 0 11px;
    border-bottom: 1px solid #f4f6fa;
}
html body:not(.cust-help) .main__content.profile .pf-sec__icon {
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
}
html body:not(.cust-help) .main__content.profile .pf-sec__icon svg { width: 18px; height: 18px; }
html body:not(.cust-help) .main__content.profile .pf-sec__title {
    color: #1c1c1e;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0;
}

/* สีประจำหมวด — หมวดเดิมสีเดิมเสมอ */
html body:not(.cust-help) .main__content.profile .pf-sec--blue   .pf-sec__icon { background: #e9f1fb; color: #4a90d9; }
html body:not(.cust-help) .main__content.profile .pf-sec--purple .pf-sec__icon { background: #eee4fa; color: #9b6bd3; }
html body:not(.cust-help) .main__content.profile .pf-sec--orange .pf-sec__icon { background: #fdebcb; color: #f5a623; }
html body:not(.cust-help) .main__content.profile .pf-sec--pink   .pf-sec__icon { background: #fbe3ec; color: #e8618c; }

/* ไอคอนเล็กหน้าหัวข้อการ์ดอื่น (รูปโปรไฟล์ / รหัสผ่าน / MFA) */
html body:not(.cust-help) .main__content.profile .pf-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    border-radius: 9px;
    background: #eef2f8;
    color: #667085;
    vertical-align: -7px;
}
html body:not(.cust-help) .main__content.profile .pf-inline-icon svg { width: 15px; height: 15px; }
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .pf-inline-icon { background: #e7f3ec; color: #2f7e55; }
html body:not(.cust-help) .main__content.profile .profile-password .pf-inline-icon { background: #e9f1fb; color: #4a90d9; }

/* หัวหมวดแบบเส้นบาง ๆ ของเดิมไม่ใช้แล้ว (ถูกแทนที่ด้วยหัวการ์ด) */
html body:not(.cust-help) .main__content.profile .pf-sec .ux-sec-head { display: none !important; }

/* การ์ดใหญ่: มุมมนขึ้น เงาเบา แบน ไม่ไล่เฉด */
html body:not(.cust-help) .main__content.profile .surin-profile-card,
html body:not(.cust-help) .main__content.profile .right-bar.is-inline {
    border-radius: 24px !important;
    box-shadow: 0 4px 20px rgba(16, 24, 40, .04) !important;
    background-image: none !important;
}

/* แถวติ๊กถูกในหมวด "การแจ้งเตือน/ที่ชื่นชอบ": ทำเป็นแถวรายการ ไม่ใช่ก้อนเทา */
html body:not(.cust-help) .main__content.profile .pf-sec .item--section {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    gap: 0 14px !important;
}
html body:not(.cust-help) .main__content.profile .pf-sec .item--section .checkbox-custom,
html body:not(.cust-help) .main__content.profile .pf-sec .item--section .radio-custom {
    padding: 9px 2px !important;
    border-bottom: 1px solid #f4f6fa;
}
html body:not(.cust-help) .main__content.profile .pf-sec .item--section .checkbox-custom:last-child,
html body:not(.cust-help) .main__content.profile .pf-sec .item--section .radio-custom:last-child {
    border-bottom: 0;
}

/* ปุ่มบันทึก: แคปซูล ชิดขวา ไม่ลอย */
html body:not(.cust-help) .main__content.profile .right-bar__footer .btn,
html body:not(.cust-help) .main__content.profile .right-bar__footer button {
    border-radius: 999px !important;
    padding-left: 26px !important;
    padding-right: 26px !important;
    font-weight: 700 !important;
}

/* ---------- เลิกซ้อนการ์ดในการ์ด: กรอบนอกของฟอร์มเป็นแค่คอลัมน์ การ์ดจริงคือหมวดข้างใน ---------- */
@media screen and (min-width: 1000px) {
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline .right-bar__body {
        padding: 0 !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline > .right-bar__body > h3 {
        margin: 2px 0 12px !important;
        padding: 0 !important;
        border: 0 !important;
        font-size: 17px !important;
    }
}

/* กล่องอัปโหลดรูป = การ์ดใบหนึ่งเท่ากับหมวดอื่น */
html body:not(.cust-help) .main__content.profile .surin-avatar-upload {
    padding: 14px 16px !important;
    border: 1px solid #f0f2f6 !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 4px 20px rgba(16, 24, 40, .04);
}

/* แถวปุ่มบันทึกลอยอยู่ท้ายคอลัมน์ ไม่ต้องมีเส้นคั่นซ้ำกับการ์ด */
@media screen and (min-width: 1000px) {
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit .right-bar__footer {
        border-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* กรอบขาวชั้นกลางของธีม (right-bar__body / step-item) ไม่ต้องมีแล้ว การ์ดจริงคือ .pf-sec */
@media screen and (min-width: 1000px) {
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline .right-bar__body {
        background: transparent !important;
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
}
html body:not(.cust-help) .main__content.profile .pf-sec .step-item {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* จอแคบก็ไม่เอาการ์ดซ้อนการ์ดเช่นกัน */
@media screen and (max-width: 999px) {
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline,
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline .right-bar__body {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.profile-edit.is-inline > .right-bar__body > h3 {
        margin: 0 0 10px !important;
        padding: 0 !important;
        border: 0 !important;
    }
}

/* ---------- รูปโปรไฟล์: เหลือใบเดียว (การ์ดตัวตน) แล้วกดเปลี่ยนรูปได้เลย ---------- */
html body:not(.cust-help) .main__content.profile .surin-avatar-upload .surin-profile-avatar--large {
    display: none !important;   /* เคยซ้ำกับรูปในการ์ดตัวตน */
}
/* กริดเดิมกันที่ไว้ให้รูป 84px + เนื้อหา 508px พอซ่อนรูปแล้วเนื้อหาจะไปติดคอลัมน์ 84px
   เปลี่ยนเป็นบล็อกเดียวเต็มความกว้าง */
html body:not(.cust-help) .main__content.profile .surin-avatar-upload {
    display: block !important;
    padding: 14px 16px !important;
}
html body:not(.cust-help) .main__content.profile .surin-avatar-upload > div {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding-left: 0 !important;
}
html body:not(.cust-help) .main__content.profile .surin-avatar-upload > div > label {
    flex: 0 0 auto;
    margin: 0 !important;
    color: #1c1c1e;
    font-size: 14.5px;
    font-weight: 800;
}
html body:not(.cust-help) .main__content.profile .surin-avatar-upload input[type="file"] {
    flex: 1 1 240px;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
}
html body:not(.cust-help) .main__content.profile .surin-avatar-upload .surin-avatar-hint,
html body:not(.cust-help) .main__content.profile .surin-avatar-upload > div > small,
html body:not(.cust-help) .main__content.profile .surin-avatar-upload > div > p {
    flex: 1 1 100%;
    margin: 0 !important;
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.6;
}
html body:not(.cust-help) .main__content.profile .pf-avatar--editable {
    position: relative;
    cursor: pointer;
}
/* ---------- แถว "โหลดข้อมูลอัตโนมัติทุก: [30] [วินาที]" ไม่ให้ช่องบีบทับกัน ---------- */
html body:not(.cust-help) .main__content.profile .check-plus-input {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px !important;
}
html body:not(.cust-help) .main__content.profile .check-plus-input > .checkbox-custom {
    /* ป้าย "โหลดข้อมูลอัตโนมัติทุก:" ยาวกว่าคอลัมน์ ให้กินเต็มบรรทัดแล้วช่องกรอกลงบรรทัดถัดไป
       (เดิมยัดสามอันในบรรทัดเดียว ช่องเลยถูกบีบจนเนื้อหาทับกัน) */
    flex: 1 1 100%;
    margin: 0 !important;
}
html body:not(.cust-help) .main__content.profile .check-plus-input > .form-group {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
}
/* nth-of-type นับ DIV ทั้งหมด: (1) คือกล่องติ๊กถูก ช่องตัวเลขคือ (2) หน่วยเวลาคือ (3) */
html body:not(.cust-help) .main__content.profile .check-plus-input > .form-group:nth-of-type(2) { width: 76px !important; }
html body:not(.cust-help) .main__content.profile .check-plus-input > .form-group:nth-of-type(3) { width: 120px !important; }
html body:not(.cust-help) .main__content.profile .check-plus-input .form-control,
html body:not(.cust-help) .main__content.profile .check-plus-input select,
html body:not(.cust-help) .main__content.profile .check-plus-input .dropdown-select {
    width: 100% !important;
    min-width: 0 !important;
}



/* หัวการ์ดฝั่งซ้าย (MFA / เปลี่ยนรหัสผ่าน) ให้เป็นภาษาเดียวกับหัวการ์ดหมวดฝั่งขวา */
html body:not(.cust-help) .main__content.profile .profile-password h3,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa h3 {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px !important;
    padding: 0 0 11px !important;
    border-bottom: 1px solid #f4f6fa !important;
    color: #1c1c1e !important;
    font-size: 14.5px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}
html body:not(.cust-help) .main__content.profile .profile-password h3::after,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa h3::after {
    display: none !important;   /* ขีดเส้นใต้สีน้ำเงินของธีมเดิม */
}
html body:not(.cust-help) .main__content.profile .profile-password .pf-inline-icon,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .pf-inline-icon {
    width: 34px;
    height: 34px;
    margin-right: 0;
    border-radius: 11px;
    vertical-align: middle;
}
html body:not(.cust-help) .main__content.profile .profile-password .pf-inline-icon svg,
html body:not(.cust-help) .main__content.profile .surin-profile-mfa .pf-inline-icon svg { width: 18px; height: 18px; }

/* หัวข้อ "เปลี่ยน password" ของธีมเป็นลิงก์แท็บ (ตัวใหญ่ + ขีดน้ำเงินหนา) — ลดให้เท่าหัวการ์ดอื่น */
html body:not(.cust-help) .main__content.profile .profile-password h3 > a {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
}

/* =========================================================================
   จอมือถือ — จัดระเบียบใหม่ให้เป็นแบบแอป (ภาษาดีไซน์เดียวกับจอคอม)
   ========================================================================= */
@media screen and (max-width: 899px) {

    /* --- การ์ดบัญชี: รูปอยู่กลางด้านบน ชื่อ/อีเมลอยู่ใต้รูป อ่านง่ายกว่าวางซ้าย-ขวา ---
       หมายเหตุ: การ์ด MFA/รหัสผ่านใช้คลาส .surin-profile-card ร่วมกัน จึงต้องยึดที่
       .surin-profile-summary (กล่องตัวตนจริง ๆ) ไม่งั้นหัวการ์ดอื่นจะโดนจัดกึ่งกลางไปด้วย */
    html body:not(.cust-help) .main__content.profile .surin-profile-summary {
        display: block !important;
        text-align: center;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-summary .surin-profile-avatar {
        width: 92px !important;
        height: 92px !important;
        margin: 0 auto 12px !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-summary .profile__info_list {
        display: flex !important;
        align-items: center !important;
        padding-left: 0 !important;
        text-align: center !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-summary .profile__info_list > * {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: center !important;
        text-align: center !important;
    }
    /* ป้ายชื่อผู้ใช้เป็นชิป ต้องกว้างเท่าข้อความ ไม่ยืดเต็มแถว */
    html body:not(.cust-help) .main__content.profile .surin-profile-summary .surin-profile-meta {
        width: auto !important;
        margin: 8px auto 0 !important;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-summary h3 {
        margin: 0 0 2px !important;
        font-size: 18px !important;
        line-height: 1.35;
    }
    html body:not(.cust-help) .main__content.profile .surin-profile-summary .info--mail {
        margin: 0 !important;
        font-size: 13.5px !important;
    }

    /* --- การ์ดหมวด: ระยะขอบพอดีนิ้ว หัวการ์ดไม่ใหญ่เกิน --- */
    html body:not(.cust-help) .main__content.profile .pf-sec,
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload {
        padding: 13px 14px 15px !important;
        border-radius: 18px !important;
    }
    html body:not(.cust-help) .main__content.profile .pf-sec__head { margin-bottom: 11px; padding-bottom: 10px; }
    html body:not(.cust-help) .main__content.profile .pf-sec__icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; }
    html body:not(.cust-help) .main__content.profile .pf-sec__icon svg { width: 16px; height: 16px; }
    html body:not(.cust-help) .main__content.profile .pf-sec__title { font-size: 14px; }

    /* --- การ์ดรูปโปรไฟล์: ป้ายบรรทัดบน ปุ่มเลือกไฟล์เต็มบรรทัด --- */
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload > div > label { flex: 1 1 100%; }
    html body:not(.cust-help) .main__content.profile .surin-avatar-upload input[type="file"] { flex: 1 1 100%; }

    /* --- ช่องกรอก: หนึ่งช่องต่อบรรทัด ป้ายเล็กจาง ค่าตัวโต --- */
    html body:not(.cust-help) .main__content.profile .pf-sec .form-group { width: 100% !important; }
    html body:not(.cust-help) .main__content.profile .pf-sec label {
        color: #8e8e93 !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
    }
    html body:not(.cust-help) .main__content.profile .pf-sec .form-control,
    html body:not(.cust-help) .main__content.profile .pf-sec input[type="text"],
    html body:not(.cust-help) .main__content.profile .pf-sec input[type="email"] {
        border-radius: 14px !important;
        font-size: 15px !important;
    }
    html body:not(.cust-help) .main__content.profile .pf-sec textarea { border-radius: 14px !important; }

    /* --- แถวติ๊กถูก/ตัวเลือก: เป็นแถวรายการ คั่นเส้นบาง กดง่ายเต็มความกว้าง --- */
    html body:not(.cust-help) .main__content.profile .pf-sec .checkbox-custom,
    html body:not(.cust-help) .main__content.profile .pf-sec .radio-custom {
        display: flex !important;
        align-items: center;
        gap: 10px;
        width: 100% !important;
        margin: 0 !important;
        padding: 11px 2px !important;
        border: 0 !important;
        border-bottom: 1px solid #f4f6fa !important;
        border-radius: 0 !important;
        background: transparent !important;
        font-size: 14px !important;
    }
    html body:not(.cust-help) .main__content.profile .pf-sec .item--section > *:last-child .checkbox-custom,
    html body:not(.cust-help) .main__content.profile .pf-sec .checkbox-custom:last-child,
    html body:not(.cust-help) .main__content.profile .pf-sec .radio-custom:last-child { border-bottom: 0 !important; }
    html body:not(.cust-help) .main__content.profile .pf-sec .item--section {
        display: block !important;
        padding: 0 !important;
    }
    /* กล่องเทาซ้อนในการ์ด (กล่องซ้อนกล่อง) — เอาออก ให้เห็นเป็นการ์ดใบเดียว */
    html body:not(.cust-help) .main__content.profile .pf-sec .step-item,
    html body:not(.cust-help) .main__content.profile .pf-sec .item--section,
    html body:not(.cust-help) .main__content.profile .pf-sec .item--section > div {
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    /* หัวข้อย่อยในการ์ด (เช่น "ค่าเริ่มต้น") ให้เล็กลงกว่าหัวการ์ด จะได้ไม่แย่งลำดับสายตา */
    html body:not(.cust-help) .main__content.profile .pf-sec h4,
    html body:not(.cust-help) .main__content.profile .pf-sec .item--section > h3 {
        margin: 14px 0 2px !important;
        color: #8e8e93 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        letter-spacing: .02em;
    }

    /* --- ปุ่มบันทึก: เต็มความกว้าง แคปซูล อยู่ท้ายฟอร์ม --- */
    html body:not(.cust-help) .main__content.profile .right-bar__footer {
        padding: 14px 0 0 !important;
        border-top: 1px solid #f4f6fa;
    }
    html body:not(.cust-help) .main__content.profile .right-bar__footer .btn,
    html body:not(.cust-help) .main__content.profile .right-bar__footer button,
    html body:not(.cust-help) .main__content.profile .profile-password button[type="submit"] {
        width: 100% !important;
        min-height: 48px;
        border-radius: 999px !important;
        font-size: 15px !important;
    }

    /* การ์ดรหัสผ่านมีที่ว่างค้างท้ายการ์ดเกือบ 100px ให้จบพอดีปุ่ม */
    html body:not(.cust-help) .main__content.profile .profile-password .item--section,
    html body:not(.cust-help) .main__content.profile .profile-password form.form,
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__footer {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    /* .right-bar เดิมคือลิ้นชักสไลด์: หัวข้อถูกตั้ง position:fixed และตัวลิ้นชักสูงเท่าจอ
       พอเอามาใช้แบบการ์ดฝังในหน้า (is-inline) จึงเหลือที่ว่างท้ายการ์ดเกือบ 100px */
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body > h3 {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
    }
    /* สกินลิ้นชักเว้นที่ให้แถบปุ่มลอยด้วย ::after สูง 96px — การ์ดฝังในหน้าไม่มีแถบลอย จึงเป็นที่ว่างเปล่า */
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body::after {
        display: none !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding-bottom: 14px !important;
    }

    /* การ์ดเป็นไอเทมของกริด ถ้าไม่สั่ง start มันจะถูกยืดสูงเท่าแถว (align-self: stretch)
       แล้วเหลือที่ว่างท้ายการ์ด — บนมือถือให้สูงเท่าเนื้อหาจริง */
    html body:not(.cust-help) .main__content.profile .surin-profile-grid { align-items: start !important; }
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > * { align-self: start !important; }

    /* การ์ดเปลี่ยนรหัสผ่าน: ทำให้เหมือนการ์ดหมวดอื่น (ไม่มีกล่องขาวซ้อนในการ์ด) */
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__body > h3,
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .item--section,
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .right-bar__footer {
        background: transparent !important;
        border-radius: 0 !important;
    }
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .item--section {
        padding: 0 !important;
    }
    /* ช่องข้อความว่าง (ที่ไว้โชว์ error) กินที่ 32px ทั้งที่ไม่มีข้อความ */
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline p:empty { display: none !important; }
    html body:not(.cust-help) .main__content.profile .right-bar.is-inline .form-group { margin-bottom: 12px !important; }

    /* --- ปุ่ม Manage MFA / Logout: เต็มความกว้าง ความสูงเท่ากัน --- */
    html body:not(.cust-help) .main__content.profile .surin-profile-mfa .btn,
    html body:not(.cust-help) .main__content.profile .surin-profile-logout {
        display: flex !important;
        width: 100% !important;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        border-radius: 999px !important;
    }
}

/* =========================================================================
   การ์ด "คู่มือการใช้งาน" ในหน้าโปรไฟล์ (๒๖ ส.ค. ๒๕๖๙)
   จอมือถือกดแท็บ "บัญชี" มาที่หน้านี้ตรง ๆ (ไม่ผ่านเมนูรูปโปรไฟล์)
   จึงต้องมีทางเข้าคู่มืออยู่ในหน้านี้ด้วย
   ใช้ทรงเดียวกับการ์ด MFA ทุกประการ — วางไว้แถวที่ ๔ ของคอลัมน์ซ้าย
   (ถ้าไม่กำหนดแถว จะไปทับการ์ดตัวตนที่แถว ๑)
   ========================================================================= */
@media screen and (min-width: 1000px) {
    html body:not(.cust-help) .main__content.profile .surin-profile-grid > .surin-profile-manual {
        grid-column: 1;
        grid-row: 4;
        align-self: start;
    }
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 16px !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__info { margin: 0 !important; }
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__info,
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__info_list {
    display: block !important;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual h3 {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px !important;
    padding: 0 0 11px !important;
    border-bottom: 1px solid #f4f6fa !important;
    color: #1c1c1e !important;
    font-size: 14.5px !important;
    font-weight: 800 !important;
    text-align: left !important;
    text-decoration: none !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual h3::after { display: none !important; }
html body:not(.cust-help) .main__content.profile .surin-profile-manual .info--mail {
    margin: 0 !important;
    color: #6b7480;
    font-size: 13px;
    line-height: 1.55;
    text-align: left !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__control,
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__edit { margin: 0 !important; }
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__edit a { display: block; }
html body:not(.cust-help) .main__content.profile .surin-profile-manual .btn {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
}
@media screen and (max-width: 999px) {
    html body:not(.cust-help) .main__content.profile .surin-profile-manual .btn {
        display: flex !important;
        width: 100% !important;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        border-radius: 999px !important;
    }
}
/* ปุ่มในการ์ดคู่มือ — ทรงเดียวกับปุ่ม "จัดการ MFA" (ขาว-ขอบบาง-ตัวหนังสือน้ำเงิน)
   ถ้าไม่กำหนดสีเอง จะได้พื้นน้ำเงินเข้มกับตัวหนังสือดำจากธีมเดิม ซึ่งอ่านไม่ออก */
html body:not(.cust-help) .main__content.profile .surin-profile-manual .btn {
    border: 1px solid #dde7f5 !important;
    background: #fff !important;
    background-image: none !important;
    color: #1e3a8a !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
html body:not(.cust-help) .main__content.profile .surin-profile-manual .btn:hover {
    background: #f1f6fe !important;
    border-color: #c7d9f4 !important;
    color: #1e3a8a !important;
}
/* ลิงก์ที่เปิดแท็บใหม่ (target="_blank") ถูกธีมขีดเส้นใต้ — ในการ์ดนี้ไม่ต้องมี */
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__edit a,
html body:not(.cust-help) .main__content.profile .surin-profile-manual .profile__edit a:hover,
html body:not(.cust-help) .main__content.profile .surin-profile-manual .btn {
    text-decoration: none !important;
    border-bottom: 0 !important;
}
