:root {
    --bw-paper: #f8f0e3;
    --bw-ink: #322318;
    --bw-muted: #6e5746;
    --bw-line: #ded0bd;
    --bw-espresso: #342319;
    --bw-toast: #fff9ef;
    --bw-accent: #e5aa70;
    --bw-positive: #365b44;
    --bw-type: Manrope, system-ui, sans-serif;
}

.bw-dialog, .bw-badge, .bw-payment { font-family: var(--bw-type); color: var(--bw-ink); }
.bw-dialog *, .bw-badge *, .bw-payment * { box-sizing: border-box; }
.bw-dialog button, .bw-badge, .bw-payment button { font: inherit; }
.bw-dialog :is(button, input):focus-visible, .bw-badge:focus-visible, .bw-payment :is(button, input):focus-visible {
    outline: 2px solid #875123;
    outline-offset: 3px;
}
.bw-dialog button, .bw-badge, .bw-payment button { cursor: pointer; }
.bw-dialog button:disabled { cursor: default; }
.bw-dialog svg, .bw-badge svg, .bw-payment svg { display: block; width: 22px; height: 22px; flex: none; }

.bw-badge {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0;
    color: #fff4e1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.bw-badge > span {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 31px;
    padding: 4px 9px;
    border: 1px solid #503620;
    border-radius: 999px;
    background: #48301f;
    box-shadow: 0 1px 2px #2b180f20;
}
.bw-badge b { font-size: 12px; font-weight: 800; }
.bw-badge svg { width: 16px; height: 16px; color: #f4cc94; }
.bw-badge[data-place="fixed"] {
    position: fixed;
    z-index: 2147483000;
    top: calc(max(var(--bp-safe-top, 0px), env(safe-area-inset-top, 0px)) + 8px);
    right: max(16px, calc((100vw - 688px) / 2), env(safe-area-inset-right, 0px));
}
.bw-badge[data-place="sheet"] { position: sticky; display: flex; align-items: center; top: 4px; margin-left: auto; margin-right: 48px; z-index: 100; }

.bw-balance-enabled { --bw-header-clearance: 24px; }
.bw-balance-enabled #home-screen .hdr {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bp-cream, #f2ead8);
}
.bw-balance-enabled #menu-screen .menu-header {
    padding-top: calc(max(12px, env(safe-area-inset-top, 0px)) + var(--bw-header-clearance)) !important;
}
.bw-balance-enabled #profile-screen .prof-header {
    padding-top: calc(8px + var(--bw-header-clearance)) !important;
}
.bw-balance-enabled #profile-screen .prof-scr {
    padding-top: calc(64px + var(--bw-header-clearance)) !important;
}
@media (display-mode: standalone) {
    .bw-balance-enabled #profile-screen .prof-header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 8px + var(--bw-header-clearance)) !important;
    }
    .bw-balance-enabled #profile-screen .prof-scr {
        padding-top: calc(env(safe-area-inset-top, 0px) + 60px + var(--bw-header-clearance)) !important;
    }
}
.bw-balance-enabled.is-tma :is(#menu-screen .menu-header, #profile-screen .prof-header) {
    position: sticky !important;
    top: 0 !important;
    padding-top: calc(var(--bp-safe-top) + 12px + var(--bw-header-clearance)) !important;
}
.bw-balance-enabled.is-tma #profile-screen .prof-scr { padding-top: 0 !important; }
#customize-screen.active .detail-photo .float-top {
    position: fixed;
    left: max(16px, env(safe-area-inset-left, 0px), calc((100vw - 688px) / 2));
    right: max(16px, env(safe-area-inset-right, 0px), calc((100vw - 688px) / 2));
    z-index: 8;
    pointer-events: none;
}
#customize-screen.active .float-top > button { pointer-events: auto; }
#customize-screen.active .float-top > [data-act="close"] {
    min-width: 48px !important;
    min-height: 48px !important;
}
.bw-balance-enabled #customize-screen .detail-photo .float-top {
    top: calc(max(var(--bp-safe-top, 0px), env(safe-area-inset-top, 0px)) + 12px + var(--bw-header-clearance)) !important;
    align-items: center;
}
.bw-balance-enabled #customize-screen .float-top .ibtn-glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#app :is(.hdr,.menu-topbar,.prof-header,.float-top):has(> .bw-badge) { column-gap: 8px !important; }
#app .hdr:has(> .bw-badge) .hdr-meta { margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app :is(.menu-topbar,.prof-header):has(> .bw-badge) > :nth-last-child(2) { margin-inline-start: auto; }
#app :is(.cart-header,.orders-header):has(> .bw-badge) { grid-template-columns: 44px minmax(0,1fr) auto auto !important; gap: 5px; }
#app :is(.cart-header,.orders-header):has(> .bw-badge) > .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app .conf-hdr:has(> .bw-badge) > span[style] { display: none; }
.bw-checkout-hint { font-size: 12px; color: var(--bw-muted); margin-top: 5px; }

.bw-dialog {
    box-sizing: border-box;
    width: min(100%, 476px);
    max-width: 100%;
    max-height: min(88vh, 740px);
    max-height: min(88dvh, 740px);
    margin: auto;
    padding: 0;
    border: 1px solid #f3ddbf;
    border-radius: 27px;
    background: var(--bw-paper);
    overscroll-behavior: contain;
    box-shadow: 0 16px 64px #2f180a45;
}
.bw-dialog::backdrop { background: #251b1580; }
.bw-shell { padding: 20px 22px max(25px, env(safe-area-inset-bottom)); }
.bw-header { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-bottom: 5px; }
.bw-header h1 { flex: 1; margin: 0; font-size: clamp(22px, 6.6vw, 28px); line-height: 1.12; font-weight: 800; letter-spacing: -.045em; }
.bw-header h1:focus { outline: none; }
.bw-icon-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 50%;
    color: var(--bw-ink);
    background: #eadbc7;
}
.bw-icon-button svg { width: 20px; height: 20px; }
.bw-demo { margin: 2px 0 19px; font-size: 12px; font-weight: 700; color: var(--bw-muted); }
.bw-demo span { padding-inline: 3px; }
.bw-notice { margin: 0 0 13px; padding: 10px 12px; border-left: 3px solid #92673e; color: var(--bw-ink); background: #eee1ca; font-size: 13px; line-height: 1.45; }

.bw-ticket {
    position: relative;
    overflow: hidden;
    padding: 17px 19px 18px;
    border-radius: 17px;
    background: var(--bw-espresso);
    color: #fff0dc;
}
.bw-ticket::after {
    content: '';
    position: absolute;
    pointer-events: none;
    width: 190px;
    height: 190px;
    right: -68px;
    top: -61px;
    border: 1px solid #f8c48d36;
    border-radius: 49% 51% 50% 50%;
    box-shadow: 0 0 0 12px #f8c48d1a, 0 0 0 24px #f8c48d16, 0 0 0 36px #f8c48d13, 0 0 0 48px #f8c48d0f;
}
.bw-ticket-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: #e9c8a4; font-size: 14px; font-weight: 700; }
.bw-ticket-cup { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e9c8a463; color: #ffddb4; background: #422d1f; }
.bw-number { position: relative; z-index: 1; margin: 0 0 15px; font-size: clamp(39px, 12vw, 55px); font-weight: 800; line-height: 1.06; letter-spacing: -.063em; font-variant-numeric: tabular-nums; }
.bw-ticket-note { position: relative; z-index: 1; margin: 0; padding-top: 11px; border-top: 1px dashed #e9c8a467; color: #f1d7b9; font-size: 12px; font-weight: 700; }

.bw-actions { display: grid; grid-template-columns: .93fr 1.12fr; gap: 8px; margin: 12px 0 22px; }
.bw-primary, .bw-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 47px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}
.bw-primary { color: var(--bw-ink); background: var(--bw-accent); }
.bw-secondary { color: var(--bw-ink); border-color: #d8c4a9; background: transparent; }
.bw-primary:disabled, .bw-secondary:disabled { color: #6e6252; border-color: var(--bw-line); background: #eee5d8; }
.bw-actions svg { width: 19px; height: 19px; }
.bw-full { width: 100%; margin-top: 9px; min-height: 49px; font-size: 14px !important; }
.bw-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    margin: -5px 0 16px;
    padding: 8px 11px;
    border: 1px solid #deccad;
    border-radius: 12px;
    color: var(--bw-ink);
    background: #f0e5d1;
    text-align: left;
}
.bw-status-card span { flex: 1; }
.bw-status-card strong, .bw-status-card small { display: block; font-size: 13px; }
.bw-status-card small { margin-top: 3px; color: var(--bw-muted); font-size: 12px; }

.bw-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-height: 29px; }
.bw-section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; font-weight: 800; }
.bw-text-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    border: 0;
    padding: 4px 2px;
    color: #784923;
    font-size: 12px !important;
    font-weight: 800 !important;
    background: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.bw-day { margin: 11px 0 1px; color: var(--bw-muted); font-size: 12px; font-weight: 700; }
.bw-history-row { display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bw-line); }
.bw-event-icon, .bw-empty > span { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: #eadbc7; color: #734d32; }
.bw-event-icon svg { width: 19px; height: 19px; }
.bw-event-topup { background: #e3e6d3; color: #365b44; }
.bw-event-refund { background: #efe2cb; color: #79542b; }
.bw-event-copy { display: grid; gap: 2px; }
.bw-event-copy strong, .bw-empty strong { font-weight: 800; font-size: 13px; }
.bw-event-copy small, .bw-empty p { font-size: 12px; color: var(--bw-muted); line-height: 1.35; overflow-wrap: anywhere; }
.bw-history-row b { font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bw-positive { color: var(--bw-positive); }
.bw-muted { color: var(--bw-muted); }
.bw-empty { display: flex; align-items: center; gap: 12px; padding-block: 16px; }
.bw-empty p { margin: 3px 0 0; }

.bw-lead { margin: 3px 0 19px; color: var(--bw-muted); font-size: 15px; line-height: 1.53; }
.bw-field-label { display: block; margin-bottom: 7px; color: var(--bw-ink); font-size: 13px; font-weight: 800; }
.bw-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 13px;
    min-height: 68px;
    border: 1px solid #d2b899;
    border-radius: 13px;
    background: var(--bw-toast);
}
.bw-field:focus-within { border-color: #875123; }
.bw-field input { width: 100%; min-width: 0; padding: 6px 1px; color: var(--bw-ink); font: 800 32px/1 var(--bw-type); border: 0; background: none; font-variant-numeric: tabular-nums; }
.bw-field input::placeholder { color: #847467; opacity: 1; }
.bw-field span { font-size: 25px; color: var(--bw-muted); font-weight: 700; }
.bw-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.bw-amount-chip { min-height: 43px; padding: 4px; border: 1px solid #d8c4a9; border-radius: 11px; background: transparent; color: var(--bw-ink); font-size: 13px !important; font-weight: 800 !important; white-space: nowrap; }
.bw-amount-chip[aria-pressed="true"] { border-color: #9e6739; background: #ebd2ad; }
.bw-amount-chip:disabled { color: #7c7164; background: #eee5d8; }
.bw-help, .bw-note { color: var(--bw-muted); font-size: 12px; line-height: 1.5; }
.bw-help { margin: 8px 0 14px; }
.bw-refund-hint { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 7px 0 11px; }
.bw-refund-hint .bw-help { margin: 0; }
.bw-refund-hint .bw-amount-chip { min-height: 44px; padding-inline: 10px; }
.bw-note { margin: 12px 0 0; }
.bw-detail { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 16px; padding: 15px 13px; border-block: 1px solid var(--bw-line); font-size: 14px; }
.bw-detail b { font-size: 20px; letter-spacing: -.035em; }
.bw-step-symbol { display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 12px; border-radius: 13px; background: #eadbc7; color: #734d32; }

.bw-payment { margin: 9px 0; }
.bw-payment fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.bw-payment legend { padding: 0; margin: 0 0 7px; font-size: 13px; font-weight: 800; }
.bw-pay-option { display: flex; align-items: center; gap: 9px; min-height: 49px; margin-bottom: 6px; padding: 7px 10px; border: 1px solid #d7c4aa; border-radius: 11px; color: var(--bw-ink); background: #f9eddb; cursor: pointer; }
.bw-pay-option:has(input:checked) { background: #efdfc5; border-color: #9d744e; }
.bw-pay-option:has(input:disabled) { background: #efe5d7; color: var(--bw-muted); cursor: default; }
.bw-pay-option input { accent-color: #654224; width: 17px; height: 17px; flex: none; margin: 0; }
.bw-pay-option svg { width: 19px; height: 19px; }
.bw-pay-option span { display: grid; gap: 2px; }
.bw-pay-option strong { font-size: 13px; font-weight: 800; line-height: 1.15; }
.bw-pay-option small { font-size: 11px; color: var(--bw-muted); line-height: 1.3; }

@media (max-width: 550px) {
    .bw-dialog { margin: auto 0 0; width: 100%; max-height: 93vh; max-height: 93dvh; border-width: 1px 0 0; border-radius: 24px 24px 0 0; }
}
@media (max-width: 350px) {
    .bw-shell { padding-inline: 14px; }
    .bw-actions svg { display: none; }
    .bw-header { gap: 6px; }
}
