/* Phone wallet: browse, choose a card, then see its details. */
@media(max-width:900px){
 .wallet-page{overflow-x:hidden;padding-bottom:calc(90px + env(safe-area-inset-bottom))}
 .wallet-page .wallet-header{height:auto;min-height:132px;padding:16px;gap:14px 10px;display:flex;align-items:center;flex-wrap:wrap}
 .wallet-page .wallet-brand{min-width:0;gap:8px;flex:1}.wallet-page .wallet-brand h1{font-size:20px;white-space:nowrap;letter-spacing:-.6px}.wallet-page .wallet-brand .icon{width:27px;height:27px}
 .wallet-page .header-buttons{display:flex;flex-shrink:0;flex-wrap:nowrap;gap:4px;margin:0}.wallet-page .header-buttons>.icon-button,.wallet-page .header-brand-settings{min-width:38px;width:38px;height:40px;padding:7px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px}.wallet-page .header-brand-settings{font-size:0}.wallet-page .header-brand-settings:before{content:'⚙';font-size:23px;line-height:1}
 .wallet-page .global-search{order:3;flex:0 0 100%;width:100%;max-width:none;min-width:0;height:46px;padding:10px 12px}.wallet-page .global-search input{font-size:16px;min-width:0}.wallet-page .global-search kbd{display:none}
 .wallet-page:after{content:'';position:fixed;bottom:0;left:0;right:0;height:calc(82px + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--line);z-index:20;pointer-events:none}
 .wallet-page .header-transaction,.wallet-page .header-add{position:fixed;bottom:calc(14px + env(safe-area-inset-bottom));height:50px;min-height:50px;z-index:25;display:flex;align-items:center;justify-content:center;padding:10px 12px;border-radius:13px;font-size:14px;font-weight:700;box-shadow:0 4px 18px #0003;white-space:nowrap}
 .wallet-page .header-transaction{left:16px;width:calc(58% - 22px)}.wallet-page .header-add{right:16px;width:calc(42% - 22px);background:var(--raised);color:var(--ink);border:1px solid var(--line)}.wallet-page .header-add>span{font-size:20px;margin-right:5px}
 .wallet-page .wallet-status{padding:0 16px 12px;font-size:11px;min-height:28px}.wallet-page .wallet-status strong{text-transform:none;letter-spacing:.3px}.wallet-page .wallet-status .text-button{min-height:32px;padding:4px 8px}
 .wallet-page .mobile-steps{display:flex;position:sticky;top:0;z-index:15;background:var(--bg);gap:4px;padding:8px 16px 12px;margin:0}.wallet-page .mobile-steps button{min-height:46px;flex:1;padding:10px 4px;font-size:13px;font-weight:700;line-height:1.25;border-radius:11px;border:1px solid var(--line);background:var(--panel);color:var(--muted)}.wallet-page .mobile-steps button.active{background:#7635d7;border-color:#a872f2;color:#fff}.wallet-page .mobile-steps button:disabled{opacity:.4;cursor:default}
 .wallet-page .wallet-grid{display:block;width:100%;padding:0 16px 24px;min-width:0}.wallet-page .wallet-grid>.panel{display:none;width:100%;min-width:0;height:auto;min-height:260px;border-radius:16px;overflow:visible}.wallet-page .wallet-grid.mode-brands>#brandPanel,.wallet-page .wallet-grid.mode-cards>#cardsPanel,.wallet-page .wallet-grid.mode-details>#detailsPanel{display:block}
 .wallet-page .categories-panel,.wallet-page .cards-panel,.wallet-page .details-panel{padding:18px 14px}.wallet-page .categories-panel h2{font-size:20px}.wallet-page .categories-panel .section-heading{gap:8px;padding-bottom:12px}.wallet-page .brand-search{font-size:16px;min-height:46px;margin-bottom:12px}.wallet-page .brand-row,.wallet-page .all-brands{min-height:58px;font-size:16px;padding:10px 12px}.wallet-page .brand-row>.brand-mark{width:36px;height:36px}.wallet-page .subcategory-link{min-height:44px;font-size:13px;line-height:1.4;padding:9px 8px}.wallet-page .tag-filter{min-height:46px;font-size:14px;padding:10px}.wallet-page .tag-section{margin-top:22px}.wallet-page .tag-name,.wallet-page .brand-name{min-width:0;overflow-wrap:anywhere}.wallet-page .tiny-help{font-size:11px;line-height:1.6}.wallet-page .deleted-cards-button{min-height:44px}
 .wallet-page .wallet-breadcrumb{flex-wrap:wrap;gap:5px;font-size:12px;margin-bottom:14px}.wallet-page .wallet-breadcrumb button{min-height:32px}.wallet-page .cards-title{gap:10px;align-items:flex-start;margin-bottom:18px}.wallet-page .cards-title>.brand-mark{width:38px;height:38px;flex-shrink:0}.wallet-page .cards-title>div{min-width:0}.wallet-page .cards-title h2{font-size:21px;overflow-wrap:anywhere}.wallet-page .cards-title p{font-size:12px;line-height:1.5}.wallet-page .cards-title>.primary{display:none}.wallet-page .brand-title-tags{gap:5px}.wallet-page .tag-pill{font-size:11px;padding:4px 8px}.wallet-page .brand-stats{gap:6px}.wallet-page .brand-stat{padding:12px 8px}.wallet-page .brand-stat strong{font-size:21px}.wallet-page .brand-stat small{font-size:10px;line-height:1.4;white-space:normal}.wallet-page .subcategory-toolbar{flex-wrap:wrap;gap:8px;align-items:center}.wallet-page .subcategory-toolbar>span{font-size:12px}.wallet-page .subcategory-chips{display:flex;flex:1;gap:5px;overflow-x:auto;white-space:nowrap;min-width:0}.wallet-page .subcategory-chips button{min-height:40px;flex-shrink:0;font-size:12px}.wallet-page .subcategory-toolbar .icon-button{min-width:38px;height:40px}
 .wallet-page .list-controls{display:grid;grid-template-columns:1fr;gap:8px;margin:14px 0}.wallet-page .list-controls select{min-width:0;max-width:100%;min-height:44px;font-size:14px;width:100%}.wallet-page .card-list{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}.wallet-page .wallet-card,.wallet-page .wallet-card.selected{display:grid;grid-template-columns:62px minmax(0,1fr);gap:6px 12px;padding:14px;text-align:left;min-height:114px;border-radius:14px;align-items:start}.wallet-page .card-thumbnail{grid-column:1;grid-row:1 / 3;width:62px;height:58px;min-width:0;align-self:center;border-radius:9px}.wallet-page .wallet-card-content{grid-column:2;min-width:0;width:100%}.wallet-page .card-name{font-size:15px;font-weight:700;line-height:1.4;white-space:normal;overflow-wrap:anywhere}.wallet-page .wallet-card .card-caption{display:flex;gap:5px;font-size:12px;line-height:1.5;flex-wrap:wrap;margin-top:5px}.wallet-page .wallet-card .card-number{font-size:13px;line-height:1.5;overflow-wrap:anywhere;white-space:normal}.wallet-page .pill{font-size:10px;padding:3px 7px}.wallet-page .card-amount{grid-column:2;font-size:24px;line-height:1.2;justify-self:start;margin-top:3px}.wallet-page .card-amount small{font-size:10px}.wallet-page .card-arrow{display:none}.wallet-page .empty-state{padding:30px 12px;line-height:1.5}.wallet-page .empty-state h3{font-size:20px}.wallet-page .empty-state p{font-size:13px}.wallet-page .empty-state .primary{min-height:44px}
 .wallet-page .detail-heading{gap:9px;flex-wrap:wrap;margin-bottom:16px}.wallet-page .detail-heading>.brand-mark{width:36px;height:36px}.wallet-page .detail-name{min-width:0;flex:1}.wallet-page .detail-heading h2{font-size:20px;line-height:1.35}.wallet-page .detail-heading .card-number{font-size:13px;line-height:1.6}.wallet-page .detail-heading .card-caption{font-size:12px}.wallet-page .favorite-button{min-width:36px;min-height:40px}.wallet-page .detail-heading>.secondary{min-height:40px;font-size:12px;padding:8px 10px}.wallet-page .copy-button{min-width:34px;min-height:34px}.wallet-page .detail-hero{display:flex;flex-direction:column;gap:12px}.wallet-page .balance-box{order:-1;padding:18px;border-radius:14px}.wallet-page .balance-box>span{font-size:13px}.wallet-page .balance-box>strong{font-size:38px;line-height:1.4}.wallet-page .balance-box dl{font-size:12px}.wallet-page .balance-box dl>div{gap:8px;padding:8px 0}.wallet-page .balance-box dt{flex-shrink:0}.wallet-page .balance-box dd{text-align:right;overflow-wrap:anywhere}.wallet-page .hero-photo{min-height:0;aspect-ratio:1.6;width:100%;border-radius:13px}.wallet-page .hero-photo .card-art{min-height:190px}.wallet-page .photo-thumbnails{display:flex;gap:8px;overflow-x:auto;padding:10px 0 14px}.wallet-page .photo-thumb,.wallet-page .add-photo{height:64px;min-width:84px;width:84px;flex-shrink:0}.wallet-page .add-photo{font-size:12px;padding:7px}.wallet-page .photo-thumb small{font-size:10px}.wallet-page .detail-tabs{gap:0;display:flex;overflow-x:auto}.wallet-page .detail-tabs button{font-size:12px;min-height:46px;padding:10px 6px;flex:1;white-space:nowrap;gap:5px}.wallet-page .detail-tabs .icon{width:17px;height:17px}.wallet-page .detail-toolbar{flex-wrap:wrap;gap:8px}.wallet-page .detail-toolbar .primary,.wallet-page .detail-toolbar select{font-size:13px;min-height:42px}.wallet-page .table-scroll{overflow-x:auto;width:100%;max-width:100%;-webkit-overflow-scrolling:touch}.wallet-page .transactions-table{min-width:510px;font-size:12px}.wallet-page .transactions-table button{min-height:38px;min-width:36px}.wallet-page .card-info .info-row{font-size:13px;gap:12px;align-items:flex-start}.wallet-page .info-row strong{overflow-wrap:anywhere;min-width:0}.wallet-page .detail-use{display:flex;flex-direction:column;gap:8px}.wallet-page .detail-use button{width:100%;min-height:46px;font-size:13px}
 .wallet-page dialog{width:calc(100vw - 20px);max-width:560px;max-height:calc(100dvh - 20px);margin:auto;padding:22px 16px;border-radius:18px;overflow:auto;overscroll-behavior:contain}.wallet-page dialog::backdrop{background:#070616b8}.wallet-page .modal-heading{align-items:flex-start;gap:12px;margin-bottom:14px}.wallet-page .modal-heading h2{font-size:23px;line-height:1.3}.wallet-page .modal-heading>.icon-button{min-width:40px;min-height:40px;font-size:24px}.wallet-page dialog .eyebrow{font-size:9px;letter-spacing:1px}.wallet-page dialog .form-notice,.wallet-page dialog .field-hint{font-size:12px;line-height:1.6}.wallet-page dialog .form-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}.wallet-page dialog label{font-size:13px;line-height:1.5;min-width:0}.wallet-page dialog input:not([type=checkbox]):not([type=color]):not([type=range]),.wallet-page dialog select,.wallet-page dialog textarea{font-size:16px;min-height:46px;width:100%;min-width:0;max-width:100%;padding:11px 12px}.wallet-page dialog input[type=checkbox]{width:19px;height:19px}.wallet-page dialog button{min-height:42px}.wallet-page .form-footer{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px;padding-bottom:4px}.wallet-page .form-footer>button{flex:1;min-height:48px;font-size:14px}.wallet-page .field-action{font-size:12px}.wallet-page .image-drop{padding:14px;margin-top:18px}.wallet-page .image-drop .section-heading{gap:10px;align-items:flex-start;flex-direction:column}.wallet-page .image-drop .inline-actions{display:flex;gap:8px;width:100%}.wallet-page .image-drop .inline-actions button{flex:1;font-size:12px;padding:8px}.wallet-page .image-previews{gap:8px}.wallet-page .upload-preview>img,.wallet-page .upload-empty{height:110px}.wallet-page .upload-preview>div{flex-wrap:wrap;gap:5px;font-size:11px}.wallet-page .upload-preview .text-button{font-size:12px}.wallet-page .allocation-item{padding:14px;border-radius:13px;margin:14px 0}.wallet-page .allocation-item .allocation-row{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}.wallet-page .allocation-heading strong{font-size:15px}.wallet-page #transactionAllocationSection>.section-heading{flex-wrap:wrap;gap:10px}.wallet-page #transactionAllocationSection h3{font-size:18px}.wallet-page #addAllocation{font-size:12px}.wallet-page .manage-row{gap:10px;flex-wrap:wrap;font-size:13px}.wallet-page .checkbox-tags label{min-height:40px}.wallet-page .viewer-scroll{max-height:60dvh}.wallet-page .viewer-controls{flex-wrap:wrap;gap:8px}.wallet-page .viewer-controls label{min-width:0;flex:1}
 .wallet-page .toast{bottom:calc(86px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px);font-size:13px}.wallet-page.light .mobile-steps button{background:var(--panel);color:var(--muted);border-color:var(--line)}.wallet-page.light .mobile-steps button.active{background:#7635d7;color:white;border-color:#a872f2}
}
@media(max-width:360px){.wallet-page .wallet-header{padding:14px 12px;gap:12px 6px}.wallet-page .wallet-brand h1{font-size:18px}.wallet-page .wallet-brand .icon{width:24px;height:24px}.wallet-page .header-buttons>.icon-button,.wallet-page .header-brand-settings{width:34px;min-width:34px;height:38px;padding:5px}.wallet-page .mobile-steps{padding-left:12px;padding-right:12px}.wallet-page .mobile-steps button{font-size:12px}.wallet-page .wallet-grid{padding-left:12px;padding-right:12px}.wallet-page .cards-panel,.wallet-page .details-panel{padding:16px 12px}.wallet-page .wallet-card,.wallet-page .wallet-card.selected{grid-template-columns:48px minmax(0,1fr);gap:7px 9px;padding:12px}.wallet-page .card-thumbnail{width:48px;height:48px}.wallet-page .card-name{font-size:14px}.wallet-page .card-amount{font-size:22px}.wallet-page .header-transaction,.wallet-page .header-add{font-size:12px;padding:10px 8px}.wallet-page .detail-tabs button{font-size:11px}.wallet-page .detail-tabs .icon{display:none}}

/* Three home actions remain reachable on narrow phones. */
@media(max-width:900px){
 .wallet-page .header-bulk{position:fixed;bottom:calc(14px + env(safe-area-inset-bottom));height:50px;min-height:50px;z-index:25;display:flex;align-items:center;justify-content:center;border-radius:13px;box-shadow:0 4px 18px #0003;background:var(--raised);color:var(--ink);border:1px solid var(--line)}
 .wallet-page .header-transaction,.wallet-page .header-bulk,.wallet-page .header-add{width:calc((100% - 40px)/3);padding:10px 6px;font-size:0!important;white-space:nowrap}
 .wallet-page .header-transaction{left:12px;right:auto}.wallet-page .header-bulk{left:calc((100% - 40px)/3 + 20px);right:auto}.wallet-page .header-add{left:auto;right:12px}.wallet-page .header-add>span{display:none}
 .wallet-page .header-transaction:after{content:'＋ 交易';font-size:14px}.wallet-page .header-bulk:after{content:'＋ 批量';font-size:14px}.wallet-page .header-add:after{content:'＋ 单卡';font-size:14px}
 .wallet-page .bulk-linked-brand select{min-width:0}.wallet-page .bulk-linked-brand button{min-width:54px}
}

@media(max-width:900px){.wallet-page #brandPanel{overflow:hidden}.wallet-page .brand-directory-entry .brand-row{min-width:0}.wallet-page .brand-directory-entry .brand-row>.brand-name{min-width:0}}

@media(max-width:600px){
 .wallet-page .transactions-table{display:block;min-width:0;width:100%;font-size:12px}.wallet-page .transactions-table thead{display:none}.wallet-page .transactions-table tbody{display:block}.wallet-page .transactions-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:14px 10px;border-bottom:1px solid var(--line)}.wallet-page .transactions-table td{display:block;border:0;padding:0;min-width:0;white-space:normal;overflow-wrap:anywhere}.wallet-page .transactions-table td:nth-child(1){grid-column:1;grid-row:1;align-self:center}.wallet-page .transactions-table td:nth-child(2){grid-column:1;grid-row:2;display:flex;align-items:center;gap:7px}.wallet-page .transactions-table .type-name{margin:0}.wallet-page .transactions-table td:nth-child(3){grid-column:2;grid-row:1;text-align:right;font-size:16px;font-weight:700}.wallet-page .transactions-table td:nth-child(4){grid-column:2;grid-row:2;text-align:right;align-self:center}.wallet-page .transactions-table td:nth-child(4):before{content:'余额 ';color:var(--muted);font-size:11px}.wallet-page .transactions-table td:nth-child(5){grid-column:1/-1;grid-row:3}.wallet-page .transactions-table td:last-child{grid-column:1/-1;grid-row:4;display:flex;justify-content:flex-end;gap:8px;white-space:normal}.wallet-page .transactions-table td[colspan]{grid-column:1/-1}.wallet-page .transactions-table .receipt-action{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:65px}.wallet-page .transactions-table .receipt-action:after{content:'小票';font-size:12px}.wallet-page .transactions-table .table-action{min-height:40px}.wallet-page .table-scroll:has(.transactions-table){overflow-x:visible}
}
