* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --line: #06c755;
    --dark: #071b21;
    --muted: #6c7a80;
    --card: rgba(255, 255, 255, 0.92);
    --stroke: rgba(255, 255, 255, 0.55);
    --shadow: 0 22px 55px rgba(5, 35, 42, 0.22);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--dark);
    font-family: 'Anuphan', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 12% 5%, rgba(6, 199, 85, 0.45), transparent 30%),
        radial-gradient(circle at 88% 8%, rgba(0, 140, 255, 0.35), transparent 30%),
        linear-gradient(150deg, #dffbea 0%, #eaf7ff 46%, #fff6ea 100%);
}

button {
    font: inherit;
}

.customer-app {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 18px 16px 34px;
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    padding: 18px;
    border: 1px solid var(--stroke);
    border-radius: 34px;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(6, 199, 85, 0.95), rgba(0, 113, 91, 0.92)),
        url('../assets/images/logo.png') center/55% no-repeat;
    box-shadow: var(--shadow);
}

.hero-card::before,
.hero-card::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.hero-card::before {
    width: 190px;
    height: 190px;
    right: -70px;
    top: 70px;
}

.hero-card::after {
    width: 130px;
    height: 130px;
    left: -48px;
    bottom: 42px;
}

.hero-topbar,
.hero-copy,
.points-card {
    position: relative;
    z-index: 1;
}

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

.brand-logo {
    width: 52px;
    height: 52px;
    padding: 7px;
    border-radius: 18px;
    background: #fff;
    object-fit: contain;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 245px;
    padding: 7px 11px 7px 7px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
}

.profile-pill img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.profile-pill strong,
.profile-pill span {
    display: block;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-label {
    font-size: 11px;
    opacity: 0.75;
}

.hero-copy {
    padding: 56px 4px 24px;
}

.eyebrow {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 14px 0 8px;
    font-size: clamp(34px, 10vw, 52px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero-copy p {
    max-width: 320px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.6;
}

.points-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 18px;
    border-radius: 26px;
    color: var(--dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.12);
}

.points-card span,
.points-card small {
    display: block;
    color: var(--muted);
}

.points-card strong {
    display: block;
    margin: 2px 0;
    font-size: 46px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.points-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(145deg, #ffd36b, #ff9f1c);
    font-size: 27px;
}

.quick-actions,
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.quick-actions {
    grid-template-columns: 1fr;
}

.action-card,
.mini-card,
.content-card {
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: var(--card);
    box-shadow: 0 14px 38px rgba(13, 61, 72, 0.13);
    backdrop-filter: blur(18px);
}

.action-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 16px;
    border-radius: 22px;
    color: var(--dark);
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.action-card:active {
    transform: scale(0.98);
}

.action-card.primary {
    color: #fff;
    background: linear-gradient(135deg, #111827, #063b2d);
}

.action-card > span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 17px;
    color: #fff;
    background: var(--line);
    font-size: 19px;
}

.action-card.primary > span {
    background: rgba(255, 255, 255, 0.18);
}

.action-card strong,
.action-card small {
    display: block;
}

.action-card small {
    color: var(--muted);
    font-size: 12px;
}

.action-card.primary small {
    color: rgba(255, 255, 255, 0.72);
}

.mini-card {
    padding: 18px;
    border-radius: 24px;
}

.mini-card small {
    color: var(--muted);
}

.mini-card strong {
    display: block;
    margin-top: 5px;
    font-size: 34px;
}

.content-card {
    margin-top: 14px;
    padding: 18px;
    border-radius: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header span {
    color: var(--line);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-header h2 {
    margin: 1px 0 0;
    font-size: 19px;
}

.ghost-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 15px;
    color: var(--dark);
    background: #eef8f2;
    cursor: pointer;
}

.ghost-btn.spinning i {
    animation: spin 0.8s linear infinite;
}

.list-stack {
    display: grid;
    gap: 10px;
}

.subscription-dropdown {
    overflow: hidden;
    border: 1px solid #edf3f1;
    border-radius: 20px;
    background: #fff;
}

.subscription-dropdown summary {
    list-style: none;
}

.subscription-dropdown summary::-webkit-details-marker {
    display: none;
}

.subscription-item,
.order-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 15px 14px;
    border: 1px solid #edf3f1;
    border-radius: 20px;
    background: #fff;
}

.subscription-item {
    border: none;
    cursor: pointer;
}

.subscription-dropdown[open] .subscription-item {
    border-bottom: 1px solid #edf3f1;
    border-radius: 20px 20px 0 0;
}

.item-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: #0d6f43;
    background: #e9fbf0;
}

.item-icon.crown {
    color: #9a5a00;
    background: #fff3d7;
}

.item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-body strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.3;
}

.item-body span,
.item-body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.item-body small {
    font-size: 11px;
    opacity: 0.85;
}

.status-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge,
.price-tag {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge {
    color: #08753f;
    background: #defbe9;
}

.dropdown-arrow {
    color: #94a3b8;
    font-size: 12px;
    transition: transform 0.18s ease;
}

.subscription-dropdown[open] .dropdown-arrow {
    transform: rotate(180deg);
}

.subscription-detail-panel {
    display: grid;
    gap: 9px;
    padding: 12px;
    background: linear-gradient(180deg, #ffffff, #f8fffb);
}

.info-row {
    display: grid;
    grid-template-columns: minmax(112px, 0.75fr) 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 11px;
    border: 1px solid #eef6f1;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.78);
}

.info-row.copyable {
    border-color: rgba(6, 199, 85, 0.28);
    background: #fbfffd;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
}

.info-label i {
    width: 14px;
    color: var(--line);
    text-align: center;
}

.info-value-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.info-value {
    min-width: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-align: right;
}

.info-value.secret {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.copy-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 11px;
    color: #08753f;
    background: #defbe9;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.copy-btn:active {
    transform: scale(0.92);
}

.copy-btn.copied {
    color: #fff;
    background: var(--line);
}

.price-tag {
    color: #0f172a;
    background: #f1f5f9;
}

.renew-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 3px;
    padding: 13px 16px;
    border: none;
    border-radius: 15px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #06c755, #03935f);
    box-shadow: 0 8px 20px rgba(6, 199, 85, 0.32);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.renew-btn i {
    font-size: 15px;
}

.renew-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.28);
}

.renew-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.loading-row,
.empty-state {
    padding: 24px 12px;
    border: 1px dashed #cde1d7;
    border-radius: 20px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.empty-state i {
    display: block;
    margin-bottom: 10px;
    color: var(--line);
    font-size: 28px;
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state span {
    margin-top: 4px;
    font-size: 13px;
}

.toast {
    position: fixed;
    right: 16px;
    bottom: 18px;
    left: 16px;
    z-index: 20;
    max-width: 480px;
    margin: 0 auto;
    padding: 13px 16px;
    border-radius: 18px;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 560px) {
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
}

/* มือถือจอแคบ */
@media (max-width: 430px) {
    .customer-app {
        padding: 14px 12px 28px;
    }

    .hero-card {
        min-height: auto;
        padding: 16px;
        border-radius: 28px;
    }

    .hero-copy {
        padding: 40px 2px 18px;
    }

    .hero-copy h1 {
        font-size: clamp(28px, 9vw, 40px);
    }

    .hero-copy p {
        font-size: 13.5px;
    }

    .profile-pill {
        max-width: 180px;
        padding: 6px 10px 6px 6px;
    }

    .profile-pill img {
        width: 36px;
        height: 36px;
    }

    .profile-pill strong,
    .profile-pill span {
        max-width: 110px;
    }

    .points-card {
        padding: 16px;
        border-radius: 22px;
    }

    .points-card strong {
        font-size: 38px;
    }

    .points-icon {
        width: 54px;
        height: 54px;
        font-size: 23px;
    }

    .content-card {
        padding: 15px;
        border-radius: 24px;
    }

    .section-header h2 {
        font-size: 17px;
    }

    .subscription-item,
    .order-item {
        gap: 11px;
        padding: 13px 12px;
    }

    .item-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .item-body strong {
        font-size: 14px;
    }

    /* บนจอแคบ ให้ label/value ของ info-row เรียงเป็นแนวตั้ง กันบรรทัดเบียด */
    .info-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .info-value-wrap {
        justify-content: space-between;
    }

    .info-value {
        text-align: left;
    }
}

/* จอเล็กมาก */
@media (max-width: 340px) {
    .hero-copy h1 {
        font-size: 26px;
    }

    .points-card strong {
        font-size: 32px;
    }

    .status-badge,
    .price-tag {
        padding: 6px 8px;
        font-size: 11px;
    }
}
