/* Shared chat text scale and the existing chat close-button surface. */
html body :is(#globalChatPanel,#realtimeDuelChatPanel,#familyChatPanel,#dmChatPanel) .xixi-chat-scaled{font-size:calc(var(--xixi-chat-base-font) * var(--xixi-chat-scale,1))!important}
.realtime-duel-chat-header>div:first-child{min-width:0;overflow-wrap:anywhere}
html body :is(#globalChatPanel,#realtimeDuelChatPanel) .realtime-duel-chat-header-actions{padding-left:0;flex:none}
.realtime-duel-chat-header,.family-chat-header-actions{flex-shrink:0}
.xixi-chat-text-settings{position:absolute;z-index:40;top:58px;right:8px;width:min(300px,calc(100% - 16px));box-sizing:border-box;padding:14px;border:1px solid #bfdbfe;border-radius:12px;background:#f8fbff;color:#1e3a8a;box-shadow:0 8px 28px #0f172a33}
.xixi-chat-text-settings[hidden]{display:none}
.xixi-chat-text-label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;line-height:1.4;font-size:.85rem}
.xixi-chat-text-controls{display:flex;align-items:center;gap:9px}
.xixi-chat-text-controls input{flex:1;min-width:0;width:80px;accent-color:#2563eb}
.xixi-chat-text-controls button{width:36px;height:36px;min-width:36px;padding:0;display:grid;place-items:center;background:#dbeafe;color:#1e3a8a}
.xixi-chat-text-controls svg,.xixi-chat-settings-button svg{width:18px!important;height:18px!important;display:block;pointer-events:none}
html body .xixi-unified-close{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:none;line-height:1!important;border:0;background:#dbeafe!important;color:#1e3a8a!important;border-radius:12px!important}
html body .xixi-chat-settings-button{border-radius:12px!important}
html.xixi-liquid-buttons body button.xixi-glossy-control:is(.xixi-unified-close,.xixi-chat-settings-button){border-radius:12px!important}
html body .xixi-unified-close>svg{width:14.4px!important;height:14.4px!important;display:block;flex:none;pointer-events:none}
html body .xixi-unified-close:hover{filter:brightness(.96);opacity:1}
html.xixi-liquid-buttons body #langSelectModal .lang-choice-card,#langSelectModal .lang-choice-card{border-radius:4px!important}
/* Reuse the original-message link typography for both AI link states. */
html body :is(.xixi-chat-original,.xixi-helper-collapse){margin:3px 4px 0;padding:0;border:0;background:transparent;color:#2563eb;font:inherit;font-size:.65rem;text-decoration:underline;cursor:pointer;box-shadow:none!important;border-radius:0!important;min-height:0;min-width:0}
body.theme-dark .xixi-chat-text-settings{background:#111827;border-color:#475569;color:#dbeafe}
body.theme-dark .xixi-chat-text-controls button{background:#1e3a5f;color:#dbeafe}
html body.theme-dark .xixi-unified-close{background:#1e3a5f!important;color:#dbeafe!important}
html body.theme-dark :is(.xixi-chat-original,.xixi-helper-collapse){color:#93c5fd}
html.xixi-liquid-buttons body button:is(.xixi-chat-original,.xixi-helper-collapse){border-radius:0!important;background:transparent!important;box-shadow:none!important}
