/* Wallet first through 768px. Desktop continues to use the existing grid. */
.mobile-agent-network,.assistant-fab,.assistant-hint,.mobile-assistant-close,.mobile-assistant-title,.mobile-wallet-title{display:none}
.assistant-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.assistant-unread-dot{display:none}
.receive-sheet{width:min(440px,calc(100vw - 32px));padding:28px;border:1px solid var(--line);border-radius:24px;background:var(--surface-panel);color:var(--text);max-height:calc(100dvh - 32px);overflow:auto}
.receive-sheet::backdrop{background:#0008;backdrop-filter:blur(6px)}
.receive-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.receive-head h2{margin:0;font-size:24px;font-weight:500}
.receive-head button{width:44px;height:44px;border-radius:50%;font-size:24px}
.receive-sheet p{color:var(--text-secondary);font-size:13px;line-height:1.6}
.receive-sheet code{display:block;padding:18px 0;overflow-wrap:anywhere;font-size:14px;line-height:1.8;color:var(--text)}
.receive-copy{width:100%;padding:15px;border-radius:12px;background:var(--button-primary);color:var(--on-primary);margin-top:14px}
@media(max-width:768px),(max-width:1024px) and (max-height:600px) and (pointer:coarse){
 /* iOS can pan an overflow:hidden document when its keyboard opens. Lock the
    root as well, and leave only the chat/textarea as scrollable surfaces. */
 html.assistant-page-locked,html.assistant-page-locked body{position:fixed;inset:0;width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;background:var(--surface-canvas)}
 html.assistant-page-locked body{top:0!important}
 #agentApp.assistant-open{position:fixed;inset:0;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
 /* inert prevents interaction, but does not prevent the wallet being painted
    through Safari's translucent keyboard accessory/safe-area strip. */
 #agentApp.assistant-open #accountWalletPanel{visibility:hidden;pointer-events:none}
 #agentApp.assistant-open::after{content:"";position:fixed;inset:0;z-index:59;background:var(--surface-canvas);pointer-events:none}
 body:has(#agentApp:not([hidden])){overflow:hidden}
 #agentApp{display:block;height:100dvh;min-height:0;overflow:hidden;background:var(--surface-canvas)}
 #agentApp #accountWalletPanel{display:block;width:100%;height:calc(100dvh - 96px - env(safe-area-inset-bottom));max-height:calc(100dvh - 96px - env(safe-area-inset-bottom));min-height:0;overflow-y:auto;overscroll-behavior:contain;border:0;background:var(--surface-canvas);padding:calc(18px + env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) 22px max(22px,env(safe-area-inset-left))}
 #livePortfolio{min-height:0;margin:0}
 .desktop-wallet-title{display:none}.mobile-wallet-title{display:inline;font-size:21px;letter-spacing:4px;font-weight:600}
 #livePortfolio .wallet-header{min-height:44px;margin-bottom:12px}
 #livePortfolio .wallet-profile{width:44px;height:44px;border-radius:50%;padding:11px}
 #livePortfolio .wallet-address-copy{margin-top:0;min-height:36px;font-size:12px;align-self:flex-start}
 #livePortfolio .balance-label{margin-top:30px;font-size:10px;letter-spacing:1.8px}
 #livePortfolio .balance-label button{min-width:32px;min-height:32px}
 #livePortfolio .live-total{font-size:clamp(42px,12vw,58px);line-height:1.12;margin-top:8px;letter-spacing:-2.5px;overflow-wrap:anywhere}
 #livePortfolio .balance-note{min-height:32px;align-items:center;margin-top:10px;gap:12px}
 #livePortfolio .balance-note>span{font:11px 'DM Sans',sans-serif;line-height:1.5}
 #livePortfolio .wallet-actions{margin:26px 0 30px;gap:12px}
 #livePortfolio .wallet-actions button{font-size:12px;gap:10px;padding:0}
 #livePortfolio .wallet-actions button>span{height:56px;padding:15px;border:0;border-radius:18px;background:var(--surface-hover);display:grid;place-items:center}
 #livePortfolio .wallet-actions .icon{width:24px;height:24px}
 #livePortfolio button:disabled{cursor:default;opacity:.38}
 #livePortfolio .wallet-tabs{gap:26px}
 #livePortfolio .wallet-tabs button{font-size:14px;min-height:44px}
 #livePortfolio .live-asset{padding:21px 0;gap:13px}
 #livePortfolio .token-avatar{width:40px;height:40px;flex-shrink:0}
 #livePortfolio .live-asset-info>span{max-width:none;font-size:14px}
 #livePortfolio .live-asset-info small{max-width:none;font-size:11px;line-height:1.5}
 #livePortfolio .asset-chain{font-size:10px;margin-top:6px}
 #livePortfolio .asset-value{font-size:14px;max-width:32%;flex-shrink:0}
 #livePortfolio .asset-value small{font-size:10px}
 #livePortfolio .last-updated{font-size:10px}
 .assistant-fab{display:grid;place-items:center;position:fixed;z-index:40;right:calc(20px + env(safe-area-inset-right));bottom:calc(20px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:50%;background:#07110b;border:1px solid #41654e;box-shadow:0 0 16px #86e8b026,0 5px 16px #0005;animation:assistant-glow 1.8s ease-in-out 1;transition:transform .18s ease}
 .assistant-fab:hover{background:#0d1e14}
 .assistant-fab:active{transform:scale(.94)}
 .assistant-fab:focus-visible{outline:2px solid #a2edc8;outline-offset:4px}
 .assistant-fab.is-responding{animation-duration:2.5s}
 .assistant-fab.has-unread .assistant-unread-dot{display:block;position:absolute;right:1px;top:1px;width:10px;height:10px;border:2px solid #07110b;border-radius:50%;background:#a2edc8}
 .assistant-hint{display:flex;align-items:center;justify-content:center;position:fixed;z-index:39;right:calc(88px + env(safe-area-inset-right));bottom:calc(26px + env(safe-area-inset-bottom));max-width:calc(100vw - 108px - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:44px;padding:10px 16px;border:1px solid #365b46;border-radius:16px;background:#0a1912ed;color:#d7efdf;font:500 12px/1.4 'DM Sans',sans-serif;box-shadow:0 4px 18px #0003;backdrop-filter:blur(12px);cursor:pointer;animation:assistant-hint-in .3s ease-out both}
 .assistant-hint::after{content:"";position:absolute;right:-5px;top:calc(50% - 5px);width:8px;height:8px;transform:rotate(45deg);background:#0a1912;border-top:1px solid #365b46;border-right:1px solid #365b46}
 .assistant-hint:hover{background:#12281c;color:#eafff1}.assistant-hint:focus-visible{outline:2px solid #a2edc8;outline-offset:4px}
 body:has(dialog[open]) .assistant-fab,body:has(dialog[open]) .assistant-hint{display:none}
 .assistant-fab img{width:28px;height:32px}
 #agentApp.assistant-open .assistant-fab{visibility:hidden}
 #agentApp>main#assistantPanel{position:fixed;inset:var(--assistant-top,0px) 0 auto;z-index:60;display:flex;width:100%;height:var(--assistant-height,100dvh);min-height:0;flex-direction:column;padding:0;overflow:hidden;visibility:hidden;opacity:0;transform:translateY(22px);pointer-events:none;background:var(--surface-canvas);transition:transform .2s ease,opacity .2s ease,visibility .2s}
 #agentApp.assistant-open>main#assistantPanel{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto}
 #agentApp>#assistantPanel>header{position:relative;inset:auto;height:calc(56px + env(safe-area-inset-top));min-height:calc(56px + env(safe-area-inset-top));flex:0 0 auto;padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));gap:4px;z-index:3;background:var(--surface-panel);border-bottom:1px solid var(--line)}
 .desktop-assistant-title,#assistantPanel #mobileAccount{display:none}
 .mobile-assistant-title{display:inline;font-size:13px;line-height:1.2;letter-spacing:0;font-weight:500}
 #assistantPanel>header>div{flex:1;min-width:0;justify-content:space-between;flex-direction:row-reverse}
 #assistantPanel .agent-title{min-width:0;letter-spacing:0}
 #assistantPanel #toggleChats{width:32px;min-width:32px;height:40px;padding:5px;flex-shrink:0}
 #assistantPanel>header>.mobile-agent-network{display:block;flex:0 0 auto}
 #mobileAgentNetworkRoot .network-trigger{gap:4px;padding:5px;border-color:var(--line);background:var(--surface-raised)}
 #mobileAgentNetworkRoot .network-badge{width:20px;height:20px;flex-shrink:0}
 #mobileAgentNetworkRoot .network-trigger strong{font-size:11px}
 #mobileAgentNetworkRoot .network-menu{bottom:auto;top:calc(100% + 8px);left:auto;right:0;max-width:calc(100vw - 24px)}
 #assistantPanel .mobile-assistant-close{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;flex-shrink:0}
 .mobile-assistant-close svg{width:22px;height:22px}
 #assistantPanel #chat{min-height:0;flex:1 1 auto;overflow-anchor:none;overflow-y:auto;scroll-behavior:auto;overscroll-behavior:contain;padding:22px 18px}
 #assistantPanel #chat.fresh-chat #messages{padding-top:35px}
 #assistantPanel .composer-wrap{flex:0 0 auto;padding:6px max(10px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:var(--surface-canvas)}
 #assistantPanel.keyboard-open .composer-wrap{padding-bottom:6px}
 #assistantPanel #composer{border-radius:18px;padding:5px 8px;min-height:56px;box-shadow:none}
 #assistantPanel .composer-input-row{min-height:44px;gap:6px;align-items:flex-end}
 #assistantPanel #composer .composer-bottom{display:none}
 #assistantPanel #composer .attach-image,#assistantPanel #composer .send-button{width:40px;height:44px;flex-shrink:0}
 #assistantPanel #composer .send-button{border-radius:12px;font-size:26px}
 #assistantPanel #prompt{min-height:24px;max-height:96px;line-height:24px;font-size:16px;padding:0;margin:10px 0;overscroll-behavior:contain}
 #assistantPanel .attachment-preview{margin:0 0 6px 46px;max-height:64px}
 #assistantPanel .attachment-preview img{max-height:60px}
 #assistantPanel .chat-error{margin:0 0 6px;padding:8px;font-size:12px}
 #assistantPanel .hero-art{opacity:.45}
 .receive-sheet{padding:24px;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
}
@keyframes assistant-hint-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@keyframes assistant-glow{50%{box-shadow:0 0 20px #86e8b038,0 5px 16px #0005}}
@media(prefers-reduced-motion:reduce){.assistant-fab,.assistant-hint{animation:none;transition:none}#agentApp>main#assistantPanel{transition:none}}
