:root {
    --accent: #527453;
    --accent-dark: #304a35;
    --accent-soft: #e7efe5;
    --accent-shadow: rgba(55, 91, 61, .24);
    --ink: #241f1c;
    --muted: #81756e;
    --surface: #fffdfb;
    --line: rgba(83, 66, 57, .11);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: #f6f1eb;
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
    min-width: 300px;
    background:
        radial-gradient(circle at 92% 4%, rgba(209, 174, 132, .23), transparent 24rem),
        radial-gradient(circle at 0 35%, var(--accent-soft), transparent 28rem),
        #f6f1eb;
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.miniapp { min-height: 100vh; min-height: 100dvh; padding-bottom: 106px; }
.content { width: min(100%, 620px); margin: 0 auto; padding: max(19px, env(safe-area-inset-top)) 16px 20px; }
.page { animation: page-in .24s ease both; }

.hero { padding: 3px 4px 15px; }
.hero__top { display: flex; min-height: 62px; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.store-logo { width: min(148px, 45vw); height: 58px; object-fit: contain; object-position: left center; }
.greeting { max-width: 47%; padding-top: 8px; text-align: right; }
.greeting span, .greeting strong { display: block; }
.greeting span { color: var(--muted); font-size: 12px; line-height: 1.2; }
.greeting strong { overflow: hidden; margin-top: 3px; font-size: 16px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.hero h1, .page-heading h1 { margin: 6px 0 0; font-size: clamp(30px, 8vw, 42px); line-height: .99; letter-spacing: -.052em; }

.bonus-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 27px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 27px;
    background:
        radial-gradient(circle at 83% 17%, rgba(255,255,255,.26), transparent 8rem),
        linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 19px 42px var(--accent-shadow);
}
.bonus-card::after { content: ""; position: absolute; right: -34px; bottom: -51px; width: 155px; height: 155px; border: 1px solid rgba(255,255,255,.18); border-radius: 48% 52% 45% 55%; transform: rotate(21deg); }
.bonus-card__head, .bonus-card__foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bonus-card__head { color: rgba(255,255,255,.77); font-size: 12px; }
.bonus-card__head b { color: #fff; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.bonus-card__value { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; padding: 19px 0 21px; }
.bonus-card__value strong { font-size: clamp(52px, 16vw, 74px); font-weight: 820; line-height: .8; letter-spacing: -.07em; }
.bonus-card__value span { color: rgba(255,255,255,.75); font-size: 13px; }
.bonus-card__foot { color: rgba(255,255,255,.77); font-size: 11px; }
.bonus-program { display: flex; align-items: center; gap: 11px; margin: -14px 3px 28px; padding: 12px 14px; border: 1px solid rgba(82,116,83,.16); border-radius: 17px; background: rgba(255,253,251,.72); color: #625952; box-shadow: 0 8px 20px rgba(59,43,35,.035); }
.bonus-program__icon { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); font-size: 16px; font-weight: 850; }
.bonus-program p { margin: 0; font-size: 11px; line-height: 1.45; }
.bonus-program strong { color: var(--accent-dark); font-weight: 850; }

.section-block { margin-bottom: 29px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 0 3px 12px; }
.section-title h2 { margin: 3px 0 0; font-size: 23px; line-height: 1.05; letter-spacing: -.035em; }
.count-pill { min-width: 30px; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 800; text-align: center; }
.text-button { padding: 6px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 800; }

.purchases-list { display: grid; gap: 8px; }
.purchase-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,253,251,.86);
    box-shadow: 0 8px 23px rgba(59,43,35,.055);
}
.purchase-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent-dark); }
.purchase-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.purchase-main { min-width: 0; }
.purchase-main strong, .purchase-main span { display: block; }
.purchase-main strong { overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.purchase-main span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.purchase-side { text-align: right; }
.purchase-side b { display: block; font-size: 15px; white-space: nowrap; }
.bonus-change { display: block; margin-top: 4px; color: var(--accent); font-size: 10px; font-weight: 800; }
.bonus-change.is-spent { color: #aa5e4c; }

.order-card { overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: rgba(255,253,251,.9); box-shadow: 0 12px 30px rgba(59,43,35,.07); }
.order-card + .order-card { margin-top: 11px; }
.order-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 17px 14px; border-bottom: 1px solid var(--line); }
.order-number small, .order-number strong { display: block; }
.order-number small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.order-number strong { margin-top: 3px; font-size: 17px; }
.status-pill { max-width: 46%; padding: 7px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 800; text-align: center; }
.order-card__body { padding: 14px 17px; }
.order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-meta div { min-width: 0; }
.order-meta span, .order-meta b { display: block; }
.order-meta span { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.order-meta b { overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; }
.product-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.product-chip { padding: 6px 8px; border-radius: 9px; background: #f5eee8; color: #665951; font-size: 10px; }
.order-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px 16px; background: rgba(246,241,235,.62); }
.order-total small, .order-total strong { display: block; }
.order-total small { color: var(--muted); font-size: 10px; }
.order-total strong { margin-top: 2px; font-size: 17px; }
.pay-button { min-height: 40px; padding: 9px 14px; border: 0; border-radius: 13px; background: var(--accent); color: #fff; box-shadow: 0 8px 18px var(--accent-shadow); font-size: 12px; font-weight: 850; }

.empty-card { padding: 27px 20px; border: 1px dashed rgba(82,72,65,.2); border-radius: 22px; background: rgba(255,253,251,.55); text-align: center; }
.empty-card__icon { display: grid; width: 48px; height: 48px; margin: 0 auto 10px; place-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--accent-dark); font-size: 23px; }
.empty-card h3 { margin: 0 0 5px; font-size: 17px; }
.empty-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.tinder-preferences { margin-top: 31px; }
.tinder-likes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tinder-like-card { display: grid; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,253,251,.9); color: inherit; text-decoration: none; box-shadow: 0 9px 24px rgba(59,43,35,.06); }
.tinder-like-card__image { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #eee7df; }
.tinder-like-card__caption { display: grid; gap: 3px; padding: 11px 12px 13px; }
.tinder-like-card__caption strong { overflow: hidden; font-size: 13px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.tinder-like-card__caption small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.tinder-return { display: flex; min-height: 45px; align-items: center; justify-content: center; margin-top: 11px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 850; text-decoration: none; }

.page-heading { padding: 17px 4px 20px; }
.identity-info { margin: 22px 0 92px; color: #aaa19b; font-size: 10px; line-height: 1.45; text-align: center; }
.page-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.orders-list { padding-bottom: 8px; }

.bottom-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(calc(100% - 24px), 596px);
    margin: auto;
    padding: 7px 5px 6px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 25px;
    background: rgba(255,253,251,.92);
    box-shadow: 0 17px 45px rgba(54,40,32,.16);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}
.nav-button { position: relative; display: flex; min-width: 0; align-items: center; flex-direction: column; gap: 3px; padding: 3px 2px; border: 0; background: transparent; color: #988c84; }
.nav-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 13px; transition: .2s ease; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-button small { overflow: hidden; max-width: 100%; font-size: 9px; font-weight: 750; text-overflow: ellipsis; }
.nav-button.is-active { color: var(--accent-dark); }
.nav-button.is-active .nav-icon { background: var(--accent-soft); transform: translateY(-1px); }
.nav-badge { position: absolute; top: 1px; left: calc(50% + 8px); display: grid; min-width: 16px; height: 16px; padding: 0 4px; place-items: center; border: 2px solid #fff; border-radius: 9px; background: #d65e58; color: #fff; font-size: 8px; font-style: normal; font-weight: 900; }

.state-screen { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; flex-direction: column; justify-content: center; padding: 28px; text-align: center; }
.state-screen h1 { max-width: 430px; margin: 10px 0 8px; font-size: clamp(26px, 8vw, 35px); line-height: 1.08; letter-spacing: -.045em; }
.state-screen p { max-width: 430px; margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.state-screen small { margin-top: 13px; color: var(--muted); font-size: 11px; }
.welcome-logo { width: min(180px, 55vw); height: 72px; margin-bottom: 24px; object-fit: contain; }
.primary-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 13px 28px var(--accent-shadow); font-weight: 820; }
.primary-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:disabled { opacity: .55; }
.error-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 20px; background: #f9ded9; color: #a9433f; font-size: 30px; font-weight: 900; }
.error-details { max-width: 420px; overflow-wrap: anywhere; color: #8d6258 !important; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.45; }
.loader { display: flex; height: 42px; align-items: center; gap: 7px; }
.loader i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite ease-in-out; }
.loader i:nth-child(2) { animation-delay: .12s; }.loader i:nth-child(3) { animation-delay: .24s; }
.toast { position: fixed; z-index: 100; top: max(14px, env(safe-area-inset-top)); right: 14px; left: 14px; width: min(calc(100% - 28px), 500px); margin: auto; padding: 13px 16px; border-radius: 15px; background: #302824; color: #fff; box-shadow: 0 15px 38px rgba(40,31,27,.23); font-size: 12px; text-align: center; }

@keyframes bounce { 0%,100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-8px); opacity: 1; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 360px) {
    .content { padding-inline: 11px; }
    .hero { padding-inline: 3px; }
    .bonus-card { padding: 19px; }
    .order-card__foot { align-items: flex-start; flex-direction: column; }
    .pay-button { width: 100%; }
}
