#arcChatButton[hidden],#arcChatPanel[hidden]{display:none!important}
#arcChatButton{position:fixed;z-index:21002;top:10px;left:160px;width:42px;height:36px;display:grid;place-items:center;border:1px solid #d8b36699;border-radius:13px;background:linear-gradient(140deg,#273447,#161026);color:#f4d696;box-shadow:0 0 16px #88d9ec22;cursor:pointer}
#arcChatPanel{position:fixed;z-index:22000;right:12px;top:12px;bottom:12px;width:min(380px,calc(100vw - 24px));box-sizing:border-box;display:flex;flex-direction:column;gap:8px;min-height:0;padding:16px;border:1px solid #d8b36688;border-radius:18px;color:#e9eef5;background:radial-gradient(ellipse at top left,#173642,#0c0b19 70%);box-shadow:0 18px 65px #000b;font:13px/1.4 system-ui,sans-serif;overflow:auto;touch-action:pan-y}
#arcChatPanel *{box-sizing:border-box;min-width:0}#arcChatPanel header{display:flex;justify-content:space-between;align-items:center;flex:none}#arcChatPanel h2{font:26px Georgia,serif;margin:2px 0;color:#f0d594}#arcChatPanel small{font-size:9px;letter-spacing:.17em;color:#90dfe8}#arcChatPanel button{border:1px solid #bfa56c66;border-radius:9px;background:#1c2638;color:#f1d596;padding:8px 11px;cursor:pointer;min-height:36px}#arcChatPanel button:disabled{opacity:.5;cursor:wait}#arcChatPanel [data-close]{font-size:24px;padding:0 10px}#arcChatPanel .arc-chat-note{font-size:11px;color:#a5b6c8;margin:0}#arcChatPanel .arc-chat-messages{flex:1 1 100px;min-height:70px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}#arcChatPanel article{padding:9px 11px;border:1px solid #80c8de22;background:#03091766;border-radius:10px;margin:0 0 8px;overflow-wrap:anywhere}#arcChatPanel article b{color:#8dd6e5;font-size:11px;display:block}#arcChatPanel article p{margin:4px 0;white-space:pre-wrap}#arcChatPanel audio{display:block;width:100%;height:36px;margin:6px 0}#arcChatPanel form{flex:none}#arcChatPanel textarea{width:100%;resize:none;font:16px/1.3 system-ui,sans-serif;background:#050c17;color:#fff;border:1px solid #83b9c755;border-radius:9px;padding:9px}#arcChatPanel .arc-chat-actions{display:flex;justify-content:space-between;gap:8px;margin-top:5px}#arcChatPanel [type=submit]{background:linear-gradient(#eac875,#ac7c30);color:#20170a;font-weight:800}#arcChatPanel .arc-chat-status{font-size:11px;color:#efd09a;margin:0}#arcChatPanel .arc-chat-voice[hidden]{display:none}#arcChatPanel :focus-visible,#arcChatButton:focus-visible{outline:2px solid #95e7f7;outline-offset:2px}@media(max-height:500px){#arcChatPanel{padding:10px;gap:5px;width:min(360px,70vw)}#arcChatPanel h2{font-size:20px}#arcChatPanel textarea{height:40px}#arcChatPanel .arc-chat-note{font-size:10px}}

/* ARCANIS_CHAT_POSITION_BUILD:1214 — same right edge as Q, 8px below. */
#arcChatButton {
  top:auto;left:auto;right:max(12px,env(safe-area-inset-right,0px));
  bottom:calc(max(70px,calc(env(safe-area-inset-bottom,0px) + 58px)) - 64px);
  width:56px;height:56px;border-radius:50%;
  background:radial-gradient(circle at 40% 30%,#476671,#18152e 65%,#0d1320);
  box-shadow:0 0 18px #cfb46c38,inset 0 0 16px #c8e2e52a;
}
@media(max-width:1099px) {
  #arcChatButton {right:max(9px,env(safe-area-inset-right,0px));
    bottom:calc(max(62px,calc(env(safe-area-inset-bottom,0px) + 54px)) - 52px);
    width:44px;height:44px;}
}

/* ARCANIS_CHAT_FULLSCREEN_BUILD:1215 — controls belong to #game. */
#gameScreen #arcChatButton {position:absolute;bottom:max(70px,calc(env(safe-area-inset-bottom,0px) + 58px));z-index:21002}
#gameScreen #arcQuestHud {bottom:calc(max(70px,calc(env(safe-area-inset-bottom,0px) + 58px)) + 64px)!important}
#gameScreen #arcChatPanel {position:absolute}
#arcChatPanel form[hidden] {display:none!important}
@media(max-width:1099px){
 /* Compact controls stay above the card action bar. */
 #gameScreen #arcChatButton {bottom:max(62px,calc(env(safe-area-inset-bottom,0px) + 54px));width:44px;height:44px;padding:0}
 #gameScreen #arcQuestHud {bottom:calc(max(62px,calc(env(safe-area-inset-bottom,0px) + 54px)) + 52px)!important}
 #gameScreen #arcChatPanel {top:8px;bottom:8px;right:max(9px,env(safe-area-inset-right,0px));width:min(340px,calc(100% - 18px));max-height:calc(100% - 16px);padding:10px;gap:5px}
}

/* ARCANIS_CHAT_MAGIC_BUILD:1218 — decorative layers never move the controls. */
#gameScreen #arcChatButton[data-unread]{border-color:#ffe3a2;color:#e1fcff;box-shadow:0 0 12px #96edff,0 0 27px #a678ed88,inset 0 0 15px #f7d89166;animation:arcChatAwaken 1.5s ease-in-out 3}
#gameScreen #arcChatButton[data-unread]::before{content:'';position:absolute;inset:-5px;border:1px dashed #b3f3ff;border-top:2px solid #ffe7a8;border-radius:50%;pointer-events:none;animation:arcChatOrbit 6s linear infinite}
#gameScreen #arcChatButton[data-unread]::after{content:attr(data-unread);position:absolute;right:-3px;top:-5px;min-width:17px;height:17px;padding:0 3px;box-sizing:border-box;display:grid;place-items:center;border:1px solid #fff0c6;border-radius:20px;background:#e7c27b;color:#201226;font:800 10px/1 system-ui;pointer-events:none}
@keyframes arcChatAwaken{50%{box-shadow:0 0 20px #aff5ff,0 0 36px #caa1fcaa,inset 0 0 20px #f7d89188}}
@keyframes arcChatOrbit{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#gameScreen #arcChatButton[data-unread],#gameScreen #arcChatButton[data-unread]::before{animation:none}}
/* Märchenpfad: reserve the right edge above the existing action bar. */
#gameScreen #arcChatButton {z-index:21002;bottom:max(70px,calc(env(safe-area-inset-bottom) + 58px));}
#gameScreen #arcChatPanel {z-index:22000;}

/* V48: actual playback position and measured recording length. */
#arcChatPanel .arc-voice-player {display:flex;align-items:center;gap:10px;width:100%;padding:9px 0;color:#f3dfb7;}
#arcChatPanel .arc-voice-player button {flex:0 0 38px;min-height:38px;padding:0;border-radius:50%;border:1px solid #c8a873;background:#30223f;color:#f8e5b8;}
#arcChatPanel .arc-voice-player input {min-width:0;flex:1;width:0;accent-color:#d9b777;margin:0;padding:0;height:24px;}
#arcChatPanel .arc-voice-player output {flex-shrink:0;font:12px/1.3 system-ui,sans-serif;font-variant-numeric:tabular-nums;}
#arcChatPanel audio[hidden] {display:none!important;}
