/* Keep both canvases inside the same isolated scene stacking context. */
.ghost-screen.test-ready{isolation:isolate;background:#08060e!important}
.ghost-screen #aurora-background{position:fixed;inset:0;z-index:0;background:#08060e;pointer-events:none;display:block!important}
#aurora-background>.aurora-container{position:absolute;inset:0;width:100%;height:100%}
.test-background{position:fixed;inset:0;pointer-events:none;z-index:1;background:transparent!important}
.test-background canvas{width:100%;height:100%;display:block;background:transparent!important}
.ghost-screen .ghost-bg{display:none!important}
.test-ready .ghost-fit{position:relative;z-index:2}

.robot-bubble{position:fixed;z-index:1;pointer-events:none;transform:translate(-50%,-100%) scale(.96);opacity:0;transition:opacity .3s,transform .3s;display:flex;align-items:center;gap:12px;width:max-content;max-width:min(300px,calc(100vw - 32px));padding:14px 18px;box-sizing:border-box;border:1px solid #c9b9ff3d;border-radius:22px;background:#151021e8;box-shadow:0 8px 32px #0004;backdrop-filter:blur(14px);color:#f6f1ff;font:500 14px/1.5 system-ui;text-align:left}
.robot-bubble.shown{opacity:1;transform:translate(-50%,-100%) scale(1)}
.robot-sticker{font-size:32px;flex-shrink:0}
@media(prefers-reduced-motion:reduce){.robot-bubble{transition:none}}

/* Lightweight glass: one backdrop per surface, static rim highlights, no SVG displacement. */
.ghost-screen #aurora-background{bottom:auto;height:64vh;min-height:240px;overflow:hidden}
#aurora-background>.aurora-container{top:-12%;height:100%;bottom:auto}
.test-ready :is(.token-pill,.message-card,.side-panel,.spend-card,.modal-card),
.sq-dialog,
.test-ready .robot-bubble,
.test-ready .cabinet-pill-scroller .pill-nav[data-layout=joined]{
 background:linear-gradient(135deg,rgba(255,255,255,.15),rgba(219,221,255,.035) 40%,rgba(139,109,194,.10)),rgba(14,13,27,.48)!important;
 border:1px solid rgba(231,231,255,.30)!important;
 box-shadow:inset 0 1px 0 rgba(255,255,255,.48),inset 1px 0 0 rgba(255,255,255,.12),inset 0 -1px 0 rgba(134,120,216,.24),0 12px 30px rgba(0,0,0,.20)!important;
 -webkit-backdrop-filter:blur(12px) saturate(1.35);
 backdrop-filter:blur(12px) saturate(1.35);
 color:#faf8ff;
}
.test-ready .robot-bubble{background:linear-gradient(125deg,#ffffff24,#d6baff08 50%,#acbfff15),#17132566!important}
.test-ready .cabinet-pill-scroller .pill-nav{--pn-surface:transparent;--pn-blur:none;--pn-text:#f0ecfa;--pn-strong:#fff}
.test-ready .cabinet-pill-scroller .pill-nav__surface:not(.pill-nav){background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none}
.test-ready :is(.message-card,.side-panel,.spend-card,.modal-card){background-color:rgba(15,14,29,.65)!important}
.sq-dialog{background-color:rgba(15,14,29,.70)!important}
.sq-dialog::backdrop{background:#06050d66;backdrop-filter:none;-webkit-backdrop-filter:none}
.modal-overlay{background:#06050d66}
.test-ready :is(.message-card,.side-panel,.spend-card) :is(input,textarea,select){background-color:#10101f66}
.test-ready .pill-nav__item:focus-visible{outline:2px solid #e4d7ff;outline-offset:-3px}
@media(max-width:700px){
 .test-ready :is(.token-pill,.message-card,.side-panel,.spend-card,.modal-card,.robot-bubble),
 .sq-dialog,.test-ready .cabinet-pill-scroller .pill-nav[data-layout=joined]{
  backdrop-filter:blur(7px) saturate(1.2);-webkit-backdrop-filter:blur(7px) saturate(1.2);
 }
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 .test-ready :is(.token-pill,.message-card,.side-panel,.spend-card,.modal-card,.robot-bubble),
 .sq-dialog,.test-ready .cabinet-pill-scroller .pill-nav[data-layout=joined]{background-color:#181526eb!important}
}

/* Bottom-only rise: fade its upper edge around the robot's ground level (77vh).
   Robot movement and glass surfaces are independent of this background. */
.ghost-screen #aurora-background.ascii-rise-background{
 top:auto;bottom:0;height:48vh;min-height:0;overflow:hidden;background:transparent;
 -webkit-mask-image:linear-gradient(to bottom,transparent 0%,transparent 28%,#000 58%,#000 100%);
 mask-image:linear-gradient(to bottom,transparent 0%,transparent 28%,#000 58%,#000 100%);
}
#aurora-background.ascii-rise-background>.gradient-ascii-container{
 position:absolute;inset:0;width:100%;height:100%;
}

/* Solid upper controls; preserve glass on opened windows and helper bubbles. */
.test-ready .token-pill{
 background:#050507!important;border:1px solid #ffffff14!important;
 box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
.test-ready .cabinet-pill-scroller .pill-nav[data-layout=joined]{
 background:#09090e!important;border:1px solid #cdc0dd30!important;
 box-shadow:0 8px 24px #00000038!important;
 backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
/* Lift the wave from ~84vh to ~74vh: robot contact is at 77vh. */
.ghost-screen #aurora-background.ascii-rise-background{
 height:76vh;
 -webkit-mask-image:linear-gradient(to bottom,transparent 0%,transparent 28%,#000 58%,#000 100%);
 mask-image:linear-gradient(to bottom,transparent 0%,transparent 28%,#000 58%,#000 100%);
}

/* Dark translucent windows: restrained blur without the bright glass coating. */
.test-ready :is(.message-card,.side-panel,.spend-card,.modal-card),
.sq-dialog{
 background:rgba(5,5,8,.88)!important;
 border:1px solid rgba(255,255,255,.14)!important;
 box-shadow:0 16px 40px rgba(0,0,0,.30),inset 0 1px 0 rgba(255,255,255,.035)!important;
 backdrop-filter:blur(8px)!important;
 -webkit-backdrop-filter:blur(8px)!important;
}
@media(max-width:700px){
 .test-ready :is(.message-card,.side-panel,.spend-card,.modal-card),.sq-dialog{
  backdrop-filter:blur(5px)!important;-webkit-backdrop-filter:blur(5px)!important;
 }
}
html,body,.ghost-screen.test-ready{background:#000!important} .ghost-screen #aurora-background{display:none!important}

/* Aero Shards replaces the pure-black / bottom-wave background. */
.ghost-screen #aurora-background.aero-background{
 display:block!important;position:fixed;inset:0;height:100vh;min-height:0;
 background:#e4e4e7;mask-image:none;-webkit-mask-image:none;overflow:hidden;
}
#aurora-background.aero-background>.aero-shards{position:absolute;inset:0;width:100%;height:100%}

/* Explicit stack: letters behind the transparent character canvas, UI above both. */
.ghost-screen #aurora-background.letter-background{
 display:block!important;position:fixed;inset:0;height:100vh;min-height:0;
 z-index:0;background:#000;mask-image:none;-webkit-mask-image:none;overflow:hidden;pointer-events:none;
}
#aurora-background.letter-background>.letter-glitch{position:absolute;inset:0;width:100%;height:100%}
.ghost-screen .test-background{z-index:1}
.ghost-screen .ghost-fit{z-index:2}

.ghost-screen #aurora-background.ferrofluid-background{
 display:block!important;position:fixed;inset:0;height:100vh;min-height:0;z-index:0;
 background:#000;mask-image:none;-webkit-mask-image:none;overflow:hidden;pointer-events:none;
}
#aurora-background.ferrofluid-background>.ferrofluid-container{position:absolute;inset:0;width:100%;height:100%}

/* Keep the effect on the left; the character's side stays completely black. */
.ghost-screen #aurora-background.ferrofluid-background{
 right:auto;width:65vw;
 -webkit-mask-image:linear-gradient(to right,#000 0%,#000 45%,transparent 100%);
 mask-image:linear-gradient(to right,#000 0%,#000 45%,transparent 100%);
}
@media(max-width:700px){
 .ghost-screen #aurora-background.ferrofluid-background{width:48vw}
}

/* Graphite/chrome speech panel paired with the character's black metal finish. */
.test-ready .robot-bubble{
 background:linear-gradient(145deg,rgba(255,255,255,.10),transparent 36%),rgba(8,9,11,.92)!important;
 border:1px solid rgba(210,216,223,.32)!important;
 border-radius:17px;
 box-shadow:inset 0 1px 0 #ffffff38,inset 0 -1px 0 #ffffff08,0 10px 25px #0008!important;
 backdrop-filter:blur(6px)!important;-webkit-backdrop-filter:blur(6px)!important;
 color:#e9edf1;font-weight:500;letter-spacing:.005em;padding:14px 17px;gap:11px;
}
.test-ready .robot-bubble::after{
 content:"";position:absolute;right:-6px;top:55%;width:10px;height:10px;
 background:#111215;border-top:1px solid #d2d8df52;border-right:1px solid #d2d8df52;
 transform:rotate(45deg);
}
.test-ready .robot-sticker{
 font-size:26px;display:grid;place-items:center;min-width:38px;height:38px;
 border-radius:11px;background:linear-gradient(145deg,#ffffff13,#ffffff04);
 box-shadow:inset 0 1px 0 #ffffff15;flex-shrink:0;
}



/* Neutral black surfaces, without blue/purple tint. */
.test-ready :is(.token-pill,.message-card,.side-panel,.spend-card,.modal-card,.robot-bubble),
.sq-dialog,
.test-ready .cabinet-pill-scroller .pill-nav[data-layout=joined]{
 background:rgba(0,0,0,.94)!important;
 border-color:rgba(255,255,255,.16)!important;
 box-shadow:0 12px 30px #0006,inset 0 1px 0 #ffffff08!important;
 color:#eee;
}
.test-ready .robot-bubble::after{background:#080808;border-color:#ffffff30}
.test-ready :is(.message-card,.side-panel,.spend-card,.modal-card,.sq-dialog) :is(input,textarea,select){background:#080808!important;border-color:#ffffff24!important}
.test-ready *{scrollbar-color:#444 #080808}
.test-ready *::-webkit-scrollbar-track{background:#080808!important}
.test-ready *::-webkit-scrollbar-thumb{background:#444!important;border-color:#080808!important}
.test-ready *::-webkit-scrollbar-button{background-color:#080808!important;color:#888}

/* Speech tail points down toward the character's head. */
.test-ready .robot-bubble::after{
 right:20px;top:auto;bottom:-7px;
 width:12px;height:12px;
 background:#080808;
 border-top:0;border-right:1px solid #ffffff29;
 border-bottom:1px solid #ffffff29;
 transform:skew(18deg) rotate(45deg);
}

/* Mobile layout: comfortable targets and a full-height section sheet. */
@media(max-width:700px){
 .test-ready .token-pill{padding:14px 26px 12px}
 .test-ready .token-actions{gap:8px}
 .test-ready .token-transfer{min-height:42px;background:#080808;border-color:#ffffff26}
 .test-ready .cabinet-pill-scroller{margin-top:10px}
 .test-ready .robot-bubble{max-width:260px;font-size:12px;padding:12px;gap:9px}
 .test-ready .robot-sticker{min-width:30px;height:30px;font-size:23px}
 .ghost-screen.test-ready>.side-panel,
 .ghost-screen.test-ready>.message-card{
  position:fixed!important;inset:12px 8px 100px!important;
  width:auto!important;height:auto!important;transform:none!important;
  max-height:none!important;border-radius:22px;z-index:60!important;
  background:rgba(0,0,0,.98)!important;
 }
 .ghost-screen.test-ready>.side-panel.is-collapsed,
 .ghost-screen.test-ready>.message-card.is-collapsed{
  top:auto!important;bottom:100px!important;height:auto!important;max-height:150px!important;
 }
 .ghost-screen.test-ready .side-panel__head{
  padding:16px;min-height:88px;gap:12px;cursor:default;touch-action:pan-y;
 }
 .test-ready .side-panel__head h2{font-size:21px}
 .test-ready .float-actions{width:100%;justify-content:flex-end;gap:8px}
 .test-ready .float-actions button{min-height:36px;padding:8px 10px;font-size:10px;background:#151515;border-radius:8px}
 .test-ready .side-panel__scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 16px 20px}
 .test-ready .panel-resize{display:none}
 .test-ready .screen-debug{display:none}
}

/* Apply before the asynchronous scene has loaded. */
.ghost-screen{background:#000!important;isolation:isolate}
.ghost-screen .ghost-fit{position:relative;z-index:2}


/* Chrome speech bubble, anchored to the projected face. */
.ghost-screen.test-ready .robot-bubble{
 transform:none!important;max-width:calc(100vw - 24px);padding:20px 24px;gap:18px;
 border:1px solid #ffffff85!important;border-radius:28px;
 background:linear-gradient(135deg,#151718,#030404 45%,#0b0c0d)!important;
 box-shadow:inset 0 1px 1px #ffffff80,inset 0 -1px 1px #ffffff30,0 0 14px #ffffff18,0 12px 30px #0009!important;
 font:400 clamp(13px,1.05vw,18px)/1.45 system-ui;color:#c9c9c9;
 backdrop-filter:none;transition:opacity .25s;
}
.ghost-screen.test-ready .robot-bubble strong{color:#fff;font-weight:700}
.ghost-screen.test-ready .robot-sticker{
 width:56px;min-width:56px;height:58px;display:grid;place-items:center;border-radius:16px;
 font-size:34px;background:radial-gradient(ellipse at top,#ffffff18,#0a0b0c 80%);
 border:1px solid #ffffff38;box-shadow:inset 0 1px 0 #ffffff25;
}
.ghost-screen.test-ready .robot-bubble::after{
 right:var(--tail-right,25px);bottom:-13px;top:auto;width:21px;height:23px;
 background:#080909;border:0;border-right:1px solid #ffffff85;border-bottom:1px solid #ffffff85;
 transform:skewY(38deg);box-shadow:3px 3px 5px #ffffff10;
}
@media(max-width:700px){
 .ghost-screen.test-ready .robot-bubble{padding:12px 14px;gap:10px;border-radius:20px;font-size:12px}
 .ghost-screen.test-ready .robot-sticker{width:36px;min-width:36px;height:40px;font-size:25px;border-radius:12px}
}

/* Compact speech card. */
.ghost-screen.test-ready .robot-bubble{
 padding:13px 16px;gap:12px;border-radius:21px;font-size:13px;line-height:1.45;
}
.ghost-screen.test-ready .robot-sticker{
 width:38px;min-width:38px;height:42px;border-radius:12px;font-size:26px;
}
@media(max-width:700px){
 .ghost-screen.test-ready .robot-bubble{padding:10px 12px;gap:9px;font-size:12px}
 .ghost-screen.test-ready .robot-sticker{width:30px;min-width:30px;height:34px;font-size:22px}
}

/* Provider status must not reflow the balance, buttons or robot anchor. */
.ghost-screen .token-hero>.account-status{
 position:absolute!important;left:50%;top:calc(100% + 12px);bottom:auto;right:auto;transform:translateX(-50%);
 width:max-content;max-width:min(340px,calc(100vw - 32px));margin:0!important;
 padding:10px 12px;box-sizing:border-box;z-index:80;
 border:1px solid #ffffff26;border-radius:12px;background:#080808ed;
 color:#bbb;font:400 12px/1.4 system-ui;text-align:left;
 pointer-events:none;animation:account-status-reveal .2s ease 4s both;
}
@keyframes account-status-reveal{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){
 .ghost-screen .token-hero>.account-status{animation-duration:.001s}
}

.prompt-folder .folder-float { margin-top: 140px !important; }

.prompt-folder:has(.folder-float__trigger[aria-label^='Изображения']) .folder-float__label { max-width: 105px; font-size: 11px; line-height: 1.15; }
