.realtime-duel-chat-compose{align-items:center}
.realtime-duel-chat-compose .chat-media-plus{align-self:center;display:inline-flex;align-items:center;justify-content:center;height:38px;flex:0 0 34px;width:34px;min-width:34px;padding:0;background:transparent;color:inherit;border:1px solid currentColor;border-radius:9px}
.realtime-duel-chat-compose .chat-media-plus>svg{display:block;width:16px;height:16px;flex:none}
.realtime-duel-chat-close:not(.family-chat-search-button)>svg{display:block;width:14.4px;height:14.4px;flex:none}
.chat-media-menu,.chat-attachment-selection{display:flex;gap:8px;padding:8px 12px;align-items:center;flex-wrap:wrap}
.chat-media-menu[hidden],.chat-attachment-selection[hidden]{display:none}
.chat-attachment-selection>span{flex:1;min-width:0;overflow-wrap:anywhere}
.chat-attachment{margin:6px 0 6px 38px;max-width:calc(100% - 38px);overflow-wrap:anywhere}
.chat-attachment-name{font-size:.85em;margin-bottom:4px}
.chat-media-preview{display:block;max-width:100%;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in}
.chat-media-preview img,.chat-media-preview video{display:block;max-width:100%;width:auto;max-height:150px;object-fit:contain;border-radius:8px}
.chat-file-link{border:0;background:transparent;color:var(--primary,#5367e8);text-decoration:underline;font:inherit;font-size:.85em;padding:4px 8px;cursor:pointer}
.chat-media-viewer,.family-reset-confirm{position:absolute;inset:10px;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--card-bg,#fff);color:var(--text,#182033);border:1px solid #94a3b8;border-radius:12px;padding:12px;box-shadow:0 8px 30px #0005}
.chat-media-viewer>button{align-self:flex-end}
.chat-media-viewer img,.chat-media-viewer video{max-width:100%;max-height:calc(100% - 55px);object-fit:contain;min-height:0}
.admin-family-member{font:inherit;color:inherit;background:transparent;border:0;cursor:pointer;text-decoration:none;font-style:normal;font-weight:400;padding:0}
#familyChatPanel{z-index:10040}
#familyChatPanel .realtime-duel-chat-header{display:flex;align-items:center;justify-content:space-between}
#familyChatPanel .realtime-duel-chat-header>div{min-width:0}
.family-chat-header-actions{display:flex;align-items:center;gap:1ch;flex:none}
.family-chat-search-button{display:inline-flex;align-items:center;justify-content:center}
.family-chat-search[hidden]{display:none}
.family-chat-search{display:flex;flex-direction:column;flex:none;gap:5px;padding:8px 10px;border-bottom:1px solid #64748b55;min-height:0}
.family-chat-search-input{box-sizing:border-box;width:100%;font:inherit;color:inherit;background:var(--card-bg,#fff);border:1px solid #64748b;border-radius:7px;padding:7px 9px}
.family-chat-search-results{display:flex;flex-direction:column;gap:3px;max-height:min(36vh,260px);overflow:auto;overscroll-behavior:contain}
.family-chat-search-status{padding:8px;color:var(--muted,#94a3b8);font-size:.85em}
.family-chat-search-result{display:flex;flex-direction:column;align-items:stretch;gap:3px;width:100%;padding:7px 8px;text-align:left;background:transparent;color:inherit;border:0;border-radius:6px;font:inherit;cursor:pointer}
.family-chat-search-result:hover,.family-chat-search-result:focus-visible{background:#64748b33}
.family-chat-search-result-meta{font-size:.75em;opacity:.75}
.family-chat-search-result-text{font-size:.87em;white-space:normal;overflow-wrap:anywhere}
.family-chat-search-more[hidden]{display:none}
#familyChatPanel.chat-compact>.realtime-duel-chat-header{display:flex}
#familyChatSubtitle{display:block}
#familyChatPanel textarea{min-width:0;flex:1}
#globalChatPanel .family-reset-confirm,#realtimeDuelChatPanel .family-reset-confirm,#familyChatPanel .family-reset-confirm{inset:auto 12px 20px}
.furigana-toggle-row>.furigana-toggle-label{white-space:nowrap}

.furigana-toggle-row{flex-wrap:wrap}.furigana-toggle-row>.practice-text-title{flex:1 1 auto;width:max-content;max-width:100%}.reading-mode-options{display:flex;flex:0 1 auto;flex-wrap:wrap;gap:8px 12px;margin-left:auto;max-width:100%}.reading-mode-options .furigana-toggle-label{white-space:nowrap}
.family-member-icon{width:1.45em;height:1.45em;object-fit:contain;vertical-align:middle;margin-left:4px}#familyChatButton{position:relative}.family-unread-dot{position:absolute;right:-3px;top:-3px;width:10px;height:10px;border-radius:50%;background:#ef4444;border:2px solid white;pointer-events:none}
#soloRankingPanel>.season-status{margin-bottom:12px}

.realtime-duel-chat-compose .xixi-chat-input-wrap>.realtime-duel-chat-input{display:block}

/* v163.402: short visual viewports reserve height for messages and the editor. */
.realtime-duel-chat-panel.chat-compact>.realtime-duel-chat-header,
#familyChatPanel.chat-compact>.realtime-duel-chat-header,
.realtime-duel-chat-panel.chat-compact>.realtime-duel-chat-hint{display:none}
.chat-compact>.realtime-duel-chat-compose{padding:6px;gap:5px}
.realtime-duel-chat-panel>.chat-media-menu{position:absolute;bottom:var(--chat-compact-compose-height,54px);left:4px;right:4px;z-index:10;max-height:calc(100% - var(--chat-compact-compose-height,54px) - 4px);overflow:auto;overscroll-behavior:contain;padding:6px;gap:4px;background:var(--card-bg,#fff);border:1px solid #94a3b8;border-radius:10px;box-shadow:0 -3px 14px #0002}
.realtime-duel-chat-panel>.chat-media-menu>button{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:1 1 auto;font:inherit;font-size:.7rem;padding:7px 5px;white-space:nowrap}
.chat-compact-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;width:100%}
.chat-compact-actions>button{min-width:32px;min-height:32px}
.chat-compact-actions>button[hidden]{display:none}
.chat-compact-actions .duel-chat-image{display:block;width:30px;height:30px;object-fit:contain}
body:has(#familyChatPanel.chat-compact.open)>.global-chat-launcher,
body:has(#familyChatPanel.chat-compact.open)>.realtime-duel-chat-launcher{display:none!important}
body.theme-dark .realtime-duel-chat-panel>.chat-media-menu{background:#0f172a;border-color:#475569}

/* Same attachment tools in both layouts; no circular close button in this menu. */
.chat-tool-icon{width:28px;height:28px;object-fit:contain;border-radius:5px;flex:none}
.chat-tool-robot{font-size:24px;line-height:28px;flex:none}
.chat-compact-actions:not(:has(button:not([hidden]))){display:none}
.realtime-duel-chat-compose .chat-compact-dismiss{font:inherit;font-size:.65rem;border-radius:6px;width:auto;height:auto;min-width:0;padding:7px 5px;flex:none;align-self:center}

/* v163.405: preserve title typography and attachment-local reply actions. */
button.family-members-title{display:block;background:none;border:0;border-radius:0;padding:0;margin:0;text-align:inherit;font-family:inherit;cursor:pointer;box-shadow:none}
.family-members-list{flex:none;max-height:160px;overflow:auto;padding:8px 16px;border-bottom:1px solid #dce4f2}
.family-members-list[hidden]{display:none}
.chat-attachment-body{max-width:100%;align-items:center;width:auto}
.chat-attachment-body .chat-attachment{min-width:0;max-width:100%;margin:0}
.xixi-chat-with-avatar>.chat-attachment-body{max-width:100%}
.xixi-chat-with-avatar.mine>.chat-attachment-body{align-self:flex-end}
.realtime-duel-chat-message>.chat-attachment-body{width:fit-content;max-width:100%;min-width:0;align-self:flex-start}
.realtime-duel-chat-message.mine>.chat-attachment-body{align-self:flex-end}
.chat-attachment-body>.chat-attachment{display:flex;flex-direction:column;align-items:flex-start}
.realtime-duel-chat-message.mine .chat-attachment{align-items:flex-end}
.chat-attachment-name{max-width:100%}
.chat-media-plus{touch-action:none;position:relative;z-index:1}
/* Keep the action slot for stable bubble/selection geometry; touch replies use swipes. */
/* Keep the action slot; actual pointer hover or keyboard focus reveals it. */
