/* Desktop keeps its existing layout. Account navigation collapses below 1024px. */
.wth-mobile-bar,.wth-menu-backdrop,.wth-menu-close{display:none}
.wth-sidebar{z-index:100;overflow-y:auto;padding-bottom:6rem}
@media(max-width:1023px){
 .wth-mobile-bar{display:flex;position:fixed;inset:0 0 auto;z-index:110;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));min-height:64px;background:#2b0f17;color:white;box-shadow:0 2px 12px #0002}
 .wth-mobile-brand{font:1.35rem Georgia,serif;text-align:left}
 .wth-menu-toggle,.wth-menu-close{min-height:44px;padding:10px 14px;border:1px solid #c8a36a80;border-radius:12px;color:white;font-weight:700}
 .wth-menu-backdrop{display:block;position:fixed;inset:0;z-index:170;background:#0008}
 .wth-sidebar{z-index:180;max-width:calc(100vw - 32px);height:100vh;height:100dvh;transform:translateX(-100%);visibility:hidden;padding-bottom:max(24px,env(safe-area-inset-bottom));overscroll-behavior:contain}
 .wth-sidebar[data-mobile-open="true"]{transform:none;visibility:visible}
 .wth-menu-close{display:block;margin-left:auto;margin-bottom:12px}
 .wth-sidebar .wth-logout{position:static;margin-top:24px}
 .wth-space-main{z-index:auto!important;margin-left:0!important;min-width:0;padding:calc(80px + env(safe-area-inset-top)) 16px 24px!important}
 .wth-space-header{position:relative!important;top:auto!important}
 .wth-space-overlay,.offer-modal-overlay{left:0!important;z-index:200!important;padding:12px!important;height:100vh;height:100dvh;overflow-y:auto;overscroll-behavior:contain}
 .wth-space-overlay>div,.offer-modal-dialog{max-width:100%!important;max-height:calc(100dvh - 24px)!important;min-width:0;overflow-y:auto;overscroll-behavior:contain}
 .wth-messages{min-height:0}
 .wth-messages>div:first-child{max-height:36vh;overflow:auto;border-right:0;border-bottom:1px solid #eee}
 .wth-messages>div{min-width:0;padding:16px}
 .wth-messages .flex.items-start.justify-between{flex-wrap:wrap}
 .wth-messages p{overflow-wrap:anywhere}
 .wth-messages time{white-space:normal}
 .wth-space-header>div{flex-wrap:wrap}
 .wth-space-header>div>button{max-width:100%;text-align:left}
 .wth-space-main .grid>*,.wth-space-main form,.wth-space-main input,.wth-space-main select,.wth-space-main textarea{min-width:0;max-width:100%}
}
@media(max-width:767px){
 html,body{max-width:100%;margin:0}
 #root{overflow-wrap:break-word}
 #root input,#root select,#root textarea{font-size:16px!important;max-width:100%}
 #root button,#root a{touch-action:manipulation}
 #root .p-8,#root .p-10,#root .p-12{padding:20px}
 #root .px-8,#root .px-10,#root .px-12{padding-left:20px;padding-right:20px}
 #root .text-5xl{font-size:2.25rem;line-height:1.15}
 #root .text-4xl{font-size:1.9rem;line-height:1.2}
 .wth-landing-nav{order:3;width:100%;justify-content:space-between;gap:8px}
 .wth-landing-nav button{min-height:44px}
 .offer-modal-dialog{display:flex!important;flex-direction:column}
 .offer-modal-dialog>div:first-child{min-height:240px!important;max-height:32vh;flex-shrink:0}
 .offer-modal-dialog>div:first-child img{min-height:0!important;height:240px!important;max-height:32vh;object-fit:contain}
 .wth-offer-close{position:fixed;right:22px;top:max(22px,env(safe-area-inset-top));z-index:210;background:white;border-radius:50%;height:44px;width:44px;color:#6f1832!important;box-shadow:0 2px 8px #0002}
 .offer-modal-dialog h2{padding-right:32px}
 .offer-detail-actions{grid-template-columns:1fr!important}
 .wth-space-main .flex.justify-between{gap:12px;flex-wrap:wrap}
 .wth-messages [class*="max-w-[80%]"]{max-width:94%}
 .wth-messages [class*="max-w-[80%]"]>div:first-child{flex-wrap:wrap}
}

/* The Tailwind runtime injects z-[100] after this sheet. Use the menu ID so
   its backdrop can never cover the navigation controls. */
@media(max-width:1023px){
 #wth-space-menu{z-index:180!important;pointer-events:none}
 #wth-space-menu[data-mobile-open="true"]{z-index:180!important;pointer-events:auto;visibility:visible!important;transform:translateX(0)!important}
 .wth-mobile-bar{z-index:160!important;pointer-events:auto}
 .wth-menu-toggle,.wth-menu-close{position:relative;pointer-events:auto;cursor:pointer}
 .wth-menu-backdrop{z-index:170!important}
}
