/* Keep content visible at the viewport width; wrap rather than crop it. */
html{max-width:100%;scrollbar-gutter:stable}
body{min-width:0;max-width:100%;overflow-wrap:anywhere}
img,video,canvas{max-width:100%}
button,input,select,textarea{max-width:100%;min-width:0}
dialog{max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);overflow-x:visible;overflow-y:auto;overflow-wrap:anywhere}
[data-layout="store"] .app{width:100%;max-width:1440px;padding-inline:clamp(12px,3vw,40px)}
[data-layout="store"] .header{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:12px}
[data-layout="store"] .header>*{min-width:0;margin-inline-start:0}
[data-layout="store"] .header .brand{min-width:0;text-align:start}
[data-layout="store"] .header .brand span{min-width:0}
[data-layout="store"] .header .brand strong{white-space:normal}
[data-layout="store"] .balance-pill{justify-self:start;max-width:100%;flex-wrap:wrap}
[data-layout="store"] .store-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%}
[data-layout="store"] .store-tabs button{min-width:0;white-space:normal;overflow-wrap:anywhere}
[data-layout="store"] .products,[data-layout="store"] .gift-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr))}
[data-layout="store"] .filters{flex-wrap:wrap;overflow:visible}
[data-layout="store"] .filters button{white-space:normal;max-width:100%}
[data-layout="store"] .product h3,[data-layout="store"] .price-row strong{overflow-wrap:anywhere}
[data-layout="store"] .section-heading{flex-wrap:wrap}
[data-layout="store"] .history-row{flex-wrap:wrap}
[data-layout="store"] .history-row>div:not(.history-icon){min-width:0;flex:1 1 160px}
[data-layout="store"] .history-amount{max-width:100%;white-space:normal}
[data-layout="store"] .balance-amount{flex-wrap:wrap}
[data-layout="store"] .balance-amount span:first-child{font-size:clamp(28px,7vw,58px);overflow-wrap:anywhere;min-width:0}
[data-layout="store"] .preview-strip{flex-wrap:wrap}
[data-layout="store"] .menu-row>span:nth-child(2){min-width:0}
[data-layout="store"] .presets{flex-wrap:wrap}
[data-layout="store"] .presets button{flex:1 1 70px}
[data-layout="store"] #product-detail,[data-layout="store"] #terms-copy{overflow-wrap:anywhere}
[data-layout="store"] .gift-region{min-width:0;overflow-wrap:anywhere;padding:14px}
[data-layout="admin"] .shell{grid-template-columns:240px minmax(0,1fr)}
[data-layout="admin"] .main{min-width:0;max-width:1680px;align-self:start;margin:0 auto}
[data-layout="admin"] .view,[data-layout="admin"] .panel,[data-layout="admin"] .field,[data-layout="admin"] .form-grid>*{min-width:0;max-width:100%}
[data-layout="admin"] .topbar{flex-wrap:wrap}
[data-layout="admin"] .topbar>div{min-width:0}
[data-layout="admin"] .toolbar>*{min-width:0;max-width:100%}
[data-layout="admin"] .actions button{white-space:normal}
[data-layout="admin"] .table-wrap{overflow:visible;max-width:100%}
[data-layout="admin"] .table{min-width:0;width:100%;table-layout:fixed}
[data-layout="admin"] .table th,[data-layout="admin"] .table td{min-width:0!important;max-width:none!important;white-space:normal!important;overflow-wrap:anywhere;vertical-align:top}
[data-layout="admin"] .table-value{display:block;min-width:0;max-width:100%;overflow-wrap:anywhere}
[data-layout="admin"] .table-value pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
[data-layout="admin"] .table-value button{margin:3px!important;white-space:normal}
[data-layout="admin"] input[type=file]{width:100%;min-width:0}
[data-layout="admin"] textarea{width:100%;box-sizing:border-box;min-width:0;background:#10111a;color:var(--text);border:1px solid var(--line);border-radius:10px;padding:12px;font:inherit}
[data-layout="admin"] .card strong{font-size:clamp(18px,2.1vw,27px);overflow-wrap:anywhere}
@media(max-width:900px){
 [data-layout="admin"] .shell{grid-template-columns:minmax(0,1fr)}
 [data-layout="admin"] .side{position:relative;top:auto;width:100%}
 [data-layout="admin"] .nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));overflow:visible;gap:5px}
 [data-layout="admin"] .nav button{white-space:normal;padding:10px;text-align:start}
 [data-layout="admin"] .side-foot{display:block;margin-top:8px;padding:0}
 [data-layout="admin"] .main{padding:16px;width:100%}
 [data-layout="admin"] .table,[data-layout="admin"] .table tbody{display:block;width:100%}
 [data-layout="admin"] .table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 [data-layout="admin"] .table tbody tr{display:block;width:100%;border:1px solid var(--line);border-radius:12px;margin:12px 0;background:#10111a;padding:4px 10px}
 [data-layout="admin"] .table td{display:grid!important;grid-template-columns:minmax(80px,30%) minmax(0,1fr);gap:10px;width:100%;padding:10px 0!important;text-align:start}
 [data-layout="admin"] .table td::before{content:attr(data-label);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);overflow-wrap:anywhere}
 [data-layout="admin"] .table td[colspan]{grid-template-columns:minmax(0,1fr)}
 [data-layout="admin"] .table td[colspan]::before{display:none}
 [data-layout="admin"] .table td:last-child{border-bottom:0}
 [data-layout="admin"] .table-value{width:100%}
 [data-layout="admin"] .table-value input:not([type=checkbox]){width:100%!important}
}
@media(max-width:640px){
 [data-layout="store"] .header{grid-template-columns:minmax(0,1fr) auto auto;padding:18px 0;gap:10px}
 [data-layout="store"] .header .brand{grid-column:1/-1}
 [data-layout="store"] .header .brand-logo{width:50px;height:50px}
 [data-layout="store"] .header .brand strong{font-size:21px}
 [data-layout="store"] .header .brand small{font-size:11px}
 [data-layout="store"] .balance-pill{width:max-content}
 [data-layout="store"] .store-tabs button{padding:11px 4px;font-size:12px;min-height:44px}
 [data-layout="store"] .products,[data-layout="store"] .gift-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 [data-layout="store"] .product{padding:9px}
 [data-layout="store"] .price-row{flex-wrap:wrap}
 [data-layout="store"] .price-row strong{font-size:16px}
 [data-layout="store"] dialog{padding:20px;width:calc(100% - 24px)}
 [data-layout="admin"] .form-grid{grid-template-columns:minmax(0,1fr)}
 [data-layout="admin"] .panel{padding:14px}
 [data-layout="admin"] .toolbar input,[data-layout="admin"] .toolbar select{flex:1 1 100%!important;width:100%!important;max-width:100%!important}
 [data-layout="admin"] .cards{gap:10px}
 [data-layout="admin"] .card{padding:14px}
 [data-layout="admin"] .user-pill{width:100%}
}
@media(max-width:340px){[data-layout="admin"] .main{padding:10px}[data-layout="admin"] .panel{padding:10px}[data-layout="admin"] .category-grid{grid-template-columns:minmax(0,1fr)}[data-layout="store"] .store-tabs button{font-size:11px}}
