/* All overrides require the mobile controller. Tablet, desktop and header stay
   on the approved styles; the five existing compact Exploration shells are reused. */
.mobile-agent-viewport[hidden], .mobile-agent-detail-nav[hidden]{display:none!important}
.mobile-card-insight[hidden], .mobile-card-stat[hidden]{display:none!important}
body[data-mobile-cards] .mobile-agent-viewport,
body[data-mobile-cards] #scene .showroom-ui-layer{
  position:absolute!important;inset:auto!important;left:var(--mobile-scene-x)!important;top:var(--mobile-scene-y)!important;
  width:100vw!important;height:100dvh!important;transform:scale(var(--mobile-inverse-scale))!important;transform-origin:0 0!important;
}
body[data-mobile-cards] .mobile-agent-viewport{z-index:80;box-sizing:border-box;height:calc(100dvh - var(--mobile-header-height,88px))!important;overflow:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:none}
body[data-mobile-cards] .mobile-agent-viewport::-webkit-scrollbar{display:none}
body[data-mobile-cards] .agent-card-layer{position:relative!important;inset:auto!important;width:100%;pointer-events:none}
body[data-mobile-cards] .agent-card-shell[hidden]{display:none!important}
body[data-mobile-cards] .agent-card-shell.scene-managed{transform-origin:center!important;pointer-events:auto;touch-action:pan-y;cursor:pointer;--card-inner-offset-x:8px!important;--card-inner-offset-y:8px!important;--card-inner-width:calc(100% - 16px)!important;--card-inner-height:calc(100% - 16px)!important}
body[data-mobile-cards] .agent-card-shell:focus-visible{outline:2px solid #315ce5;outline-offset:4px}
body[data-mobile-cards] .agent-card-shell .exploration-shell{inset:0;border-width:22px;border-image-slice:240 215 235 215 fill}
body[data-mobile-cards] .scene-managed>.agent-card-content{inset:0!important;padding:0!important;display:block!important}
body[data-mobile-cards] .scene-managed .agent-card-title{left:18px!important;right:64px!important;top:17px!important;font-size:15px!important;white-space:normal!important;line-height:1.2!important;max-width:none!important;text-align:left!important}
body[data-mobile-cards] .scene-managed .agent-card-meta-row{display:none!important}
body[data-mobile-cards] .scene-managed .agent-color-source{left:15px!important;top:54px!important;width:82px!important;height:82px!important;transform:none!important;grid-area:auto!important;aspect-ratio:1!important}
body[data-mobile-cards] .scene-managed .agent-card-description{left:110px!important;right:17px!important;top:55px!important;font-size:13px!important;line-height:1.4!important;display:-webkit-box!important;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;max-width:none!important;text-align:left!important}
body[data-mobile-cards] .scene-managed .agent-card-cta{left:auto!important;right:12px!important;top:auto!important;bottom:8px!important;width:44px!important;height:44px!important;min-height:44px!important;font-size:0!important;padding:0!important;display:flex!important;align-items:center;justify-content:center!important;pointer-events:auto!important}
body[data-mobile-cards] .scene-managed .agent-card-cta span{font-size:19px!important}
body[data-mobile-cards] .scene-managed .agent-card-telemetry{top:24%!important;right:11%!important;width:18%!important}
body[data-mobile-cards] .scene-managed[data-mobile-expanded=true] .agent-card-description{-webkit-line-clamp:unset;overflow:visible}
body[data-mobile-cards] .scene-managed[data-mobile-expanded=true] .agent-card-cta{top:auto!important;bottom:8px!important;right:12px!important}
body[data-mobile-cards] .scene-managed[data-mobile-expanded=false] .agent-card-description{-webkit-line-clamp:4}
body[data-mobile-cards] .scene-managed[data-mobile-expanded=true] .agent-card-title{right:18px!important}
/* Expanded showroom copy stays on the existing glass, without another panel. */
body[data-mobile-cards] .mobile-card-insight{position:absolute;left:110px;right:17px;margin:0;font-size:12.5px;line-height:1.4;font-weight:450;color:var(--content-text);text-align:left;text-shadow:0 1px 1px #f5fbffb3}
body[data-mobile-cards] .mobile-card-stat{position:absolute;left:15px;top:144px;width:82px;text-align:center;color:var(--content-text);text-shadow:0 1px 1px #f5fbffb3}
body[data-mobile-cards] .mobile-card-stat strong{display:block;font-size:25px;line-height:1.1;font-weight:650;letter-spacing:-.025em;color:color-mix(in srgb,rgb(var(--agent-secondary)) 38%,#244065)}
body[data-mobile-cards] .mobile-card-stat span{display:block;margin-top:3px;font-size:11px;line-height:1.25}
body[data-mobile-cards] .mobile-card-stat small{display:block;margin-top:4px;font-size:9px;line-height:1.25;color:#496080}
body[data-mobile-cards] .mobile-agent-detail-nav{position:sticky;top:0;z-index:200;display:flex;gap:8px;margin:4px 16px 14px;padding:4px;background:#e7f4ffd9;border:1px solid #fff9;border-radius:14px;backdrop-filter:blur(10px)}
body[data-mobile-cards] .mobile-agent-detail-nav :is(button,select){font:14px system-ui;color:#183d72;min-height:44px;border:1px solid #edf9ff;border-radius:10px;background:#f0f7ff77;padding:6px 10px}
body[data-mobile-cards] .mobile-agent-detail-nav button{width:44px;flex:none}
body[data-mobile-cards] .mobile-agent-detail-nav select{min-width:0;flex:1}
body[data-mobile-cards] .mobile-agent-viewport[data-detail=true] .agent-card-layer{padding:0 0 105px;min-height:100%;box-sizing:border-box}
body[data-mobile-cards] .scene-managed[data-card-mode=active]{position:relative!important;left:auto!important;top:auto!important;margin:0 auto!important;min-height:700px;cursor:default}
body[data-mobile-cards] .scene-managed[data-card-mode=active]>.agent-card-content{position:relative!important;height:235px!important}
body[data-mobile-cards] .scene-managed[data-card-mode=active] .agent-card-title{font-size:20px!important;left:20px!important;right:20px!important;top:22px!important}
body[data-mobile-cards] .scene-managed[data-card-mode=active] .agent-color-source{top:83px!important;width:90px!important;height:90px!important}
body[data-mobile-cards] .scene-managed[data-card-mode=active] .agent-card-description{top:80px!important;left:117px!important;font-size:14px!important;display:block!important}
body[data-mobile-cards] .agent-exploration-content{position:relative!important;inset:auto!important;padding:0 18px 22px;pointer-events:auto}
body[data-mobile-cards] .explore-top{display:none}
body[data-mobile-cards] .explore-tabs{position:static;display:flex;flex-wrap:wrap;height:auto;margin-bottom:16px}
body[data-mobile-cards] .explore-tabs button{flex:1 0 30%;min-height:44px;font-size:13px}
body[data-mobile-cards] .explore-main{position:static;height:auto;max-height:none;overflow:visible;min-height:130px;padding:14px;margin-bottom:16px;font-size:15px}
body[data-mobile-cards] .explore-kpis{position:static;height:auto;display:grid;gap:10px;margin-bottom:16px}
body[data-mobile-cards] .explore-kpis>div{padding:12px;overflow:visible}
body[data-mobile-cards] .explore-kpis span{font-size:14px}
body[data-mobile-cards] .explore-kpis small{font-size:11px}
body[data-mobile-cards] .explore-actions{position:static;height:auto;display:grid;gap:10px}
body[data-mobile-cards] .explore-actions button{min-height:44px}
/* UI remains in the scene: its existing controllers still own the same nodes. */
body[data-mobile-cards] #scene .showroom-ui-layer{z-index:120;pointer-events:none}
body[data-mobile-cards] #scene .showroom-ui-layer>.droid-launcher{left:auto!important;top:auto!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:74px!important;visibility:visible!important;z-index:125!important}
body[data-mobile-cards] #scene .showroom-ui-layer>.glass-chatbox-menu{left:10px!important;right:10px!important;top:var(--mobile-chat-top,8px)!important;bottom:auto!important;width:calc(100% - 20px)!important;height:var(--mobile-chat-height)!important;min-height:0!important;max-height:none!important;box-sizing:border-box;padding:16px!important;transform:none!important;pointer-events:auto!important;display:flex;flex-direction:column;overflow:hidden}
body[data-mobile-cards] #scene .glass-chatbox-menu[hidden]{display:none!important}
body[data-mobile-cards] #scene .glass-chatbox-menu>.neo-lens-mini-logo{flex:none;margin:0 auto 8px!important}
body[data-mobile-cards] #scene .glass-close-control{width:44px!important;height:44px!important;top:8px!important;right:8px!important;z-index:10}
body[data-mobile-cards] .mobile-chat-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
body[data-mobile-cards] #scene .glass-welcome-copy{margin:8px 0 18px!important}
body[data-mobile-cards] #scene .glass-option-list{gap:8px!important;margin:0 0 12px!important}
body[data-mobile-cards] #scene .glass-option-button{min-height:44px!important}
body[data-mobile-cards] #scene .glass-chatbox-menu[data-chat-content-state=conversation] .mobile-chat-body>:is(.glass-welcome-copy,.glass-option-list){display:none!important}
body[data-mobile-cards] #scene .glass-chatbox-menu[data-chat-content-state=conversation] .mobile-chat-body{display:flex;flex-direction:column;overflow:hidden}
body[data-mobile-cards] #scene .glass-chatbox-menu .chat-transcript{overflow:auto}
body[data-mobile-cards] #scene .glass-input-field{flex:none!important;margin:8px 0 0!important;width:100%!important}
body[data-mobile-cards] #scene .glass-input-field textarea{font-size:16px!important}
body[data-mobile-cards] #scene .glass-send-button{width:44px!important;height:44px!important}
@media(prefers-reduced-motion:reduce){body[data-mobile-cards] .agent-card-shell{animation:none!important;transition:none!important}}

/* The red-box reference sets a 28px visible frame inside a 44px touch target. */
body[data-mobile-cards] :is(.scene-managed[data-mobile-expanded],.agent-exploration-content,.mobile-agent-detail-nav) button[data-mobile-action]{
  box-sizing:border-box;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  flex:0 0 44px!important;display:inline-grid!important;place-items:center!important;padding:0!important;gap:0!important;
  font-size:0!important;line-height:0!important;border:0!important;border-radius:7px!important;
  color:#315cd1!important;background:none!important;box-shadow:none!important;
  backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate;cursor:pointer;touch-action:manipulation;
}
body[data-mobile-cards] .explore-actions{display:flex;justify-content:flex-end;gap:12px}
body[data-mobile-cards] .explore-actions button[data-mobile-action],
body[data-mobile-cards] .mobile-agent-detail-nav button[data-mobile-action]{position:relative}
body[data-mobile-cards] button[data-mobile-action] > span{display:none!important}
body[data-mobile-cards] button[data-mobile-action]::before{
  content:"";position:absolute;inset:8px;box-sizing:border-box;border-radius:7px;padding:0;pointer-events:none;
  border:1px solid #f4fcffdc;background:radial-gradient(ellipse at 22% 8%,#ffffffa3,transparent 58%),linear-gradient(135deg,#d8efff82,#d6dcff40 55%,#ccc2fa59);
  box-shadow:inset 0 1px 1px #fff,inset 0 -1px 2px #536cbd33,0 1px 4px #526dba33;
  -webkit-mask:none;mask:none;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
}
body[data-mobile-cards] button[data-mobile-action]::after{
  content:"";position:absolute;inset:14px;width:16px;height:16px;pointer-events:none;
  background:linear-gradient(135deg,#1758c5,#6151c1);-webkit-mask:var(--mobile-action-art) center/contain no-repeat;mask:var(--mobile-action-art) center/contain no-repeat;
}
body[data-mobile-cards] button[data-mobile-action=expand]{--mobile-action-art:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E")}
body[data-mobile-cards] button[data-mobile-action=explore]{--mobile-action-art:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M7 7h10v10'/%3E%3C/svg%3E")}
body[data-mobile-cards] button[data-mobile-action=scenario]{--mobile-action-art:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m8 4 12 8-12 8Z'/%3E%3C/svg%3E")}
body[data-mobile-cards] button[data-mobile-action=cases]{--mobile-action-art:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E")}
body[data-mobile-cards] button[data-mobile-action=back]{--mobile-action-art:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12H4m7-7-7 7 7 7'/%3E%3C/svg%3E")}
body[data-mobile-cards] button[data-mobile-action]:focus-visible{outline:none!important}
body[data-mobile-cards] button[data-mobile-action]:focus-visible::before{outline:2px solid #315cd1;outline-offset:3px}
body[data-mobile-cards] button[data-mobile-action]:active::before{background:linear-gradient(135deg,#c3e5ffa3,#d9d0fa99)}
