/* Shared page theme; mobile controls follow the supplied gold capsule reference. */
.ns-mobile-actions,.ns-mobile-close,.ns-ui-icon{display:none}
@media(max-width:767px){
 html{overflow:hidden}
 body{margin:0!important;width:100%;height:var(--ns-viewport-height,100dvh)!important;overflow:hidden}
 body .app-container{width:100%;max-width:100%;height:var(--ns-viewport-height,100dvh)!important;min-height:0;overflow:hidden}
 body .main-content{flex:1 1 0;min-width:0;width:100%;max-width:100%;min-height:0;height:100%;overflow:hidden}
 body .top-bar{flex:0 0 auto;height:calc(68px + env(safe-area-inset-top,0px));padding:calc(12px + env(safe-area-inset-top,0px)) 16px 12px;gap:8px;min-width:0}
 body #mobileMenuBtn{display:flex!important;top:calc(12px + env(safe-area-inset-top,0px));left:16px;width:44px;height:44px}
 .ns-mobile-actions{display:flex;gap:8px;align-items:center}
 .ns-mobile-actions button,.ns-mobile-close{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;padding:0;border:1px solid var(--border-color);border-radius:14px;background:var(--surface-bg);color:var(--text-primary);cursor:pointer}
 body #mobileMenuBtn,body .ns-mobile-actions button{display:grid!important;place-items:center;box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid var(--ns-mobile-gold)!important;border-radius:50%!important;background:var(--ns-mobile-soft)!important;color:var(--ns-mobile-ink)!important;box-shadow:0 2px 4px -2px rgba(80,59,34,.18),inset 0 1px 0 rgba(255,255,255,.75);cursor:pointer;transition:background .18s ease,border-color .18s ease,transform .15s ease}
 body #mobileMenuBtn:hover,body .ns-mobile-actions button:hover{background:var(--ns-mobile-hover)!important;border-color:var(--ns-mobile-gold-rim)!important}
 body #mobileMenuBtn:active,body .ns-mobile-actions button:active{transform:scale(.96)}
 body #mobileMenuBtn:focus-visible,body .ns-mobile-actions button:focus-visible{outline:2px solid var(--ns-mobile-heading);outline-offset:3px}
 .ns-ui-icon{display:inline-block;width:21px!important;height:21px!important;flex:0 0 21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
 #mobileMenuBtn .ns-ui-icon,.ns-mobile-actions .ns-ui-icon{width:22px!important;height:22px!important;flex-basis:22px;stroke-width:2}
 i:has(>.ns-ui-icon)::before{display:none!important}
 i:has(>.ns-ui-icon){display:inline-flex!important;align-items:center;justify-content:center;font-style:normal}
 body #sidebar{position:fixed;inset:0 auto 0 0;z-index:100;width:min(300px,calc(100% - 48px));max-width:calc(100% - 48px);height:var(--ns-viewport-height,100dvh);padding:calc(16px + env(safe-area-inset-top,0px)) 12px calc(16px + env(safe-area-inset-bottom,0px));transform:translateX(-100%);transition:transform .2s ease;overflow:hidden;overscroll-behavior:contain}
 body #sidebar.active{left:0;transform:translateX(0)}
 #sidebar .logo-section{min-height:44px;padding:0 10px;margin-bottom:14px}
 #sidebar .ns-mobile-close{position:absolute;top:calc(16px + env(safe-area-inset-top,0px));right:12px;width:36px;height:36px;min-width:36px}
 #sidebar .menu-section{min-height:0;flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain}
 #sidebar .new-chat-btn{min-height:46px;flex:0 0 auto}
 #sidebar #authSection{flex:0 0 auto;margin-top:12px;padding:12px;border-radius:16px}
 #sidebar #authSection button{min-height:44px;border-radius:12px!important}
 #sidebar .menu-item{min-height:44px;margin:2px 0}
 body #overlay{z-index:99}
 body #chatContainer{flex:1 1 0;min-width:0;min-height:0;width:100%;max-width:100%;margin:0;padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));overflow:hidden;justify-content:center}
 body #mainHeading{flex:0 0 auto;width:100%;margin:0 0 28px;font-size:clamp(30px,8vw,32px);font-weight:500;line-height:1.5;letter-spacing:-.03em;text-align:center;color:var(--ns-mobile-heading)}
 #mainHeading>span:first-child{font-weight:500!important}
 #mainHeading>br,#mainHeading>span:last-child{display:none!important}
 /* Style the existing controls so their service/chat handlers stay attached. */
 body #inputContainer{position:relative;flex:0 0 auto;min-width:0;width:100%;max-width:100%;min-height:0!important;height:auto!important;padding:0!important;background:var(--ns-mobile-surface)!important;border:1px solid var(--ns-mobile-line)!important;border-radius:32px!important;box-shadow:0 2px 8px rgba(73,57,47,.035)!important}
 body #inputContainer:focus-within{border-color:var(--ns-mobile-gold)!important;box-shadow:0 0 0 2px rgba(180,146,102,.1),0 2px 8px rgba(73,57,47,.035)!important}
 #inputContainer::before{content:none;display:none}
 #inputContainer .input-wrapper{min-width:0;min-height:72px;padding:18px 15px 16px;gap:8px;align-items:flex-start}
 body #chatInput{display:block;flex:1 1 0;min-width:0;width:100%;height:24px;padding:0;font-family:inherit;font-size:16px;line-height:1.5;text-overflow:ellipsis;color:var(--ns-mobile-muted)}
 body #chatInput,body #chatInput::placeholder{color:var(--ns-mobile-muted);font-weight:400;opacity:1}
 #inputContainer .input-actions{height:74px;min-height:74px;padding:14px 15px 16px;border:0;flex-wrap:nowrap;align-items:center;gap:3px}
 #inputContainer .input-left{flex:0 0 44px;min-width:0;flex-wrap:nowrap}
 body #inputContainer .input-btn,body #inputContainer #nsChatTools button{display:inline-flex;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;flex:0 0 44px!important;padding:0;background:var(--ns-mobile-circle);color:var(--ns-mobile-ink);border:0;border-radius:50%!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.18);transition:background .18s ease,transform .15s ease}
 #inputContainer #nsChatTools{left:62px;bottom:16px;max-width:calc(100% - 126px);gap:3px;overflow:visible}
 #inputContainer .input-btn .ns-ui-icon,#inputContainer #nsChatTools .ns-ui-icon{width:16px!important;height:16px!important;flex-basis:16px;stroke-width:1.7}
 body #inputContainer .input-btn:hover,body #inputContainer #nsChatTools button:hover{background:var(--ns-mobile-gold-light);color:var(--ns-mobile-ink)}
 body #submitBtn{position:absolute;top:auto;right:14px;bottom:14px;flex:0 0 48px;width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;padding:0;background:var(--ns-mobile-primary)!important;color:var(--ns-mobile-on-primary)!important;border:2px solid var(--ns-mobile-gold-rim)!important;border-radius:50%!important;box-shadow:0 2px 5px rgba(61,49,42,.18)}
 #submitBtn .ns-ui-icon{width:18px!important;height:18px!important;flex-basis:18px;stroke-width:1.6}
 body #submitBtn:disabled{opacity:1}
 body #submitBtn:not(:disabled):hover{transform:none;opacity:.9}
 body #nsMemChips{flex:0 0 auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;max-width:240px;min-width:0;gap:6px;margin:20px auto 0;padding:0;overflow:visible;box-sizing:border-box}
 body #nsMemChips .ns-featured-category{position:relative;display:flex;align-items:center;justify-content:center;flex:initial;min-width:0!important;width:100%;height:38px;min-height:38px;padding:0!important;background:var(--ns-mobile-paper)!important;border:1px solid var(--ns-mobile-gold)!important;border-radius:17px!important;box-shadow:0 2px 5px rgba(73,57,47,.06)!important;transform:none!important;transition:background .18s ease,border-color .18s ease,transform .15s ease}
 /* Extend the touch area to 44px without enlarging the reference's visible capsule. */
 #nsMemChips .ns-featured-category::after{content:"";position:absolute;inset:-3px 0}
 body #nsMemChips .ns-featured-category i{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;border-radius:50%;background:var(--ns-mobile-circle);border:0;box-shadow:none;color:#8B6E4E!important;font-size:12px;transition:background .18s ease}
 #nsMemChips .ns-featured-category .ns-ui-icon{width:12px!important;height:12px!important;flex-basis:12px;stroke-width:1.7}
 body #nsMemChips .ns-featured-category:hover{background:var(--ns-mobile-hover)!important;border-color:var(--ns-mobile-heading)!important}
 body #nsMemChips .ns-featured-category:hover i{background:var(--ns-mobile-circle)}
 body #inputContainer .input-btn:active,body #inputContainer #nsChatTools button:active,body #submitBtn:not(:disabled):active,body #nsMemChips .ns-featured-category:active{transform:scale(.95)!important}
 #inputContainer button:focus-visible,#nsMemChips button:focus-visible{outline:2px solid var(--ns-mobile-heading);outline-offset:3px}
 #nsMemChips .ns-featured-category>span{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body #chatContainer.chatting{justify-content:flex-start;padding-top:0;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
 body .chatting #mainHeading,body .chatting #nsMemChips,body .chatting #nsMemDraftNotice{display:none!important}
 body #messagesArea{flex:1 1 0;min-width:0;min-height:0;width:100%!important;max-width:100%!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scroll-padding-top:12px;padding:12px 0 18px!important;margin-bottom:12px!important;overflow-wrap:anywhere;-webkit-overflow-scrolling:touch}
 #messagesArea>*{min-width:0;max-width:100%;box-sizing:border-box}
 #messagesArea .msg-user span{max-width:90%;overflow-wrap:anywhere}
 #messagesArea .msg-ai{width:100%;min-width:0;gap:8px}
 #messagesArea .msg-ai-avatar{width:26px;height:26px;min-width:26px}
 #messagesArea .msg-ai-bubble{flex:1 1 0;min-width:0;max-width:calc(100% - 34px);padding:12px;overflow-wrap:anywhere}
 #messagesArea .ns-mem-btn{max-width:100%;min-height:44px;white-space:normal;line-height:1.5}
 #messagesArea .ns-mem-wow,#messagesArea .ns-mem-wow-portal,#messagesArea .ns-mem-portal-card{width:100%;min-width:0}
 #messagesArea .ns-home-category-items{gap:8px}
 #messagesArea .ns-quiet-wow{width:100%;min-width:0;max-width:100%;margin:8px 0 16px;border-radius:18px;overflow:clip}
 #messagesArea .ns-quiet-wow-top{position:sticky;top:0;z-index:2;gap:8px;min-width:0;padding:10px 12px}
 .ns-quiet-wow-top>span{flex:1 1 0;min-width:0;font-size:12px;overflow-wrap:anywhere}
 #messagesArea .ns-quiet-wow-top button{flex:0 0 auto;min-height:44px;padding:8px 12px}
 #messagesArea .ns-quiet-wow iframe{display:block;width:100%;max-width:100%;height:clamp(260px,calc(var(--ns-viewport-height,100dvh) - 270px),660px);min-height:0!important;border:0}
 #messagesArea .ns-vw{width:100%;max-width:100%;min-width:0}
 #messagesArea .ns-vw-light,#messagesArea .ns-vw-dark{grid-template-columns:minmax(0,1fr);padding:16px;border-radius:18px;min-width:0}
 #messagesArea .ns-vw-form,#messagesArea .ns-vw-options{min-width:0;padding:16px}
 #messagesArea .ns-vw-options legend{max-width:100%;padding:4px 8px;border-radius:10px;background:inherit;color:inherit;line-height:1.5}
 #messagesArea .ns-vw-form-grid,#messagesArea .ns-vw-option-list{grid-template-columns:minmax(0,1fr)}
 #messagesArea .ns-vw-form input,#messagesArea .ns-vw-form textarea{min-width:0;font-size:16px}
 #messagesArea .ns-vw-step{grid-template-columns:26px minmax(0,1fr) 44px;gap:10px}
 #messagesArea .ns-vw-step .ns-mem-btn{width:44px;height:44px;min-height:44px;padding:0;border-radius:50%}
 #authModal{padding:16px!important;overflow-y:auto;overscroll-behavior:contain}
 #authModal>div{width:100%!important;max-width:400px!important;min-width:0;max-height:calc(var(--ns-viewport-height,100dvh) - 32px);overflow-y:auto;padding:24px!important;border-radius:24px!important}
 #authModal input{min-width:0;width:100%;font-size:16px!important}
 #authModal button{min-height:44px}
 #authModal>div>button:first-child{width:44px!important;height:44px!important;min-width:44px;padding:0;border-radius:50%!important}
 @media(max-height:600px){body #chatContainer{padding-top:8px;padding-bottom:12px}body #mainHeading{margin-bottom:18px}body #nsMemChips{margin-top:12px}}
 @media(prefers-reduced-motion:reduce){body #sidebar,body #mobileMenuBtn,.ns-mobile-actions button,#inputContainer,#inputContainer button,#nsMemChips button,#nsMemChips i{transition:none!important}#messagesArea .ns-quiet-wow{animation:none}}
}
