/* Mobile staff workspace and customer chat. Browser zoom remains available. */
#kb-chat-back{display:none}
.kb-chat-mobile-content{display:contents}
@media(max-width:780px){
 .kb-desk-body,.kb-staff-editor-page{font-size:16px;overflow-wrap:anywhere}
 .kb-desk-body *, .kb-staff-editor-page .kb-front-editor *{box-sizing:border-box;min-width:0}
 .kb-desk-body input,.kb-desk-body select,.kb-desk-body textarea,.kb-staff-editor-page input,.kb-staff-editor-page select,.kb-staff-editor-page textarea{font-size:16px!important}
 .kb-desk-body button,.kb-desk-body input:not([type=checkbox]),.kb-desk-body select,.kb-front-editor button,.kb-front-editor .button{min-height:44px}
 .kb-desk-body [hidden],.kb-chat-widget [hidden]{display:none!important}
 .kb-desk-body .desk-header{padding:10px 14px;gap:8px;min-height:68px}
 .kb-desk-body .desk-brand{font-size:13px;letter-spacing:.3px;gap:8px}
 .kb-desk-body .desk-brand-mark{width:36px;height:36px;flex-shrink:0;font-size:24px}
 .kb-desk-body .desk-header-actions{gap:10px;font-size:13px}
 .kb-desk-body .desk-user{display:none}
 .kb-desk-body .desk-main{padding:18px 14px calc(98px + env(safe-area-inset-bottom))}
 .kb-desk-body .desk-intro{display:block;margin-bottom:18px}
 .kb-desk-body .desk-intro h1{font-size:24px;line-height:1.5}
 .kb-desk-body .desk-intro p{font-size:15px}
 .kb-desk-body .desk-live{display:block;margin-top:10px;font-size:13px}
 .kb-desk-body .desk-primary{position:fixed;bottom:0;left:0;right:0;z-index:80;display:flex;gap:5px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));margin:0;background:#fff;border-top:1px solid #dae2ed;box-shadow:0 -4px 20px #1836550b}
 .kb-desk-body .desk-action{flex:1;flex-direction:column;justify-content:center;gap:2px;padding:7px 4px;border-radius:10px;box-shadow:none;min-height:60px;text-align:center;border-color:transparent;background:#f3f6fb}
 .kb-desk-body .desk-action.is-active{background:#314f7b;color:#fff;border-color:#314f7b}
 .kb-desk-body .desk-action strong{font-size:14px;line-height:1.5}
 .kb-desk-body .desk-action small,.kb-desk-body .desk-action .desk-action-arrow{display:none}
 .kb-desk-body .desk-action svg{width:22px;height:22px}
 .kb-desk-body .desk-action>span:first-child{width:auto;height:auto;padding:0;background:none}
 .kb-desk-body .desk-secondary{gap:6px;margin:0 0 20px}
 .kb-desk-body .desk-secondary a,.kb-desk-body .desk-secondary button{font-size:14px;min-height:44px;display:inline-flex;align-items:center;padding:9px 12px}
 .kb-desk-body .desk-panel-heading{align-items:flex-start;gap:10px;flex-wrap:wrap}
 .kb-desk-body .desk-panel-heading h2{font-size:22px}
 .kb-desk-body .desk-filter-bar{display:grid;grid-template-columns:1fr;gap:10px}
 .kb-desk-body .desk-filter-bar label,.kb-desk-body .desk-filter-bar input,.kb-desk-body .desk-filter-bar select{width:100%;max-width:100%}
 .kb-desk-body .desk-filter-bar label{font-size:14px}
 .kb-desk-body .desk-table-wrap{overflow:visible;border:0;background:transparent;box-shadow:none}
 .kb-desk-body .desk-table-wrap table,.kb-staff-editor-page .kb-products-table{display:block;min-width:0!important;width:100%}
 .kb-desk-body .desk-table-wrap thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .kb-desk-body .desk-table-wrap tbody,.kb-staff-editor-page .kb-products-table tbody{display:block}
 .kb-desk-body .desk-table-wrap tr,.kb-staff-editor-page .kb-products-table tbody tr{display:block;background:#fff;border:1px solid #dbe3ee;border-radius:14px;padding:12px 14px;margin:0 0 12px;box-shadow:0 3px 10px #233e5a04}
 .kb-desk-body .desk-table-wrap td,.kb-staff-editor-page .kb-products-table td{display:block;width:auto;padding:7px 0;border:0;white-space:normal;font-size:16px;overflow-wrap:anywhere}
 .kb-desk-body .desk-table-wrap td[data-label]:not([data-label=""])::before,.kb-staff-editor-page .kb-products-table td[data-label]:not([data-label=""])::before{content:attr(data-label);display:block;font-size:13px;font-weight:500;color:#66768a;margin-bottom:3px}
 .kb-desk-body .desk-table-wrap td small{font-size:13px;white-space:normal}
 .kb-desk-body .desk-table-wrap td button{width:100%;font-size:16px}
 .kb-desk-body #desk-order-dialog{width:100%;max-width:100%;height:var(--kb-viewport-height,100dvh);max-height:var(--kb-viewport-height,100dvh);inset:var(--kb-viewport-top,0px) 0 auto;margin:0;padding:0 16px calc(18px + env(safe-area-inset-bottom));border:0;border-radius:0;overflow:auto;overscroll-behavior:contain;font-size:16px}
 .kb-desk-body .desk-dialog-heading{position:sticky;top:0;background:#fff;z-index:2;padding:14px 0;margin-bottom:16px;border-bottom:1px solid #dbe3ee;gap:10px}
 .kb-desk-body .desk-dialog-heading h2{font-size:22px;line-height:1.5}
 .kb-desk-body #desk-order-close{min-width:44px;min-height:44px;flex-shrink:0}
 .kb-desk-body .desk-order-grid{grid-template-columns:1fr;gap:14px}
 .kb-desk-body #desk-order-detail{overflow-wrap:anywhere;line-height:1.7}
 .kb-desk-body #desk-order-detail p,.kb-desk-body .desk-payment-card p{font-size:16px}
 .kb-desk-body .desk-payment-card{padding:14px}
 .kb-desk-body .desk-payment-card button{width:100%;white-space:normal;font-size:16px}
 .kb-desk-body .desk-order-actions{display:flex;flex-direction:column;align-items:stretch;gap:12px}
 .kb-desk-body .desk-order-actions label,.kb-desk-body .desk-order-actions input{width:100%;font-size:16px}
 .kb-desk-body .desk-order-actions a{padding:10px 0;min-height:44px}
 .kb-desk-body #desk-notifications{position:fixed;top:70px;left:10px;right:10px;width:auto;max-height:calc(100dvh - 165px);overflow:auto}
 /* Opening a conversation uses the available screen instead of stacking two panes. */
 .kb-desk-body[data-desk-view=chat] .desk-intro,.kb-desk-body[data-desk-view=chat] .desk-secondary,.kb-desk-body[data-desk-view=chat] .desk-footer,.kb-desk-body[data-desk-view=chat] #desk-chat>.desk-panel-heading,.kb-desk-body[data-desk-view=chat] .kb-chat-admin>h1,.kb-desk-body[data-desk-view=chat] .kb-chat-admin>p{display:none}
 .kb-desk-body[data-desk-view=chat] .desk-main{padding:8px 10px 0}
 .kb-desk-body .kb-chat-admin{margin:0}
 .kb-desk-body .kb-inbox{display:block;height:var(--kb-inbox-height,calc(100dvh - 158px));min-height:180px;border-radius:14px;overflow:hidden}
 .kb-desk-body .kb-inbox>aside{height:100%;max-height:none;min-height:0;padding:14px;overflow:auto;border:0}
 .kb-desk-body .kb-inbox>aside h2{font-size:22px;margin:0 0 12px}
 .kb-desk-body #kb-thread-filter{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .kb-desk-body #kb-thread-filter input{grid-column:1/-1;width:100%}
 .kb-desk-body #kb-thread-filter select,.kb-desk-body #kb-thread-filter button{width:100%}
 .kb-desk-body .kb-thread{padding:16px 12px;min-height:76px;font-size:16px;white-space:normal}
 .kb-desk-body .kb-thread strong{font-size:16px}
 .kb-desk-body .kb-thread small{font-size:13px;line-height:1.6}
 .kb-desk-body .kb-inbox-conversation{display:none;height:100%}
 .kb-desk-body .kb-inbox.kb-thread-open>aside{display:none}
 .kb-desk-body .kb-inbox.kb-thread-open>.kb-inbox-conversation{display:flex;flex-direction:column}
 .kb-desk-body #kb-chat-back{display:inline-flex;align-items:center;min-height:44px;font-size:15px;align-self:flex-start}
 .kb-desk-body .kb-inbox-conversation>header{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:10px 12px;max-height:40%;overflow:auto;flex-shrink:0}
 .kb-desk-body #kb-admin-chat-name{font-size:18px;margin:0;line-height:1.5}
 .kb-desk-body #kb-admin-chat-details{font-size:13px;margin:2px 0;overflow-wrap:anywhere}
 .kb-desk-body .kb-inbox-conversation>header>div:last-child{display:flex;flex-wrap:wrap;gap:8px}
 .kb-desk-body .kb-inbox-conversation>header button{font-size:14px;white-space:normal}
 .kb-desk-body #kb-admin-chat-messages{padding:12px;flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain}
 .kb-desk-body .kb-chat-message{font-size:16px;max-width:95%;overflow-wrap:anywhere}
 .kb-desk-body .kb-chat-message p{font-size:16px!important;line-height:1.65}
 .kb-desk-body .kb-chat-message small,.kb-desk-body .kb-chat-message time{font-size:12px}
 .kb-desk-body .kb-chat-message button{font-size:14px;white-space:normal;max-width:100%;margin-top:8px}
 .kb-desk-body #kb-admin-chat-form{padding:10px 12px;flex-shrink:0;border-top:1px solid #e1e7ef}
 .kb-desk-body #kb-admin-chat-form>label{font-size:14px}
 .kb-desk-body #kb-admin-chat-form>div{display:flex;flex-direction:row;align-items:flex-end;gap:8px}
 .kb-desk-body #kb-admin-chat-reply{min-width:0;flex:1;min-height:52px;height:64px;max-height:100px;resize:vertical;font-size:16px;padding:10px}
 .kb-desk-body #kb-admin-chat-form button{width:auto;flex-shrink:0;padding:12px;font-size:15px}
 .kb-desk-body #kb-admin-chat-status{font-size:13px;margin:0;padding:0 12px;max-height:48px;overflow:auto}
 .kb-desk-body #kb-admin-chat-status:empty{display:none}
 .kb-desk-body.kb-keyboard-open .desk-primary{display:none}
 .kb-desk-body.kb-keyboard-open .kb-inbox-conversation>header>div:last-child{display:none}
 /* Product editor: the staff navigation takes priority over the storefront header. */
 html:has(body.kb-staff-editor-page){margin-top:0!important}
 .kb-staff-editor-page #wpadminbar,.kb-staff-editor-page .kb-header,.kb-staff-editor-page .site-header,.kb-staff-editor-page .site-footer,.kb-staff-editor-page .kb-footer,.kb-staff-editor-page .kb-chat-widget,.kb-staff-editor-page .kb-benefits,.kb-staff-editor-page .kb-privacy-footer,.kb-staff-editor-page .kb-staff-alerts{display:none!important}
 .kb-staff-editor-page .kb-front-worknav{position:sticky;top:0;z-index:50;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 0 18px;padding:10px;background:#fff;border-bottom:1px solid #dce3ed;border-radius:0;box-shadow:0 3px 15px #18365508}
 .kb-staff-editor-page .kb-front-worknav a{display:flex;align-items:center;justify-content:center;text-align:center;min-height:44px;font-size:14px;padding:8px 4px;background:#edf2f8;border-radius:8px}
 .kb-staff-editor-page #content,.kb-staff-editor-page .content-area,.kb-staff-editor-page .site-main,.kb-staff-editor-page .entry-content{width:100%;max-width:100%;margin:0;padding:0}
 .kb-staff-editor-page .col-full{padding:0 12px;margin:0;width:auto;max-width:none}
 .kb-staff-editor-page .entry-header{display:none}
 .kb-staff-editor-page .kb-front-editor{padding-bottom:32px}
 .kb-staff-editor-page .kb-admin-heading h1{font-size:24px;line-height:1.5}
 .kb-staff-editor-page .kb-admin-grid,.kb-staff-editor-page .kb-field-pair{display:grid;grid-template-columns:1fr;gap:14px}
 .kb-staff-editor-page .kb-admin-card{padding:16px!important;overflow:visible!important}
 .kb-staff-editor-page .kb-admin-card h2{font-size:19px}
 .kb-staff-editor-page .kb-field label,.kb-staff-editor-page .kb-admin-card>label{font-size:15px}
 .kb-staff-editor-page .kb-admin-card small,.kb-staff-editor-page .description{font-size:13px;line-height:1.65}
 .kb-staff-editor-page .kb-products-table thead{display:block}
 .kb-staff-editor-page .kb-products-table thead tr{display:block}
 .kb-staff-editor-page .kb-products-table thead th:not(:first-child){display:none}
 .kb-staff-editor-page .kb-products-table thead th:first-child{display:flex;align-items:center;gap:10px;padding:12px 0}
 .kb-staff-editor-page .kb-products-table thead th:first-child::after{content:'เลือกสินค้าทั้งหมดในหน้านี้';font-size:14px;font-weight:500}
 .kb-staff-editor-page .kb-products-table input[type=checkbox]{width:24px;height:24px;min-height:24px;margin:8px}
 .kb-staff-editor-page .kb-products-table .kb-book-cell{align-items:flex-start;gap:12px}
 .kb-staff-editor-page .kb-products-table .kb-book-cell img{width:60px;height:80px;object-fit:contain;flex-shrink:0}
 .kb-staff-editor-page .kb-products-table td:last-child{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
 .kb-staff-editor-page .kb-products-table td:last-child::before{width:100%}
 .kb-staff-editor-page .media-modal{inset:0}
 .kb-staff-editor-page .media-modal input,.kb-staff-editor-page .media-modal select{font-size:16px!important}
 /* The customer chat is a modal occupying the current visual viewport. */
 body.kb-customer-chat-open{overflow:hidden!important}
 body.kb-customer-chat-open .kb-chat-widget{z-index:100100!important}
 body.kb-customer-chat-open #kb-chat-toggle,body.kb-customer-chat-open #kb-reply-notice{visibility:hidden}
 .kb-chat-widget #kb-chat-panel{position:fixed;inset:var(--kb-chat-top,0px) 0 auto;width:100%;max-width:100%;height:var(--kb-chat-height,100dvh);max-height:var(--kb-chat-height,100dvh)!important;margin:0;border:0;border-radius:0;display:flex;flex-direction:column;overflow:hidden;background:#fff;box-shadow:none;padding-top:env(safe-area-inset-top)}
 .kb-chat-widget #kb-chat-panel>header{position:relative;top:auto;flex-shrink:0;padding:12px 16px;min-height:68px;gap:12px}
 .kb-chat-widget #kb-chat-panel>header strong{font-size:18px;line-height:1.5}
 .kb-chat-widget #kb-chat-panel>header small{font-size:13px}
 .kb-chat-widget #kb-chat-close{width:44px;height:44px;min-width:44px;font-size:28px}
 .kb-chat-mobile-content{display:block;flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 0 12px;scroll-padding-bottom:12px}
 .kb-chat-widget .kb-chat-greeting{font-size:15px;line-height:1.7;margin:14px 16px}
 .kb-chat-widget .kb-chat-line{font-size:15px;min-height:44px;display:flex;justify-content:center;align-items:center;margin:8px 16px}
 .kb-chat-widget .kb-chat-notification-options{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px}
 .kb-chat-widget .kb-chat-notification-options button{min-height:44px;font-size:13px;white-space:normal;flex:1}
 .kb-chat-widget #kb-chat-messages{max-height:none;height:auto;min-height:0;overflow:visible;padding:12px 16px}
 .kb-chat-widget .kb-chat-message{font-size:16px;max-width:94%;line-height:1.7;overflow-wrap:anywhere}
 .kb-chat-widget .kb-chat-message p{font-size:16px;line-height:1.7}
 .kb-chat-widget .kb-chat-message small,.kb-chat-widget .kb-chat-message time{font-size:12px}
 .kb-chat-widget .kb-shared-product{align-items:flex-start;overflow-wrap:anywhere;font-size:15px}
 .kb-chat-widget .kb-shared-product img{width:64px;height:80px;object-fit:contain;flex-shrink:0}
 .kb-chat-widget .kb-share-preview{margin:12px 16px;font-size:15px}
 .kb-chat-widget #kb-chat-identity{padding:8px 16px}
 .kb-chat-widget #kb-chat-identity label{font-size:15px;margin-bottom:12px}
 .kb-chat-widget #kb-chat-identity input,.kb-chat-widget #kb-chat-identity select{font-size:16px;height:46px;padding:8px 10px;width:100%;max-width:100%}
 .kb-chat-widget #kb-chat-form{padding:10px 16px calc(10px + env(safe-area-inset-bottom));margin:0;flex-shrink:0;border-top:1px solid #dce3ed;background:#fff}
 .kb-chat-widget .kb-chat-compose{gap:8px;align-items:flex-end}
 .kb-chat-widget #kb-chat-message{font-size:16px;min-height:52px;height:58px;max-height:100px;line-height:1.5;padding:12px;min-width:0;flex:1}
 .kb-chat-widget .kb-chat-compose button{min-height:52px;min-width:52px;font-size:16px}
 .kb-chat-widget #kb-chat-status{font-size:13px;line-height:1.5;max-height:44px;overflow:auto;margin:4px 0}
 .kb-chat-widget #kb-chat-status:empty{display:none}
 .kb-chat-widget .kb-chat-privacy{font-size:12px;line-height:1.5;margin-top:8px}
 .kb-chat-widget #kb-chat-panel.kb-chat-active .kb-chat-greeting{display:none}
 .kb-chat-widget #kb-chat-panel.kb-chat-keyboard .kb-chat-privacy{display:none}
}

@media(max-width:780px){
.kb-desk-body[data-desk-view=chat] #desk-chat>.desk-section-heading{display:none}
.kb-desk-body .desk-task-grid{grid-template-columns:1fr}
.kb-desk-body .desk-task{padding:18px;display:grid;grid-template-columns:1fr auto;gap:8px;text-align:left}
.kb-desk-body .desk-task span{font-size:16px}.kb-desk-body .desk-task strong{font-size:26px;grid-column:2;grid-row:1/3}.kb-desk-body .desk-task small{font-size:13px}
.kb-staff-editor-page .kb-content-page>h1,.kb-staff-editor-page .kb-simple-crumb,.kb-staff-editor-page #kb-cookie-banner{display:none!important}
.kb-staff-editor-page .kb-content-page{padding:0 12px!important}
.kb-desk-body .desk-section-heading{gap:10px;flex-wrap:wrap}.kb-desk-body .desk-section-heading h2{font-size:22px}.kb-desk-body .desk-section-heading span{font-size:13px}
}

@media(max-width:780px) and (max-height:520px){
.kb-desk-body .desk-header{min-height:52px;padding:4px 10px}
.kb-desk-body .kb-inbox-conversation>header{max-height:30%}
.kb-desk-body #kb-admin-chat-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.kb-desk-body #kb-admin-chat-reply{height:52px}
}
@media(max-width:780px){
.kb-desk-body.kb-keyboard-open .desk-header{display:none}
.kb-desk-body.kb-keyboard-open .kb-inbox-conversation>header{max-height:30%}
.kb-desk-body.kb-keyboard-open #kb-admin-chat-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.kb-desk-body.kb-keyboard-open #kb-admin-chat-reply{height:52px}
}

@media(max-width:780px){.kb-chat-widget input,.kb-chat-widget select,.kb-chat-widget textarea{font-size:16px!important}}
