/* The credit remains at the real page end; its cameo is an anchored overlay. */
#ar-cyber-page-footer,#ar-agandar-trigger{display:none}
body.ar-cyber #ar-cyber-page-footer{display:flex;position:relative;z-index:7;flex-direction:column;align-items:center;gap:8px;box-sizing:border-box;width:min(760px,calc(100% - 32px));min-width:0;max-width:100%;margin:28px auto 24px;padding:12px 0 max(8px,env(safe-area-inset-bottom,0px));isolation:isolate}
body.ar-cyber #ar-agandar-trigger{display:block;position:static;flex:0 1 auto;min-height:44px;min-width:44px;max-width:100%;padding:0 2px;border:0;border-radius:2px;background:transparent;box-shadow:none;color:var(--cyber-bright,#e8e9eb);font:600 8px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.16em;text-align:left;text-shadow:0 0 7px var(--cyber-glow);opacity:.78;cursor:pointer;overflow-wrap:anywhere;white-space:normal}
body.ar-cyber #ar-agandar-trigger:hover{opacity:1}
body.ar-cyber #ar-agandar-trigger:focus-visible{outline:2px solid var(--cyber-bright,#eee);outline-offset:3px;opacity:1}
body #ar-agandar-guest:not([hidden]){display:block;position:fixed;z-index:70;box-sizing:border-box;width:164px;max-width:calc(100vw - 16px);margin:0;border:0;padding:0;pointer-events:none;isolation:isolate}
#ar-agandar-trigger .ar-agandar-name{white-space:nowrap}
#ar-agandar-guest[hidden]{display:none!important}
#ar-agandar-guest .ar-agandar-stage{display:block;position:relative;overflow:hidden;box-sizing:border-box;width:100%;height:100%;aspect-ratio:1;pointer-events:auto;touch-action:none;cursor:grab;border:0;margin:0;padding:0;background:transparent;box-shadow:none}
#ar-agandar-guest .ar-agandar-pose,#ar-agandar-guest .ar-agandar-base,#ar-agandar-guest .ar-agandar-motion{position:absolute;inset:0;overflow:hidden;pointer-events:none}
#ar-agandar-guest .ar-agandar-pose[hidden]{display:none!important}
/* Stationary body, with only the waving hand or typing hand swapped.
   The base has a matching transparent window, so moving fingers cannot ghost. */
#ar-agandar-guest .ar-agandar-wave-pose .ar-agandar-base{clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,15.234375% 17.578125%,41.6015625% 17.578125%,41.6015625% 48.828125%,15.234375% 48.828125%,15.234375% 17.578125%)}
#ar-agandar-guest .ar-agandar-wave-pose .ar-agandar-motion{clip-path:inset(17.578125% 58.3984375% 51.171875% 15.234375%)}
#ar-agandar-guest .ar-agandar-type-pose .ar-agandar-base{clip-path:polygon(evenodd,0 0,100% 0,100% 100%,0 100%,0 0,40.0390625% 44.53125%,62.109375% 44.53125%,62.109375% 56.25%,40.0390625% 56.25%,40.0390625% 44.53125%)}
#ar-agandar-guest .ar-agandar-type-pose .ar-agandar-motion{clip-path:inset(44.53125% 37.890625% 43.75% 40.0390625%)}
#ar-agandar-guest .ar-agandar-strip{display:block;position:absolute;left:0;top:0;max-width:none;height:100%;user-select:none;pointer-events:none;object-fit:fill;filter:none!important}
#ar-agandar-guest .ar-agandar-strip[hidden]{display:none!important}
#ar-agandar-guest .ar-agandar-wave-pose .ar-agandar-strip{width:300%}
#ar-agandar-guest .ar-agandar-type-pose .ar-agandar-strip{width:200%}
.ar-agandar-announcement{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
body.ar-cyber #ar-cyber-page-footer .ar-cyber-footer-labels{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 24px;width:100%;min-width:0}
body.ar-cyber #ar-cyber-page-footer .ar-cyber-footer-code{display:block;position:static;flex:0 1 auto;min-width:0;max-width:100%;color:var(--cyber-accent,#e8e9eb);font:600 9px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.12em;text-align:left;white-space:normal;overflow-wrap:anywhere;opacity:.32;text-shadow:0 0 8px var(--cyber-glow)}
@media(max-width:600px){body.ar-cyber #ar-cyber-page-footer .ar-cyber-footer-labels{display:grid;grid-template-columns:minmax(0,1fr);justify-items:start;align-items:baseline}}
@media print{#ar-cyber-page-footer,#ar-agandar-trigger,#ar-agandar-guest{display:none!important}}


#ar-agandar-guest .ar-agandar-stage::after,#ar-agandar-guest .ar-agandar-stage::before{content:none!important}
#ar-agandar-guest .ar-agandar-stage:focus-visible{outline:2px solid #ff7f94;outline-offset:2px;border-radius:10px}
#ar-agandar-guest[data-dragging="true"] .ar-agandar-stage{cursor:grabbing}
#ar-agandar-guest[data-phase="wave"] .ar-agandar-type-pose,#ar-agandar-guest:not([data-phase="wave"]) .ar-agandar-wave-pose{display:none}
#ar-agandar-guest[data-phase="wave"] .ar-agandar-wave{animation:ar-agandar-wave-hand 2s step-end 1}
#ar-agandar-guest[data-phase="idle"] .ar-agandar-type{animation:ar-agandar-quiet-typing 22s step-end infinite}
@keyframes ar-agandar-wave-hand{0%,44%,88%,100%{transform:translateX(0)}11%,33%,55%,77%{transform:translateX(-33.333333%)}22%,66%{transform:translateX(-66.666667%)}}
@keyframes ar-agandar-quiet-typing{0%,78%,81%,84%,87%,90%,93%,96%,100%{transform:translateX(0)}79.5%,82.5%,85.5%,88.5%,91.5%,94.5%{transform:translateX(-50%)}}
#ar-agandar-guest[data-motion="false"] .ar-agandar-strip{animation:none!important;transform:none!important}
#ar-agandar-guest[hidden] .ar-agandar-strip{animation-play-state:paused!important}
#ar-agandar-guest .ar-agandar-bubble{position:absolute;bottom:calc(100% + 8px);left:0;box-sizing:border-box;width:min(260px,calc(100vw - 32px));padding:12px 14px;border:1px solid #ad4d5c;border-radius:12px;background:#08090c;color:#ff98a8;font:500 13px/1.5 Arial,sans-serif;box-shadow:0 5px 18px #0008;pointer-events:auto;text-align:left;max-height:200px;overflow:auto}
#ar-agandar-guest[data-bubble-side="left"] .ar-agandar-bubble{left:auto;right:0}
#ar-agandar-guest[data-bubble-below="true"] .ar-agandar-bubble{bottom:auto;top:calc(100% + 8px)}
#ar-agandar-guest .ar-agandar-bubble[hidden]{display:none!important}
#ar-agandar-guest .ar-agandar-bubble p{margin:0 0 6px!important;color:#ff98a8!important;font:inherit!important;white-space:pre-line}
#ar-agandar-guest .ar-agandar-bubble a{color:#ffb3bf!important;font:600 11px/1.4 Arial,sans-serif!important;text-decoration:underline;overflow-wrap:anywhere}
.ar-companion-sr{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
@media(prefers-reduced-motion:reduce){#ar-agandar-guest .ar-agandar-strip{animation:none!important;transform:none!important}}
@media(forced-colors:active){#ar-agandar-guest .ar-agandar-bubble{border:2px solid CanvasText;background:Canvas;color:CanvasText}#ar-agandar-guest .ar-agandar-bubble p,#ar-agandar-guest .ar-agandar-bubble a{color:CanvasText!important}}
#ar-agandar-guest .ar-agandar-bubble{position:fixed!important;bottom:auto!important;right:auto!important}
/* V18: a finite, keyboard-friendly NPC exchange. The sprite is slightly taller than Avdi. */
#ar-agandar-guest .ar-agandar-stage{cursor:pointer}
#ar-agandar-guest .ar-agandar-bubble{width:min(348px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px 14px;overscroll-behavior:contain;scrollbar-width:thin}
#ar-agandar-guest .ar-agandar-dialogue-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;letter-spacing:.17em;font:700 11px/1.4 ui-monospace,monospace}
#ar-agandar-guest .ar-agandar-bubble button{box-sizing:border-box;display:block;min-height:38px;max-width:100%;margin:0;padding:7px 10px;border:1px solid #914652!important;border-radius:5px;background:#171014!important;color:#ffd8df!important;clip-path:none!important;font:500 12px/1.4 Arial,sans-serif!important;white-space:normal;text-align:left;text-transform:none;letter-spacing:0;cursor:pointer}
#ar-agandar-guest .ar-agandar-bubble button::before,#ar-agandar-guest .ar-agandar-bubble button::after{content:none!important}
#ar-agandar-guest .ar-agandar-bubble button:focus-visible{outline:2px solid #ffe4e9!important;outline-offset:2px}
#ar-agandar-guest .ar-agandar-bubble .ar-agandar-dialogue-close{min-width:38px;min-height:38px;padding:3px 10px;text-align:center;font-size:20px!important;flex-shrink:0}
#ar-agandar-guest .ar-agandar-dialogue-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:11px}
#ar-agandar-guest .ar-agandar-dialogue-actions .ar-agandar-answer{flex:1 1 100%}
#ar-agandar-guest .ar-agandar-dialogue-title{font-weight:700!important;color:#ffe2e8!important}
#ar-agandar-guest .ar-agandar-quotation{border-left:2px solid #ad4d5c;padding-left:9px;font-style:italic!important}
#ar-agandar-guest .ar-agandar-reference{font-size:11px!important;opacity:.88}
@media(pointer:coarse){#ar-agandar-guest .ar-agandar-bubble button{min-height:44px}}
@media(forced-colors:active){#ar-agandar-guest .ar-agandar-bubble button{color:ButtonText!important;background:ButtonFace!important;border-color:ButtonText!important}}

/* One actual hand-wave, then a quiet red pixel-cut farewell. No cloned body,
   page-wide effects, full-sprite sliding, brightness pulse or flashing. */
#ar-agandar-guest .ar-agandar-departure-sparks{display:none;position:absolute;left:49%;top:31%;width:3px;height:2px;pointer-events:none;background:#e65769;box-shadow:-30px 18px 0 #ca4159,24px 35px 0 #db5365,-13px 66px 0 #aa3749,34px 87px 0 #dc5365,-23px 108px 0 #ac354b}
#ar-agandar-guest[data-phase="departing"] .ar-agandar-stage{pointer-events:none;cursor:default}
#ar-agandar-guest[data-phase="departing"] .ar-agandar-type-pose{display:none}
#ar-agandar-guest[data-phase="departing"] .ar-agandar-wave-pose{display:block}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="pixels"] .ar-agandar-wave{animation:ar-agandar-farewell-hand 550ms step-end 1 forwards}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="pixels"] .ar-agandar-stage{animation:ar-agandar-pixel-departure 1100ms linear 1 forwards}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="pixels"] .ar-agandar-departure-sparks{display:block;animation:ar-agandar-farewell-pixels 1100ms linear 1 forwards}
@keyframes ar-agandar-farewell-hand{0%,36%,72%,100%{transform:translateX(0)}18%,54%{transform:translateX(-33.333333%)}27%,63%{transform:translateX(-66.666667%)}}
/* Each contour removes more of the existing figure, without reappearing bands. */
@keyframes ar-agandar-pixel-departure{
 0%,48%{opacity:1;clip-path:polygon(0 0,100% 0,100% 100%,75% 100%,75% 100%,50% 100%,50% 100%,25% 100%,25% 100%,0 100%)}
 60%{opacity:.9;clip-path:polygon(0 0,100% 0,100% 87%,75% 87%,75% 95%,50% 95%,50% 84%,25% 84%,25% 91%,0 91%)}
 74%{opacity:.67;clip-path:polygon(0 0,100% 0,100% 60%,75% 60%,75% 73%,50% 73%,50% 56%,25% 56%,25% 66%,0 66%)}
 87%{opacity:.32;clip-path:polygon(0 0,100% 0,100% 30%,75% 30%,75% 41%,50% 41%,50% 23%,25% 23%,25% 36%,0 36%)}
 100%{opacity:0;clip-path:polygon(0 0,100% 0,100% 0,75% 0,75% 0,50% 0,50% 0,25% 0,25% 0,0 0)}
}
@keyframes ar-agandar-farewell-pixels{0%,48%{opacity:0}60%{opacity:.38}100%{opacity:0}}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="fade"] .ar-agandar-stage{animation:ar-agandar-farewell-fade 160ms linear 1 forwards}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="fade"][data-departure-pose="idle"] .ar-agandar-type-pose{display:block}
#ar-agandar-guest[data-phase="departing"][data-departure-mode="fade"][data-departure-pose="idle"] .ar-agandar-wave-pose{display:none}
@keyframes ar-agandar-farewell-fade{from{opacity:1}to{opacity:0}}
@media(prefers-reduced-motion:reduce){#ar-agandar-guest[data-phase="departing"] .ar-agandar-stage{animation:ar-agandar-farewell-fade 160ms linear 1 forwards;animation-duration:160ms!important}#ar-agandar-guest .ar-agandar-departure-sparks{display:none!important}}
body[data-reading-sprites="off"] #ar-agandar-guest .ar-agandar-stage{animation:none!important}
#ar-agandar-guest[data-phase="departing"] .ar-agandar-stage:disabled{opacity:1}
