/* ============================================================
   Mango theme — modern warm (orange → golden) skin layer.
   Loaded AFTER style.css in temp.blade.php so it overrides the
   Finapp default purple (#6236FF). Uses !important where the
   base theme also uses !important.
   ============================================================ */

:root {
    --app-bottom-menu-height: 72px;
    --mango-600: #FF7A00;
    --mango-500: #FF9500;
    --mango-400: #FFB020;
    --mango-300: #FFC83D;
    --mango-ink: #4A3500;          /* warm dark text on light bg */
    --mango-soft: #FFF6E6;         /* soft cream surface */
    --mango-grad: linear-gradient(135deg, #FF8A00 0%, #FFC400 100%);
    --mango-grad-strong: linear-gradient(120deg, #FF7A00 0%, #FFB000 55%, #FFC83D 100%);
    --mango-shadow: 0 12px 28px -8px rgba(255, 138, 0, 0.45);
}

/* ---------- Full-screen action sheet (modal ทำรายการ) ---------- */
.modal.action-sheet.sheet-full .modal-dialog {
    top: 0; bottom: 0; height: 100%; height: 100dvh; max-width: 100%;
}
.modal.action-sheet.sheet-full .modal-content {
    height: 100%; display: flex; flex-direction: column;
}
.modal.action-sheet.sheet-full .modal-content .modal-header {
    flex-shrink: 0; padding: 16px 16px 12px; position: relative;
    border-bottom: 1px solid #f3eee3;
}
.modal.action-sheet.sheet-full .modal-content .modal-body {
    flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column;
}
.modal.action-sheet.sheet-full .modal-content .action-sheet-content {
    max-height: none; height: auto; flex: 1; padding-top: 16px;
}
.modal.action-sheet.sheet-full .close-button {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    font-size: 26px; position: absolute; right: 8px; top: 8px; color: #b5a98e; z-index: 2;
}

/* ---------- Base readability: เพิ่มขนาดฟอนต์ฐานทั้งแอป ----------
   ผู้ใช้กลุ่มหลักอ่านตัวเล็กลำบาก → ยก base 15px (Finapp) เป็น 16px.
   มีผลกับข้อความที่สืบทอดขนาด (body text, listview, ปุ่ม, ฟอร์ม ฯลฯ);
   จุดที่ระบุ px ตายตัวยังคุมแยกในแต่ละ component. ปรับ base ที่นี่ที่เดียว. */
body {
    font-size: 16px;
}

/* ---------- Loading splash (override Finapp purple #6236FF) ---------- */
#loader {
    background: var(--mango-grad-strong) !important;
}
#loader .loading-icon {
    width: 88px;
    height: 88px;
    padding: 16px;
    background: #fff;
    border-radius: 50%;
    object-fit: contain;
    box-shadow: 0 14px 34px -10px rgba(74, 53, 0, 0.55);
    animation: mangoLoaderPulse 1s ease-in-out infinite !important;
}
@keyframes mangoLoaderPulse {
    0%, 100% { transform: scale(0.93); opacity: 0.85; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* ---------- App header ---------- */
.appHeader.bg-primary {
    background: var(--mango-grad-strong) !important;
    box-shadow: 0 4px 14px -6px rgba(255, 122, 0, 0.55);
}
.appHeader.bg-primary:before {
    background: var(--mango-500) !important;
}
.appHeader .pageTitle {
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* White circular badge so the mango logo stands out on the orange header */
.appHeader .pageTitle .logo {
    max-height: none;
    width: 34px;
    height: 34px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 2px 6px -2px rgba(74, 53, 0, 0.45);
}
.appHeader .headerButton {
    color: #fff;
}

/* ---------- Bottom menu (active state) ---------- */
.appBottomMenu .item.active:before {
    background: var(--mango-500);
}
.appBottomMenu .item.active .icon,
.appBottomMenu .item.active ion-icon,
.appBottomMenu .item.active strong {
    color: var(--mango-600) !important;
}

/* ---------- Primary buttons / text / badges ---------- */
.btn-primary {
    background: var(--mango-grad) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(255, 138, 0, 0.6);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, #FF7A00 0%, #FFB000 100%) !important;
    border-color: transparent !important;
}
.text-primary,
a.text-primary {
    color: var(--mango-600) !important;
}
.badge-primary,
a.badge-primary {
    background: var(--mango-500);
}

/* ============================================================
   Home page — modern components
   ============================================================ */

/* ---------- Greeting ---------- */
.greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}
.greeting .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    padding: 3px;
    background: var(--mango-grad);
}
.greeting .hello {
    font-size: 12px;
    color: #9a8f78;
    line-height: 1.2;
}
.greeting .name {
    font-size: 16px;
    font-weight: 700;
    color: var(--mango-ink);
}

/* ---------- Hero wallet card ---------- */
.mango-wallet {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px 22px 18px;
    background: var(--mango-grad-strong);
    box-shadow: var(--mango-shadow);
    color: #fff;
}
/* decorative bubbles */
.mango-wallet:before,
.mango-wallet:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    z-index: 0;
}
.mango-wallet:before {
    width: 160px;
    height: 160px;
    top: -70px;
    right: -40px;
}
.mango-wallet:after {
    width: 110px;
    height: 110px;
    bottom: -60px;
    left: -30px;
}
.mango-wallet > * {
    position: relative;
    z-index: 1;
}
.mango-wallet .wallet-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.mango-wallet .wallet-label {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}
.mango-wallet .wallet-balance {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 6px 0 0;
    line-height: 1.1;
}
.mango-wallet .topup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}
.mango-wallet .topup-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}
.mango-wallet .bonus-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 13px;
}
.mango-wallet .bonus-chip strong {
    font-weight: 700;
}
.mango-wallet .wallet-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.mango-wallet .wallet-actions .act {
    flex: 1;
    text-align: center;
    color: #fff;
}
.mango-wallet .wallet-actions .act .ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 6px;
    border-radius: 14px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    transition: transform 0.15s ease, background 0.2s ease;
}
.mango-wallet .wallet-actions .act:active .ico {
    transform: scale(0.92);
}
.mango-wallet .wallet-actions .act strong {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.95;
}

/* ---------- Section heading ---------- */
.mango-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.mango-heading .title {
    font-size: 17px;
    font-weight: 700;
    color: var(--mango-ink);
    margin: 0;
}
.mango-heading .count {
    font-size: 12px;
    font-weight: 600;
    color: var(--mango-600);
    background: var(--mango-soft);
    padding: 3px 10px;
    border-radius: 999px;
}

/* ---------- Country group label (divider) ---------- */
.country-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #5a4f3c;
    margin: 22px 2px 12px;
}
.country-label img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px -2px rgba(0, 0, 0, 0.3);
}
.country-label:after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 6px;
    background: linear-gradient(to right, #ece5d8, transparent);
}

/* ---------- Lottery card ---------- */
.lotto-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 20px;
    padding: 14px 16px 14px 20px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 10px 22px -16px rgba(74, 53, 0, 0.5);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* left accent bar */
.lotto-card:before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--mango-grad);
}
.lotto-card:active {
    transform: scale(0.985);
    border-color: var(--mango-300);
    box-shadow: 0 6px 14px -12px rgba(74, 53, 0, 0.4);
}
.lotto-card .flag-wrap {
    position: relative;
    flex-shrink: 0;
}
.lotto-card .flag {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.3);
}
.lotto-card .info {
    flex: 1;
    min-width: 0;
}
.lotto-card .info .nm {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--mango-ink);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lotto-card .info .close {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #9a8f78;
    font-weight: 600;
    background: #faf6ee;
    padding: 3px 9px;
    border-radius: 999px;
}
.lotto-card .info .close ion-icon {
    font-size: 13px;
    color: var(--mango-500);
}
.lotto-card .lotto-card-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    flex-shrink: 0;
}
/* circular "go" button */
.lotto-card .go {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 17px;
    color: #fff;
    background: var(--mango-grad);
    box-shadow: 0 6px 14px -6px rgba(255, 138, 0, 0.75);
}

/* status pill */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.pill.open {
    color: #1a9c54;
    background: #e6f9ee;
}
.pill.open .dot {
    background: #1dcc70;
    box-shadow: 0 0 0 3px rgba(29, 204, 112, 0.18);
}
.pill.closed {
    color: #8a8a8a;
    background: #f0f0f0;
}
.pill.closed .dot {
    background: #b5b5b5;
}

/* ============================================================
   Huay TH page — hero + transaction list
   ============================================================ */

/* ---------- Hero header ---------- */
.gradientSection {
    position: relative;
    overflow: hidden;
    background: var(--mango-grad-strong);
    box-shadow: var(--mango-shadow);
}
.gradientSection:after {
    content: "";
    position: absolute;
    right: -36px;
    top: -36px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}
.hero-head {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.hero-head .total {
    margin: 0;
}
.hero-flag {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.hero-sub {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
    margin: 4px 0 0;
    position: relative;
    z-index: 1;
}
.hero-stats {
    display: flex;
    align-items: stretch;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 10px 4px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(2px);
}
.hero-stat {
    flex: 1;
    text-align: center;
    color: #fff;
}
.hero-stat .v {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}
.hero-stat .l {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}
.hero-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.28);
    margin: 2px 0;
}

/* ---------- Section header with count ---------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px 10px;
}
.section-head .section-title {
    margin: 0;
}
.count-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--mango-600);
    background: var(--mango-soft);
    border-radius: 999px;
    padding: 3px 10px;
}

/* ---------- Transaction card enhancements ---------- */
.transactions .item {
    position: relative;
    padding: 16px 16px 16px 18px;
    gap: 10px;
}
.transactions .item:before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--mango-grad);
}
/* ให้ฝั่งซ้ายหดได้ ไม่ดันราคาล้นการ์ด */
.transactions .item .detail {
    flex: 1;
    min-width: 0;
}
.transactions .item .detail .image-block {
    margin-right: 12px;
    flex-shrink: 0;
}
.transactions .item .detail > div {
    min-width: 0;
}
.transactions .item .detail h3 {
    font-size: 14px;
    letter-spacing: 0;
    white-space: nowrap;
}
.tx-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
}
.chip ion-icon {
    font-size: 12px;
}
.chip.memo {
    background: rgba(46, 196, 182, 0.14);
    color: #1aa193;
}
.chip.status-pending {
    background: var(--mango-soft);
    color: var(--mango-600);
}
.chip.status-win {
    background: #e6f9ee;
    color: #1a9c54;
}
.chip.status-lose {
    background: #fdecea;
    color: #e1493f;
}
.chip.pay-full {
    background: #e9f4ff;
    color: #1675c7;
}
.chip.pay-half {
    background: #fff2dd;
    color: #c87f16;
}
.transactions .item .right {
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    padding-left: 8px;
}
.transactions .item .right .price {
    font-size: 16px;
}
.transactions .item .right .price .cur {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.6;
    margin-right: 2px;
}
.transactions .item .right .unit {
    display: block;
    font-size: 11px;
    color: #9a8f78;
    font-weight: 400;
    margin-top: 2px;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 44px 24px;
    color: #9a8f78;
}
.empty-state ion-icon {
    font-size: 60px;
    color: #d8d2c6;
}
.empty-state .t {
    font-weight: 700;
    color: #5a4f3c;
    margin-top: 12px;
    font-size: 15px;
}
.empty-state .s {
    font-size: 13px;
    margin-top: 4px;
}

/* ---------- Skeleton loading ---------- */
.skeleton-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(74, 53, 0, 0.05);
}
.sk {
    background: linear-gradient(90deg, #f1ece3 25%, #e7e0d3 37%, #f1ece3 63%);
    background-size: 400% 100%;
    animation: skShimmer 1.3s ease infinite;
    border-radius: 6px;
}
.sk-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
}
.sk-lines {
    flex: 1;
}
.sk-line {
    height: 11px;
    margin-bottom: 7px;
}
.sk-line.w70 {
    width: 70%;
}
.sk-line.w40 {
    width: 40%;
}
.sk-line.w55 {
    width: 55%;
    margin-bottom: 0;
}
@keyframes skShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* ============================================================
   Huay TH detail page — poy summary hero + result cards
   ============================================================ */

/* ---------- Poy summary (reuses .gradientSection + .hero-stats) ---------- */
.poy-hero .poy-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}
.poy-hero .poy-no {
    text-align: center;
    color: #fff;
    font-weight: 800;
    font-size: 23px;
    letter-spacing: 1px;
    margin: 3px 0 0;
    word-break: break-all;
    position: relative;
    z-index: 1;
}

/* ---------- Result card ---------- */
.result-card {
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 10px 22px -16px rgba(74, 53, 0, 0.5);
}
.result-card .rc-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.result-card .rc-flag {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.3);
}
.result-card .rc-title {
    flex: 1;
    min-width: 0;
}
.result-card .rc-type {
    font-size: 14px;
    font-weight: 700;
    color: var(--mango-ink);
    margin: 0 0 6px;
}
.result-card .rc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.result-card .rc-number {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1px;
    flex-shrink: 0;
    color: var(--mango-ink);
}
.result-card .rc-number.win {
    color: #1a9c54;
}
.result-card .rc-number.lose {
    color: #e1493f;
}
.result-card .rc-number.wait {
    color: var(--mango-600);
}
.result-card .rc-body {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #ece5d8;
}
/* แต่ละโหมด (ตรง/โต๊ด) เป็นบล็อกในการ์ดเดียว มีเส้นคั่น */
.result-card .rc-mode + .rc-mode {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ece5d8;
}
.result-card .rc-mode-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.result-card .rc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
}
.result-card .rc-row .k {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8a8170;
}
.result-card .rc-row .k .rate {
    font-size: 12px;
    font-weight: 600;
    color: #8a6d3f;
    background: #f4ead7;
    padding: 2px 8px;
    border-radius: 999px;
}
.result-card .rc-row .v {
    font-weight: 700;
    color: var(--mango-ink);
}
.result-card .rc-row.prize {
    margin-top: 6px;
    padding-top: 9px;
    border-top: 1px solid #f4efe6;
}
.result-card .rc-row.prize .k {
    color: #5a4f3c;
    font-weight: 600;
}
.result-card .rc-row.prize .k ion-icon {
    color: var(--mango-500);
    font-size: 16px;
}
.result-card .rc-row.prize .v.win {
    color: #1a9c54;
    font-size: 15px;
}

/* ============================================================
   Member page — profile hero + info / bank cards
   ============================================================ */

/* ---------- Profile hero (sits inside .section.full.gradientSection) ---------- */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 18px;
    position: relative;
    z-index: 1;
}
.profile-hero .ph-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3);
}
.profile-hero .ph-info {
    min-width: 0;
}
.profile-hero .ph-name {
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
}
.profile-hero .ph-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.profile-hero .ph-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(2px);
}
.profile-hero .ph-chip ion-icon {
    font-size: 13px;
}

/* ---------- Info card (key / value list) ---------- */
.info-card {
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 18px;
    padding: 4px 16px;
    box-shadow: 0 10px 22px -16px rgba(74, 53, 0, 0.5);
}
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #f4efe6;
}
.info-row:last-child {
    border-bottom: 0;
}
.info-row .k {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    font-size: 13px;
    color: #8a8170;
}
.info-row .k ion-icon {
    font-size: 18px;
    color: var(--mango-500);
}
.info-row .v {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mango-ink);
    text-align: right;
    min-width: 0;
}
a.info-row {
    text-decoration: none;
}
.info-row .v.link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mango-600);
}
.info-row .v.link ion-icon {
    font-size: 16px;
}

/* ---------- Bank account card ---------- */
.bank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 22px -16px rgba(74, 53, 0, 0.5);
}
.bank-card .bank-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    font-size: 24px;
    color: #fff;
    background: var(--mango-grad);
    box-shadow: 0 6px 14px -6px rgba(255, 138, 0, 0.7);
}
.bank-card .bank-info {
    flex: 1;
    min-width: 0;
}
.bank-card .bank-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mango-ink);
    margin: 0;
}
.bank-card .bank-acct {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--mango-600);
    margin: 3px 0;
}
.bank-card .bank-holder {
    font-size: 12px;
    color: #9a8f78;
    margin: 0;
}
.count-pill ion-icon {
    font-size: 13px;
    vertical-align: -2px;
}

/* ============================================================
   History pages — filter bar + transaction variants
   ============================================================ */

/* ---------- Filter card (date + select) ---------- */
.filter-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 22px -16px rgba(74, 53, 0, 0.5);
}
.filter-field {
    position: relative;
    flex: 1;
    min-width: 0;
}
.filter-field > ion-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    color: var(--mango-500);
    pointer-events: none;
    z-index: 1;
}
.filter-field input,
.filter-field select {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 38px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mango-ink);
    background: #fcfaf5;
    border: 1px solid #efe8da;
    border-radius: 12px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-field select {
    padding-right: 30px;
}
.filter-field input:focus,
.filter-field select:focus {
    border-color: var(--mango-400);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.15);
}
.filter-field.has-caret:after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #b5a98e;
    border-bottom: 2px solid #b5a98e;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* ---------- Order card (history, expandable) ---------- */
.order-card {
    background: #fff;
    border: 1px solid #f2ede3;
    border-radius: 16px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 6px 16px -14px rgba(74, 53, 0, 0.5);
}
.order-card .oc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
}
.order-card .oc-head .image-block {
    flex-shrink: 0;
    margin-right: 0;
}
.order-card .oc-info {
    flex: 1;
    min-width: 0;
}
.order-card .oc-info h3 {
    font-size: 14px;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-card .oc-preview {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--mango-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-card .oc-preview ion-icon {
    font-size: 15px;
    color: var(--mango-500);
    flex-shrink: 0;
}
.order-card .oc-end {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}
.order-card .oc-end .price {
    font-size: 16px;
}
.order-card .oc-caret {
    font-size: 20px;
    color: #b5a98e;
    transition: transform 0.2s ease;
}
.order-card.open .oc-caret {
    transform: rotate(180deg);
}
.order-card .oc-body {
    display: none;
    padding: 4px 16px 12px;
    margin: 0 2px;
    border-top: 1px dashed #ece5d8;
}
.order-card.open .oc-body {
    display: block;
}
.order-card .oc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f7f3eb;
}
.order-card .oc-row:last-of-type {
    border-bottom: 0;
}
.order-card .oc-num {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--mango-ink);
}
.order-card .oc-bet {
    font-size: 12.5px;
    font-weight: 600;
    color: #7d7259;
    text-align: right;
}
.order-card .oc-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mango-600);
}

/* ---------- Round transaction icon (deposit / withdraw / bonus) ---------- */
.transactions .item .detail .tx-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 22px;
    flex-shrink: 0;
}
.tx-ico.in {
    color: #1a9c54;
    background: #e6f9ee;
}
.tx-ico.out {
    color: #e1493f;
    background: #fdecea;
}
.tx-ico.bonus {
    color: var(--mango-600);
    background: var(--mango-soft);
}

/* status chip variant for "ไม่ถูกรางวัล" already exists (.chip.status-lose) */

/* ---------- Referral child count badge ---------- */
.child-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mango-600);
    background: var(--mango-soft);
    padding: 6px 12px;
    border-radius: 999px;
}
.child-count ion-icon {
    font-size: 16px;
}

/* ============================================================
   Forms, selects & modals — on-theme + readable (global)
   ============================================================ */

/* ---------- Action-sheet modal ---------- */
.modal.action-sheet .modal-content {
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}
.modal.action-sheet .modal-content .modal-header {
    padding: 16px 20px;
    background: var(--mango-grad-strong);
}
.modal.action-sheet .modal-content .modal-header .modal-title {
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}
.modal.action-sheet .modal-content .action-sheet-content {
    padding: 20px 18px;
}

/* ---------- Labels ---------- */
.form-group .label,
.form-group.basic .label {
    font-size: 14.5px;
    font-weight: 600;
    color: #5a4f3c;
    margin-bottom: 7px;
}

/* ---------- Text / number / date inputs ---------- */
.form-control,
.form-group.basic .form-control,
.form-group.boxed .form-control {
    font-size: 16px;
    font-weight: 600;
    color: var(--mango-ink);
}
/* native <select> + ตัวเลือก ให้อ่านง่าย (popup option เล็กบน desktop chrome) */
select.form-control { font-size: 16px; }
select.form-control option, .form-control option, select option { font-size: 16px; }
.form-control::placeholder {
    font-weight: 400;
    color: #b5a98e;
}
.form-control:focus,
.form-group.basic .form-control:focus,
.form-group.boxed .form-control:focus,
.form-group.basic .custom-select:focus {
    border-color: var(--mango-400);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.15);
}

/* ---------- Select control + dropdown options (อ่านชัด) ---------- */
select.form-control,
.custom-select,
.form-group .custom-select,
.filter-field select {
    font-size: 15px;
    font-weight: 600;
    color: var(--mango-ink);
}
select option,
.custom-select option,
.filter-field select option {
    font-size: 16px;
    font-weight: 500;
    color: #4a3500;
    background: #fff;
    padding: 12px 10px;
}

/* ---------- Currency prefix (฿) ---------- */
.input-group .input-group-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--mango-600);
    background: var(--mango-soft);
    border-color: #efe8da;
}

/* ---------- File upload (slip) ---------- */
.custom-file-upload label {
    border-color: var(--mango-300);
    color: var(--mango-600);
}
.custom-file-upload strong i {
    font-size: 14px;
}

/* ---------- Modal action buttons ---------- */
.action-sheet-content .btn-block.btn-lg {
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
}

/* ============================================================
   Custom select — native <option> can't be enlarged on
   desktop/iOS, so this replaces it with a CSS-controlled menu.
   ============================================================ */
.mango-select {
    position: relative;
    flex: 1;
    min-width: 0;
}
.mango-select .ms-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--mango-ink);
    background: #fcfaf5;
    border: 1px solid #efe8da;
    border-radius: 12px;
    text-align: left;
    outline: none;
}
.mango-select .ms-trigger .ms-lead {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--mango-500);
}
.mango-select .ms-trigger .ms-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mango-select .ms-trigger .ms-caret {
    flex-shrink: 0;
    font-size: 16px;
    color: #b5a98e;
    transition: transform 0.2s ease;
}
.mango-select.open .ms-trigger {
    border-color: var(--mango-400);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.15);
}
.mango-select.open .ms-trigger .ms-caret {
    transform: rotate(180deg);
}
.mango-select .ms-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1100;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #f0e9da;
    border-radius: 14px;
    box-shadow: 0 16px 34px -12px rgba(74, 53, 0, 0.4);
}
.mango-select.open .ms-menu {
    display: block;
}
.mango-select .ms-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--mango-ink);
    background: none;
    border: none;
    border-radius: 10px;
    text-align: left;
}
.mango-select .ms-option:active {
    background: #faf6ee;
}
.mango-select .ms-option.selected {
    background: var(--mango-soft);
    color: var(--mango-600);
}
.mango-select .ms-option.selected:after {
    content: "";
    width: 6px;
    height: 11px;
    flex-shrink: 0;
    border-right: 2px solid var(--mango-600);
    border-bottom: 2px solid var(--mango-600);
    transform: rotate(45deg);
    margin: 0 3px 2px 8px;
}

/* ============================================================
   Toast (mangoToast) — transient feedback for API results
   ============================================================ */
.mango-toast {
    position: fixed;
    left: 50%;
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 2000;
    max-width: 88%;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    background: #4a3f30;
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, 18px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    pointer-events: none;
}
.mango-toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}
.mango-toast.error {
    background: linear-gradient(135deg, #e1493f 0%, #c5362d 100%);
}
.mango-toast.success {
    background: linear-gradient(135deg, #1dc275 0%, #14a862 100%);
}
.mango-toast.info {
    background: var(--mango-grad-strong);
    color: #fff;
}

/* ============================================================
   Accessible typography — large, high-legibility Thai UI
   Target users include older adults; keep supporting text >=14px,
   normal content >=16px, and controls large enough to read/tap.
   ============================================================ */
html { font-size: 17px; }
body {
    font-size: 17px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
p, .text-muted, .card-text, .listview .text, .listview .text small {
    font-size: 16px;
    line-height: 1.55;
}
.section-title, .section-title-lg, .section-head .section-title {
    font-size: 19px !important;
    line-height: 1.35;
    font-weight: 800;
}
.appHeader .pageTitle { font-size: 18px !important; }
.appBottomMenu { height: 70px; }
.appBottomMenu .item .col strong {
    font-size: 14.5px !important;
    line-height: 1.2;
    white-space: nowrap;
}
.appBottomMenu .item .col ion-icon { font-size: 25px !important; }
.btn, button, .btn-lg, .btn-block { font-size: 16px; }
.form-group .label, .form-group.basic .label { font-size: 16px !important; }
.form-control, .form-group.basic .form-control, .form-group.boxed .form-control,
select.form-control, .custom-select { font-size: 17px !important; }
.chip, .badge, .count-pill, .status-chip { font-size: 14px !important; }
.empty-state .t { font-size: 18px !important; }
.empty-state .s { font-size: 15px !important; line-height: 1.5; }
.transactions .item h3, .item .in h3 { font-size: 17px !important; }
.tx-time, .transactions .item h5 { font-size: 14.5px !important; }
.transactions .price, .price { font-size: 18px; }
.appFooter, .appFooter .footer-title { font-size: 14px !important; line-height: 1.5; }
.mango-toast { font-size: 16px; line-height: 1.45; }

/* Shared small/status copy */
.notif-head button, .notif-empty, .notif-item .ni-title,
.notif-item .ni-msg, .notif-item .ni-date,
.tx-badge, .tx-note, .tx-slip-btn,
.wallet-note, .wallet-error, .wallet-empty,
.wl-info .wl-title, .wl-info .wl-sub, .wl-status, .wl-note, .wl-slip-btn,
.rw-prog-head, .rw-prog-sub, .rw-stat .l, .rw-earned .rw-e,
.rw-team-link .tl-info span, .rw-act strong, .rw-card-head,
.rw-invite-code, .rw-tier-cur, .rw-tier-self, .rw-tier-sub,
.rw-tier-rates, .rw-ladder-note,
.type-info, .num-hint, .permute-head, .permute-count,
.permute-tools .pt-btn, .poy-amt .t, .poy-amt .cur,
.poy-submit-info .l, .conf-item, .conf-item .chip, .conf-row {
    font-size: 14.5px !important;
    line-height: 1.5;
}

/* Rates / limits / results — information-dense screens */
.rate-note, .rate-foot, .limit-legend { font-size: 15px !important; line-height: 1.5; }
.rate-name, .lim-sub-name, .rs-name { font-size: 18px !important; }
.rate-digit, .rt-head .rt-col, .rs-lot, .rs-prize .rs-pname,
.rs-pending, .pz-stat .l, .pz-head .pz-sub, .pz-chip,
.pz-it, .pz-it .pz-mode, .lim-chip .t {
    font-size: 14.5px !important;
}
.rt-mode { font-size: 16px !important; }
.rt-normal { font-size: 24px !important; }
.rt-half { font-size: 20px !important; }
.lim-chip .n, .pz-stat .v { font-size: 19px !important; }
.rs-num { font-size: 21px !important; }
.pz-head h3 { font-size: 17px !important; }
.pz-amount { font-size: 20px !important; }

/* Buy flow and order history */
.buy-hero-title, .buy-status, .buy-hero-stats .stat .l,
.buy-hero-note, .bet-type-skeleton { font-size: 14.5px !important; }
.buy-hero-round, .buy-hero-stats .stat .v { font-size: 21px !important; }
.bet-card-title, .bt-group-head, .bet-type, .btn-permute,
.bulk-fill .bf-title, .bulk-fill .bf-btn, .btn-add,
.poy-info strong, .poy-price, .poy-submit-btn { font-size: 16px !important; }
.order-card .oc-info h3 { font-size: 18px !important; }
.order-card .tx-time, .order-card .chip, .draw-group-head .dg-lot { font-size: 14.5px !important; }
.order-card .oc-preview, .order-card .oc-bet, .order-card .oc-detail-link,
.draw-group-head { font-size: 16px !important; }

/* Auth pages override their page-local compact styles */
.auth-page .login-kicker, .auth-page .field-help, .auth-page .ref-note {
    font-size: 14px !important;
}
.auth-page .login-hero p, .auth-page .login-alt, .auth-page .login-error {
    font-size: 16px !important;
}
.auth-page .login-hero h2 { font-size: 27px !important; }
.auth-page .form-group.basic .form-control { font-size: 17px !important; }

@media (max-width: 374px) {
    .appBottomMenu .item .col strong { font-size: 13.5px !important; }
}

/* Mobile reading mode — tuned for real phones and older users. */
@media (max-width: 575.98px) {
    html { font-size: 19px; }
    body {
        font-size: 19px;
        line-height: 1.6;
    }

    p, .text-muted, .card-text, .listview .text,
    .listview .text small {
        font-size: 17px !important;
        line-height: 1.6;
    }

    .section-title, .section-title-lg, .section-head .section-title,
    .mango-heading {
        font-size: 22px !important;
        line-height: 1.4;
    }

    .appHeader .pageTitle { font-size: 20px !important; }

    .appBottomMenu { height: 78px !important; }
    .appBottomMenu .item .col strong {
        font-size: 16px !important;
        line-height: 1.2;
    }
    .appBottomMenu .item .col ion-icon { font-size: 29px !important; }

    .mango-wallet .wallet-label { font-size: 18px !important; }
    .mango-wallet .wallet-balance { font-size: 36px !important; }
    .mango-wallet .bonus-chip { font-size: 17px !important; }
    .mango-wallet .wallet-actions .act strong { font-size: 17px !important; }
    .mango-wallet .wallet-actions .act .ico {
        width: 48px;
        height: 48px;
        font-size: 25px;
    }

    .info-card { padding: 5px 18px; }
    .info-row {
        min-height: 72px;
        padding: 15px 0;
        align-items: center;
    }
    .info-row .k,
    .info-row .v {
        font-size: 18px !important;
        line-height: 1.45;
    }
    .info-row .k ion-icon { font-size: 24px !important; }
    .info-row .v.link ion-icon { font-size: 21px !important; }

    /* Home sale/result cards are declared inside the page after this stylesheet. */
    .result-section-head .title { font-size: 21px !important; }
    .result-section-head .title ion-icon { font-size: 24px !important; }
    .sale-card .rc-head,
    .result-card .rc-head {
        min-height: 66px;
        padding: 14px 16px !important;
    }
    .sale-card .rc-head img,
    .result-card .rc-head img {
        width: 32px !important;
        height: 32px !important;
    }
    .sale-card .rc-grp,
    .result-card .rc-grp { font-size: 19px !important; }
    .sale-badge,
    .result-card .rc-date {
        font-size: 16px !important;
        padding: 5px 12px !important;
    }
    .sale-sub {
        min-height: 60px !important;
        padding: 13px 16px !important;
    }
    .sale-close,
    .sale-go { font-size: 17px !important; }

    .btn, button, .btn-lg, .btn-block { font-size: 18px !important; }
    .form-group .label, .form-group.basic .label { font-size: 18px !important; }
    .form-control, .form-group.basic .form-control,
    .form-group.boxed .form-control, select.form-control, .custom-select {
        font-size: 18px !important;
    }
}

/* ---------- Main navigation — mirrors the home shortcuts ---------- */
.appBottomMenu {
    min-height: 72px;
    height: calc(var(--app-bottom-menu-height) + env(safe-area-inset-bottom)) !important;
    padding: 7px 6px env(safe-area-inset-bottom);
    border-top: 0;
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -8px 26px rgba(54, 45, 34, .12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.appBottomMenu .item { height: 58px; min-width: 0; color: #756f68; border-radius: 15px; }
.appBottomMenu .item:before { display: none; }
.appBottomMenu .item .col { padding: 0 2px; }
.appBottomMenu .item .nav-icon {
    width: 34px; height: 30px; margin: 0 auto 2px; display: flex;
    align-items: center; justify-content: center; border-radius: 11px;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.appBottomMenu .item .nav-icon ion-icon {
    margin: 0 !important; font-size: 23px !important;
    color: var(--nav-color, #6b7280) !important;
}
.appBottomMenu .item .col strong {
    display: block !important; visibility: visible !important; opacity: 1 !important;
    max-width: 100%; margin-top: 0; overflow: visible; color: #706a63 !important;
    font-size: clamp(10px, 3vw, 12.5px) !important; line-height: 1.15; font-weight: 700;
    white-space: nowrap;
}
.appBottomMenu .item[data-nav="buy"] { --nav-color: #f97316; --nav-soft: #fff0e5; }
.appBottomMenu .item[data-nav="rate"] { --nav-color: #059669; --nav-soft: #e5f8f1; }
.appBottomMenu .item[data-nav="limit"] { --nav-color: #dc2626; --nav-soft: #feecec; }
.appBottomMenu .item[data-nav="result"] { --nav-color: #2563eb; --nav-soft: #eaf1ff; }
.appBottomMenu .item[data-nav="history"] { --nav-color: #7c3aed; --nav-soft: #f1ebff; }
.appBottomMenu .item[data-nav="account"] { --nav-color: #6d28d9; --nav-soft: #f1eafe; }
.appBottomMenu .item.active { background: var(--nav-soft, #fff4e6); }
.appBottomMenu .item.active .nav-icon {
    background: var(--nav-color, var(--mango-500));
    box-shadow: 0 5px 12px color-mix(in srgb, var(--nav-color, #f97316) 28%, transparent);
    transform: translateY(-1px);
}
.appBottomMenu .item.active .nav-icon ion-icon,
.appBottomMenu .item.active:hover .nav-icon ion-icon { color: #fff !important; }
.appBottomMenu .item.active strong { color: var(--nav-color, var(--mango-600)) !important; }
.appBottomMenu .item:hover .nav-icon ion-icon { color: var(--nav-color, #6b7280) !important; }
#appCapsule { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

@media (max-width: 374px) {
    .appBottomMenu { padding-left: 3px; padding-right: 3px; }
    .appBottomMenu .item .col strong { font-size: 10px !important; letter-spacing: -.2px; }
    .appBottomMenu .item .nav-icon { width: 30px; height: 28px; }
    .appBottomMenu .item .nav-icon ion-icon { font-size: 21px !important; }
}

@media (max-width: 339px) {
    .appBottomMenu .item .col strong { font-size: 9px !important; }
    .appBottomMenu .item .col { padding: 0 1px; }
}
