/* IUChat reading and message tools. Narrow desktop windows still support hover. */
body.iuchat-messenger{font-family:"Segoe UI","PingFang SC","Microsoft YaHei","Noto Sans SC",Arial,sans-serif;font-size:14px;line-height:1.6}
body.iuchat-messenger:lang(zh-TW){font-family:"Segoe UI","PingFang TC","Microsoft JhengHei","Noto Sans TC",Arial,sans-serif}
body.iuchat-messenger :is(button,input,textarea){font-family:inherit}
body.iuchat-messenger .chat-content :is(.iuai-msg-v574,.iuai-group-msg-v576){min-width:0}
body.iuchat-messenger .iuai-msg-wrap-v583{position:relative;width:fit-content;min-width:0;max-width:min(calc(100% - 100px),680px);padding-bottom:0}
body.iuchat-messenger .chat-content .iuai-msg-wrap-v583>.iuai-msg-bubble-v574{max-width:100%!important;width:fit-content;box-sizing:border-box}
body.iuchat-messenger .chat-content :is(.iuai-msg-bubble-v574,.iuai-group-bubble-v576){font-size:11px;line-height:1.6;padding:8px 11px;border-radius:12px!important;overflow-wrap:anywhere}
body.iuchat-messenger .chat-content :is(.iuai-private-messages-v574,.iuai-group-messages-v576){gap:10px;padding:18px 20px;scroll-padding-bottom:20px}
body.iuchat-messenger .chat-content :is(.iuai-msg-meta-v574,.iuai-group-meta-v576){font-size:11px;line-height:1.5;margin-top:7px;opacity:.72;font-variant-numeric:tabular-nums}
body.iuchat-messenger .iuai-msg-actions-v583{position:absolute;top:50%;bottom:auto;left:100%;right:auto;transform:translateY(-50%);width:94px;box-sizing:border-box;padding-left:6px;margin:0;gap:4px;flex-wrap:wrap;justify-content:flex-start;opacity:0!important;pointer-events:none;transition:opacity .12s ease}
body.iuchat-messenger .iuai-msg-v574.me .iuai-msg-actions-v583{left:auto;right:100%;padding-left:0;padding-right:6px;justify-content:flex-end}
body.iuchat-messenger .iuai-msg-v574:hover .iuai-msg-actions-v583,body.iuchat-messenger .iuai-msg-v574:focus-within .iuai-msg-actions-v583{opacity:1!important;pointer-events:auto}
body.iuchat-messenger .iuai-msg-actions-v583 button{min-height:26px;padding:3px 8px;font-size:11px;line-height:1.5;border-radius:7px;background:#252d33;border-color:#3c4852;color:#c6d1da;white-space:nowrap}
body.iuchat-messenger .iuai-msg-actions-v583 button:focus-visible{outline:2px solid #54c887;outline-offset:2px}
body.iuchat-messenger .chat-content :is(.iuai-private-head-v574,.iuai-group-head-v576){gap:12px;padding:12px 18px;min-height:68px;height:auto}
body.iuchat-messenger .chat-content :is(.iuai-private-compose-v574,.iuai-group-compose-v576){grid-template-rows:28px minmax(38px,1fr) 34px;min-height:128px;padding:12px 18px!important;gap:8px!important}
body.iuchat-messenger .chat-content :is(.iuai-private-compose-v574,.iuai-group-compose-v576) textarea{font-size:11px!important;line-height:1.6!important;min-height:38px;max-height:120px}
body.iuchat-messenger .iuchat-send-hint{font-size:11px;line-height:1.5}
body.iuchat-messenger :is(.iuai-private-send-v574,.iuai-group-send-v576){font-size:14px;font-weight:600;min-width:76px!important;height:34px!important}
@media(max-width:700px){body.iuchat-messenger .topbar{height:auto;min-height:64px;gap:8px;padding:10px 12px;flex-wrap:wrap}body.iuchat-messenger .topbar .context{font-size:12px;min-width:0}body.iuchat-messenger .top-actions{gap:5px;margin-left:auto;max-width:100%}body.iuchat-messenger .top-actions>.icon-button,body.iuchat-messenger .top-actions>.iuchat-mobile-menu{width:36px;min-width:36px;height:36px;flex-basis:36px}body.iuchat-messenger .chat-content :is(.iuai-private-messages-v574,.iuai-group-messages-v576){padding:16px 14px;gap:10px}body.iuchat-messenger .iuai-msg-wrap-v583{max-width:min(calc(100% - 100px),680px)}body.iuchat-messenger .chat-content :is(.iuai-private-head-v574,.iuai-group-head-v576){padding:10px 14px;min-height:64px}body.iuchat-messenger .chat-content :is(.iuai-private-compose-v574,.iuai-group-compose-v576){min-height:128px;padding:10px 14px!important}}
/* Touch screens have no hover; keep the existing actions accessible there. */
@media(hover:none) and (pointer:coarse){body.iuchat-messenger .iuai-msg-actions-v583{opacity:1!important;pointer-events:auto}body.iuchat-messenger .iuai-msg-actions-v583 button{min-height:32px}body.iuchat-messenger .iuai-msg-wrap-v583{padding-bottom:0}}
@media(prefers-reduced-motion:reduce){body.iuchat-messenger .iuai-msg-actions-v583{transition:none}}
@media(max-width:700px){body.iuchat-messenger .chat-app.show-main>.inbox{display:none!important}body.iuchat-messenger .chat-app.show-main>.main-panel{display:flex!important;flex:1;min-width:0;width:100%}}

/* Private drafts use .iuai-drafts-v577, not the legacy .iuai-private-drafts-v577. */
body.iuchat-messenger .chat-content :is(.iuai-drafts-v577,.iuai-group-drafts-v5771){display:flex;flex-wrap:nowrap;align-items:center;gap:8px;width:100%;min-width:0;max-height:80px;overflow-x:auto;overflow-y:hidden;box-sizing:border-box;padding:4px 3px 7px;margin:0 0 5px}
body.iuchat-messenger .chat-content :is(.iuai-drafts-v577,.iuai-group-drafts-v5771):empty{display:none;padding:0;margin:0}
body.iuchat-messenger .chat-content :is(.iuai-draft-img-v577,.iuai-group-draft-img-v5771){position:relative;display:grid;place-items:center;flex:0 0 72px;width:72px;height:64px;min-width:72px;max-width:72px;max-height:64px;overflow:visible;box-sizing:border-box;border:1px solid #43515d;border-radius:8px;background:#172128}
body.iuchat-messenger .chat-content :is(.iuai-drafts-v577,.iuai-group-drafts-v5771) img{display:block;box-sizing:border-box;width:100%!important;height:100%!important;min-width:0!important;max-width:70px!important;max-height:62px!important;object-fit:contain!important;border-radius:6px;margin:0}
body.iuchat-messenger .chat-content :is(.iuai-draft-img-v577,.iuai-group-draft-img-v5771)>button{position:absolute;right:-3px;top:-3px;display:grid;place-items:center;width:22px;height:22px;min-width:22px;min-height:22px;padding:0;border:1px solid #687680;border-radius:50%;background:#29353e;color:#f1f5f8;font:16px/1 sans-serif;z-index:2;cursor:pointer}
body.iuchat-messenger .chat-content :is(.iuai-private-compose-main-v577,.iuai-group-compose-main-v5771){min-width:0;min-height:0;max-height:220px;overflow-y:auto;overflow-x:hidden}

/* Compact chat typography; retain 16px touch inputs to prevent iOS focus zoom. */
body.iuchat-messenger .chat-content :is(.iuai-private-head-v574,.iuai-group-head-v576) b{font-size:14px;line-height:1.5}
body.iuchat-messenger .inbox-heading h1{font-size:18px;line-height:1.4}
body.iuchat-messenger .quick-ai-text{font-size:11px;line-height:1.6}
body.iuchat-messenger .quick-ai-bubble{padding:8px 11px}
body.iuchat-messenger .quick-ai-compose textarea{font-size:11px;line-height:1.6}
@media(max-width:700px){body.iuchat-messenger .chat-content :is(.iuai-private-compose-v574,.iuai-group-compose-v576) textarea,body.iuchat-messenger .quick-ai-compose textarea{font-size:16px!important}}