/* Route-scoped outer shell. Preserve the accepted Dialogs width and gutters. */
body.agent224-route #root .app-shell{box-sizing:border-box;width:min(100%,520px);min-width:0;margin:0 auto;padding:calc(12px + var(--reynard-top277,env(safe-area-inset-top,0px))) 18px calc(100px + env(safe-area-inset-bottom,0px));background:#000}
body.agent224-route #root .app-shell>.topbar,body.agent224-route #root .app-shell .inline-back{display:none}
body.agent224-route #root .app-shell>.view-panel{min-width:0;margin:0;padding:0;border:0;border-radius:0;background:#000;box-shadow:none}
@media(max-width:360px){body.agent224-route #root .app-shell{padding-left:14px;padding-right:14px}}
/* The existing Memory modal retains its route, inert boundary and scroll host. */
.reynard-memory182{padding:0;background:#000;color:#fff;font:16px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}

/* Fullscreen bounds include device and Telegram controls; other routes also stay readable. */
html[data-reynard-fullscreen277=true] #root .app-shell{padding-top:calc(12px + var(--reynard-top277,0px));padding-bottom:calc(100px + var(--reynard-bottom277,0px));padding-left:max(18px,var(--reynard-left277,0px));padding-right:max(18px,var(--reynard-right277,0px))}
html[data-reynard-fullscreen277=true] #root .bottom-nav{bottom:calc(12px + var(--reynard-bottom277,0px));left:max(14px,calc(50vw - 246px),var(--reynard-left277,0px));right:max(14px,calc(50vw - 246px),var(--reynard-right277,0px))}

@media(max-width:380px){html[data-reynard-fullscreen277=true] #root .bottom-nav{left:max(8px,var(--reynard-left277,0px));right:max(8px,var(--reynard-right277,0px))}}
@media(max-width:360px){html[data-reynard-fullscreen277=true] #root .app-shell{padding-left:max(14px,var(--reynard-left277,0px));padding-right:max(14px,var(--reynard-right277,0px))}}
html[data-reynard-fullscreen277=true] .reynard-tariffs-page176{padding-top:var(--reynard-top277,0px)}
html[data-reynard-fullscreen277=true] .reynard-tariffs-content176{padding-bottom:calc(112px + var(--reynard-bottom277,0px))}

/* Stage278: keep a permanent refresh lane only on the seven Agent pages. */
html[data-reynard-fullscreen277=true] body.agent224-route #root .app-shell{padding-top:calc(12px + var(--reynard-top277,0px))}
#root .app-shell{padding-bottom:calc(140px + var(--reynard-bottom277,env(safe-area-inset-bottom,0px)))}
/* Four equal navigation targets; a single shared pill slides between them. */
#root .bottom-nav[data-nav278]{grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:10px 8px;min-height:98px;border:1px solid #b9470e;border-radius:28px;background:#000;color:#fff;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;isolation:isolate}
#root .bottom-nav[data-nav278]::before{content:'';position:absolute;top:10px;bottom:10px;left:8px;width:calc((100% - 16px)/4);border:1px solid #b9470e;border-radius:20px;box-sizing:border-box;background:#32170d;z-index:0;pointer-events:none;transform:translateX(0);transition:transform .36s cubic-bezier(.22,1,.36,1)}
#root .bottom-nav[data-nav-active278='1']::before{transform:translateX(100%)}
#root .bottom-nav[data-nav-active278='2']::before{transform:translateX(200%)}
#root .bottom-nav[data-nav-active278='3']::before{transform:translateX(300%)}
#root .bottom-nav[data-nav278] button{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:76px;margin:0;padding:8px 2px;border:0;border-radius:20px;background:transparent!important;color:#a9a9af;font:600 12px/1.2 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;-webkit-tap-highlight-color:transparent}
#root .bottom-nav[data-nav278] button small{font-size:12px;line-height:1.2;font-weight:600;white-space:nowrap;color:inherit}
#root .bottom-nav[data-nav278] button[data-nav-selected278=true]{color:#fff}
#root .bottom-nav[data-nav278] button .nav-icon278{display:grid;place-items:center;flex:none;width:32px;height:32px;font-size:32px;line-height:1;font-weight:400;color:#fff}
#root .bottom-nav[data-nav278] button .nav-icon278 svg{display:block;width:32px;height:32px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#root .bottom-nav[data-nav278] button[data-nav-item278=assistant] .nav-icon278{color:#ff701d}
#root .bottom-nav[data-nav278] button[data-reynard-tariffs176]>span{display:grid;place-items:center;width:32px;height:32px;font-size:17px;line-height:1;font-weight:800}
#root .bottom-nav[data-nav278] button:focus-visible{outline:2px solid #ff701d;outline-offset:-3px}
@media(prefers-reduced-motion:reduce){#root .bottom-nav[data-nav278]::before{transition:none}}

/* Stage279: one physical footer above the Memory page too. */
html.reynard-memory-open182 #root .bottom-nav{z-index:100}
#root .bottom-nav[data-nav278]{min-height:86px}
#root .bottom-nav[data-nav278] button{min-height:64px;padding:6px 2px;gap:4px}

/* Stage280: preserve the existing width/position, reduce only vertical bulk. */
#root .bottom-nav[data-nav278]{min-height:76px;padding:6px 8px}
#root .bottom-nav[data-nav278]::before{top:6px;bottom:6px}
#root .bottom-nav[data-nav278] button{min-height:62px;padding:4px 2px;gap:3px}
/* Native buttons remain above this webview. Content scrolls behind a black mask. */
html[data-reynard-fullscreen277=true] body::before{content:'';display:block;position:fixed;inset:0 0 auto;height:var(--reynard-top277,0px);z-index:1000;background:#000;pointer-events:auto;touch-action:pan-y}
html{scroll-padding-top:calc(12px + var(--reynard-top277,0px))}

/* Stage284: preserve the accepted four-item navigation dimensions and location. */
html{scroll-padding-bottom:calc(112px + var(--reynard-bottom277,env(safe-area-inset-bottom,0px)))}
html.reynard-memory-open182 .reynard-memory182{scroll-padding-bottom:calc(112px + var(--reynard-bottom277,env(safe-area-inset-bottom,0px)))}

/* Stage310: a solid black, patterned continuation below the same navigation
   midpoint as Tariffs. Keep document scrolling and all nested screen returns. */
html[data-agent-bounds310=true],html[data-agent-bounds310=true] body{background:#000!important}
.agent-floor310{position:fixed;inset:0;z-index:99;overflow:hidden;background:#000;clip-path:inset(calc(100% - var(--agent-floor310,56px)) 0 0);pointer-events:auto;touch-action:pan-y}
.agent-floor-pattern310{position:absolute;inset:0;background-size:84px 84px;background-repeat:repeat;opacity:.075;pointer-events:none}
html[data-agent-bounds310=true] #root .bottom-nav{z-index:100}

/* Stage311: the native-controls safe area stays fully opaque black, with the
   same viewport-aligned wallpaper and 7.5% white detail as the Tariffs canvas.
   The opaque base still hides scrolling text behind Telegram's controls. */
html[data-reynard-fullscreen277=true][data-agent-bounds310=true] body::before{
 background-color:#000;
 background-image:linear-gradient(rgba(0,0,0,.925),rgba(0,0,0,.925)),var(--agent-wallpaper311);
 background-size:auto,84px 84px;
 background-repeat:repeat;
}

/* Free Chat uses the same chrome. Leave room for the editor when the software
   keyboard reduces the visual viewport, retaining the native-control top mask. */
html[data-chat-keyboard314=true] #root .bottom-nav{visibility:hidden;pointer-events:none}
html[data-chat-keyboard314=true] .agent-floor310{display:none}
html[data-chat-keyboard314=true] body.agent224-route #root .app-shell{padding-bottom:24px}
