/* Phone-width layout and native input sizing. Keep browser pinch zoom available. */
@media screen and (max-width:700px){
 html,body{width:100%;min-width:0!important;max-width:100%;margin-left:0;margin-right:0}
 *,*::before,*::after{box-sizing:border-box}
 body{overflow-x:hidden;overflow-wrap:break-word}
 main,.wrap,.portal-shell,.portal-content,.workspace,.dashboard-main,.dashboard-content,.till-overview,#app,#app-main{min-width:0!important;max-width:100%}
 .wrap{width:100%;padding-left:16px;padding-right:16px}
 .row>*,.toolbar>*,.portal-shell>*,.portal-content>*,.dashboard-content>*,.event-grid>*,.stats>*,.cards>*,.footer-grid>*{min-width:0;max-width:100%}
 /* iOS zooms focused fields below 16px; prevent the trigger, rather than disabling zoom. */
 body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),body select,body textarea{font-size:16px!important;max-width:100%;min-width:0}
 .role-picker,.plan-people,.board-media-gallery,.event-grid,.portal-features,.portal-personal-grid,.portal-summary-grid,.inquiry-layout,.location,.footer-grid{min-width:0!important;max-width:100%;grid-template-columns:minmax(0,1fr)}
 .saved-row,.invoice-payment,.b-document,.b-main-toolbar,.portal-meeting-header .toolbar,.dashboard-register-tools{flex-wrap:wrap;min-width:0;max-width:100%}
 .saved-row>*,.b-document>*,.dashboard-register-tools>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .lz-cal-grid{width:100%;min-width:0;grid-template-columns:repeat(7,minmax(0,1fr))}
 .lz-cal-grid>*,.lz-cal-day,.lz-cal-controls{min-width:0;max-width:100%}
 dialog,.b-modal,.c-modal{min-width:0!important;width:calc(100% - 16px);max-width:calc(100% - 16px)!important;max-height:calc(100vh - 16px);margin:auto;overflow-y:auto;overflow-x:hidden;padding:16px}
 dialog .dialog-head,dialog .dialog-actions{gap:8px;min-width:0;flex-wrap:wrap}
 dialog h2,dialog h3{overflow-wrap:anywhere}
 /* Compact header controls stay on-screen even at 320px. Captions get their own row. */
 body.portal-menu-ready>header{width:100%;padding:8px!important;gap:4px!important;flex-wrap:wrap!important}
 body.portal-menu-ready>header>div:first-of-type{min-width:0!important;flex:0 0 30px!important}
 body.portal-menu-ready>header .portal-brand{margin:0}
 body.portal-menu-ready>header .portal-brand>span{display:none}
 body.portal-menu-ready>header .portal-brand img{width:30px!important;height:34px!important;margin:0}
 body.portal-menu-ready>header .event-header-back,body.portal-menu-ready>header .event-menu-button{width:32px!important;height:36px!important;min-width:32px!important;flex:0 0 32px!important;padding:5px!important}
 body.portal-menu-ready>header .portal-message-control,body.portal-menu-ready>header .portal-avatar-control,body.portal-menu-ready>header .lz-notifications-button,body.portal-menu-ready>header .lz-app-update{width:34px!important;height:36px!important;min-width:34px!important;max-width:34px!important;flex:0 0 34px!important;padding:6px!important;margin-left:0!important}
 body.portal-menu-ready>header .portal-avatar-control{padding:0!important}
 body.portal-menu-ready>header .event-header-caption{order:2!important;flex:1 0 100%;font-size:14px;margin:3px 0 0;line-height:1.3}
 body.portal-menu-ready>header .portal-online{min-width:0;max-width:100%;margin-left:auto}
 /* Cash dashboard and active register use the same bounded controls. */
 body .topbar{width:100%;max-width:100%;min-width:0;padding-left:8px;padding-right:8px;gap:6px}
 body .topbar .brand{min-width:0!important;max-width:100%;flex:1 1 90px}
 body .topbar .brand>span{min-width:0;overflow:hidden}
 body .topbar .brand b,body .topbar .brand small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body .cash-header-account{min-width:0;max-width:100%;gap:4px!important;flex:0 0 auto;flex-wrap:wrap!important}
 body .cash-header-account .cash-head-shortcut,body .cash-header-account .cash-header-avatar,body .cash-header-account .lz-notifications-button,body .cash-header-account #app-update-button{width:34px!important;min-width:34px!important;max-width:34px!important;height:36px!important;min-height:36px!important;flex-basis:34px!important;padding:6px!important}
 body .cash-header-account .cash-header-avatar{padding:0!important}
 body.cash-phone-register .topbar .brand{flex:0 0 30px}
 body.cash-phone-register .topbar .top-status{flex:1;min-width:0;max-width:100%}
 .stock-grid,.stock-list,.till-list,.analysis-grid{min-width:0;max-width:100%}
 .hot-drink-group,.cold-category-frame,.article-tile,.stock-card,.till-card{min-width:0!important;max-width:100%;overflow-wrap:break-word}
 /* Long names, URLs and attachment filenames must not widen a conversation. */
 body #messages,body #messages .message-chat-layout,body #messages .message-conversation,body #messages .message-compose{min-width:0!important;max-width:100%;width:100%}
 body #messages .message-chat-row{width:100%;min-width:0;gap:8px;padding-left:12px;padding-right:12px}
 body #messages .message-chat-copy,body #messages .message-conversation-identity{min-width:0;flex:1 1 0%}
 body #messages .message-chat-meta{flex:0 0 auto;max-width:90px}
 body #messages .message-conversation-head{gap:5px;padding-left:6px;padding-right:6px}
 body #messages .message-conversation-head strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 body #messages .message-bubble,body #messages .message-file,body #messages .message-quote{min-width:0;overflow-wrap:anywhere;word-wrap:break-word}
 body #messages .message-file{flex-wrap:wrap;max-width:100%}
 body #messages .message-file button,body #messages .message-download{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 body #messages .message-input-row textarea{width:0;flex:1 1 0%;min-width:0!important}
 body #messages .message-reply-preview>div{flex:1 1 0%;min-width:0}
}
/* Dashboard cards must shrink their tracks instead of sizing them to long titles. */
@media screen and (max-width:1100px){
 body .portal-shortcuts{width:100%;min-width:0;grid-template-columns:repeat(2,minmax(0,1fr))}
 body .portal-shortcuts>.portal-card{width:100%;min-width:0;max-width:100%}
 body .portal-shortcuts>.portal-card>*{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;hyphens:auto}
 body .portal-welcome>div{min-width:0;max-width:100%}
 body .portal-role{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 body .lz-touch-bar{left:0;right:0;width:100%;max-width:100%;box-sizing:border-box}
}
@media screen and (max-width:700px){
 body .portal-shortcuts{grid-template-columns:minmax(0,1fr);gap:12px}
 body .portal-shortcuts>.portal-personal-card{min-height:150px;padding:18px}
 body .portal-shortcuts>.portal-personal-card strong{font-size:20px;line-height:1.3}
 body .portal-shortcuts>.portal-personal-card .portal-feature-icon{width:40px;height:40px}
 body .portal-shortcuts>.portal-personal-card b{padding-top:12px}
 body .portal-welcome{padding:20px;gap:12px}
 body .portal-welcome h2{font-size:23px;overflow-wrap:anywhere}
}
/* Tablet widths retain multi-column layouts with shrinkable tracks. */
@media screen and (min-width:701px) and (max-width:1366px){
 html,body{min-width:0!important;max-width:100%;width:100%}
 *,*::before,*::after{box-sizing:border-box}
 main,.portal-shell,.portal-content,.dashboard-main,.dashboard-content,.workspace,.shop,.basket,.event-grid,.till-overview{min-width:0;max-width:100%}
 body .portal-shortcuts{width:100%;min-width:0;grid-template-columns:repeat(2,minmax(0,1fr))}
 body .portal-shortcuts>.portal-card{width:100%;min-width:0;max-width:100%}
 body .portal-shortcuts>.portal-card>*{min-width:0;max-width:100%;white-space:normal;word-wrap:break-word;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}
 body .portal-welcome>div{min-width:0;max-width:100%}
 body .portal-role{max-width:100%;word-wrap:break-word}
 body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),body select,body textarea{font-size:16px!important;min-width:0;max-width:100%}
 body.portal-menu-ready>header{max-width:100%;min-width:0;flex-wrap:wrap!important}
 body.portal-menu-ready>header>div:first-of-type{min-width:0;max-width:100%}
 body.portal-menu-ready>header .event-header-caption{min-width:0;max-width:100%;word-wrap:break-word}
 .cash-header-account,.cash-register-control,.top-status,.dashboard-register-tools{min-width:0;max-width:100%;flex-wrap:wrap!important}
 .cash-header-account{flex-shrink:0}
 .topbar .brand{min-width:0;flex:1 1 150px}
 .topbar .brand>span{min-width:0;max-width:100%;word-wrap:break-word}
 .event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 dialog,.b-modal,.c-modal{min-width:0;max-width:calc(100% - 24px)!important;max-height:calc(100vh - 24px);overflow-y:auto;overflow-x:hidden}
 .hot-drink-group,.hot-drink-extras,.cold-category-frame,.stock-card,.article-tile{min-width:0;max-width:100%}
 body #messages .message-chat-layout{min-width:0;max-width:100%}
 body #messages .message-chat-copy,body #messages .message-conversation-identity{min-width:0;flex:1 1 0%}
 body #messages .message-input-row textarea{min-width:0;width:0;flex:1 1 0%}
}
/* Older WebKit needs a word-wrap fallback before overflow-wrap:anywhere. */
@media screen and (max-width:1366px){
 .portal-card strong,.event-grid-card,.portal-kanban-card,.message-body,.message-quote,.message-file,.b-document,.product-name{word-wrap:break-word;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}
 .lz-cal-grid>*,.lz-cal-day{min-width:0}
}
/* Feature-detected fallback for Safari versions without flex gap (including iOS 12). */
html.no-flex-gap .toolbar,html.no-flex-gap .dialog-actions,html.no-flex-gap .cash-header-account,html.no-flex-gap .message-input-row,html.no-flex-gap .message-bubble-actions,html.no-flex-gap .message-reactions,html.no-flex-gap .message-chat-filters,html.no-flex-gap .cash-register-control,html.no-flex-gap .top-status{gap:0!important}
html.no-flex-gap .toolbar>*,html.no-flex-gap .dialog-actions>*,html.no-flex-gap .cash-header-account>*,html.no-flex-gap .message-bubble-actions>*,html.no-flex-gap .message-reactions>*,html.no-flex-gap .message-chat-filters>*,html.no-flex-gap .cash-register-control>*,html.no-flex-gap .top-status>*{margin-right:6px;margin-bottom:5px}
html.no-flex-gap .message-input-row>*+*{margin-left:6px}
html.no-flex-gap .message-input-row textarea{min-width:0;width:0;flex:1 1 0%}
@media screen and (max-width:700px){html.no-flex-gap .cash-header-account>*{margin-right:3px}html.no-flex-gap .message-input-row>*+*{margin-left:4px}}
@media screen and (max-width:1366px){html.no-flex-gap body.portal-menu-ready>header>button,html.no-flex-gap body.portal-menu-ready>header>div:first-of-type{margin-right:4px!important}}
.lz-activity-check{width:calc(100% - 32px);max-width:440px;max-height:calc(100vh - 32px);box-sizing:border-box;padding:24px;border:1px solid #c9b0e2;border-radius:18px;background:#faf7fd;color:#302039;box-shadow:0 18px 70px #1d082e45}
.lz-activity-check::backdrop{background:#21112c88}
.lz-activity-check h2{font-size:21px;line-height:1.3;margin:0 0 12px}
.lz-activity-actions{display:flex;flex-wrap:wrap;gap:10px}
.lz-activity-actions button{flex:1 1 150px;min-height:48px;padding:12px;border:0;border-radius:10px;background:#64308d;color:white;font:700 15px system-ui,Arial}
.lz-activity-actions [data-activity-no]{background:#f5e4e8;color:#962039}
