/* ---------------------------------------------------------------------------
   Messages › sidebar, and the pieces the sidebar + composer session shares:
   popovers, menus, modals, buttons, the person picker, the emoji picker and the
   quick switcher. Prefix msx-. Everything reads the app's theme variables, so it
   follows light, dark and midnight.
--------------------------------------------------------------------------- */

/* ===== the sidebar ===== */
.msx-side { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--text); font-size: 14px; user-select: none; }
.msx-side-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 12px; }
.msx-ws { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font-weight: 700; font-size: 16px; padding: 5px 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; text-align: left; }
.msx-ws:hover, .msx-ws:focus-visible { background: var(--hover); outline: 0; }
.msx-ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-icon-btn { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.msx-icon-btn:hover, .msx-icon-btn:focus-visible { background: var(--hover); color: var(--text); outline: 0; }
.msx-icon-btn.solid { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.msx-icon-btn.solid:hover { background: var(--hover); }

.msx-views { flex: none; display: flex; flex-direction: column; padding: 2px 8px 6px; }
.msx-view { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.msx-view:hover, .msx-view:focus-visible { background: var(--hover); color: var(--text); outline: 0; }
.msx-view.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.msx-view-ico { display: inline-flex; width: 18px; justify-content: center; }
.msx-view-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-view.more { height: 26px; font-size: 13px; color: var(--dim); }
.msx-count { min-width: 18px; padding: 0 6px; height: 18px; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; background: var(--line); color: var(--muted); }
.msx-count.brand { background: var(--brand); color: #fff; }
.msx-count.live { background: var(--green); color: #fff; }

.msx-filterbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 10px 8px; border-bottom: 1px solid var(--line); }
.msx-find { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); }
.msx-find:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13px; user-select: text; }
.msx-find-x { border: 0; background: none; color: var(--dim); padding: 0; display: inline-flex; cursor: pointer; }
.msx-find-x[hidden] { display: none; }
.msx-unreads { flex: none; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 12.5px; cursor: pointer; }
.msx-unreads:hover { background: var(--hover); color: var(--text); }
.msx-unreads.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.msx-side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 14px; }
.msx-groups { display: flex; flex-direction: column; gap: 2px; }
.msx-group { position: relative; border-radius: 8px; }
.msx-group.drop-over { background: var(--brand-soft); outline: 1.5px dashed var(--brand); outline-offset: -1px; }
.msx-group.drop-before::before, .msx-group.drop-after::after { content: ''; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--brand); border-radius: 1px; z-index: 2; }
.msx-group.drop-before::before { top: -1px; }
.msx-group.drop-after::after { bottom: -1px; }
.msx-group.dragging { opacity: 0.4; }
.msx-group-head { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 2px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.msx-group-head:hover, .msx-group-head:focus-visible { background: var(--hover); color: var(--text); outline: 0; }
.msx-chev { display: inline-flex; width: 18px; justify-content: center; transition: transform 0.12s; }
.msx-chev.shut { transform: rotate(-90deg); }
.msx-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-group-tools { display: inline-flex; gap: 1px; opacity: 0; }
.msx-group-head:hover .msx-group-tools, .msx-group-head:focus-within .msx-group-tools { opacity: 1; }
.msx-group-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.msx-group-btn:hover { background: var(--line); color: var(--text); }
.msx-group-body { display: flex; flex-direction: column; gap: 1px; padding-bottom: 2px; }
.msx-group-empty { margin: 2px 8px 6px 24px; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 7px; color: var(--dim); font-size: 12.5px; }

.msx-item { position: relative; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 8px; margin-left: 2px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 14px; }
.msx-item:hover { background: var(--hover); color: var(--text); }
.msx-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.msx-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.msx-item.on:hover { background: var(--brand-soft); }
.msx-item.unread { color: var(--text); font-weight: 700; }
.msx-item.muted { opacity: 0.55; }
.msx-item.dragging { opacity: 0.35; }
.msx-item-lead { flex: none; width: 20px; display: inline-flex; align-items: center; justify-content: center; }
.msx-item-lead .msx-avatar, .msx-item-lead .msg-avatar { border-radius: 5px; }
.msx-item-lead .msg-avatar .msg-presence { right: -3px; bottom: -3px; width: 9px; height: 9px; border-width: 1.5px; border-color: var(--bg); }
.msx-item.on .msg-presence { border-color: var(--brand-soft); }
.msx-group-ava { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 700; }
.msx-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-item-status { font-weight: 400; }
.msx-item-huddle { display: inline-flex; color: var(--green); }
.msx-badge { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.msx-dotbadge { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.msx-dotbadge.small { width: 7px; height: 7px; background: var(--dim); }
.msx-item-more { flex: none; display: none; width: 22px; height: 22px; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.msx-item:hover .msx-item-more, .msx-item:focus-within .msx-item-more { display: inline-flex; }
.msx-item-more:hover { background: var(--line); color: var(--text); }
.msx-item:hover .msx-badge { display: none; }

.msx-addrow { display: flex; align-items: center; gap: 8px; width: calc(100% - 2px); margin-left: 2px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--dim); font-size: 13.5px; text-align: left; cursor: pointer; }
.msx-addrow:hover { background: var(--hover); color: var(--text); }
.msx-addrow-ico { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 5px; background: var(--line); }
.msx-nomatch { padding: 16px 10px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.msx-nomatch-act { text-align: center; }

/* ===== buttons, fields ===== */
.msx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.msx-btn:hover:not(:disabled) { background: var(--hover); }
.msx-btn:disabled { opacity: 0.5; cursor: default; }
.msx-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="midnight"] .msx-btn.primary { background: var(--action, var(--brand)); color: #fff; }
.msx-btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--brand); }
.msx-btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.msx-btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.msx-btn.left { margin-right: auto; }
.msx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.msx-label { font-size: 13px; font-weight: 700; color: var(--text); }
.msx-label em { font-weight: 400; color: var(--muted); font-style: normal; }
.msx-help { font-size: 12.5px; color: var(--muted); margin: 0; }
.msx-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.msx-input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-input-wrap { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.msx-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-input-wrap .msx-input { border: 0; box-shadow: none; padding: 8px 0; background: none; }
.msx-input-pre { display: inline-flex; color: var(--muted); }
.msx-input-count { font-size: 12px; color: var(--dim); }
.msx-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; margin-bottom: 8px; }
.msx-radio.on { border-color: var(--brand); background: var(--brand-soft); }
.msx-radio input { margin-top: 3px; accent-color: var(--brand); }
.msx-radio-ico { color: var(--muted); display: inline-flex; margin-top: 1px; }
.msx-radio-text { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.msx-radio-text b { color: var(--text); font-size: 14px; }
.msx-form-err { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: 13px; }
.msx-form-err[hidden] { display: none; }
.msx-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.msx-empty.big { padding: 36px 10px; }
.msx-select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; }
.msx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.msx-check input { accent-color: var(--brand); }
.msx-tag { margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 600; }

/* ===== popovers and menus ===== */
.msx-pop { z-index: 3100; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(10, 18, 32, 0.22), 0 2px 6px rgba(10, 18, 32, 0.1); overflow: hidden auto; font-size: 14px; }
:root[data-theme="midnight"] .msx-pop { background: var(--surface-2, var(--surface)); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55); }
.msx-menu { min-width: 220px; max-width: 320px; padding: 6px; outline: 0; }
.msx-menu-head { padding: 6px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.msx-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 10px 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.msx-menu-item:hover:not(.disabled), .msx-menu-item:focus-visible { background: var(--brand); color: #fff; outline: 0; }
.msx-menu-item.danger { color: var(--red); }
.msx-menu-item.danger:hover:not(.disabled), .msx-menu-item.danger:focus-visible { background: var(--red); color: #fff; }
.msx-menu-item.disabled { opacity: 0.45; cursor: default; }
.msx-menu-lead { flex: none; width: 18px; display: inline-flex; justify-content: center; }
.msx-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-menu-hint { color: inherit; opacity: 0.65; font-size: 12px; }
.msx-menu-chev { display: inline-flex; opacity: 0.7; }

/* ===== modals ===== */
.msx-modal-back { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 14, 24, 0.5); }
.msx-modal-back.top { align-items: flex-start; padding-top: 12vh; }
.msx-modal { position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 64px rgba(8, 14, 24, 0.35); outline: 0; overflow: hidden; }
:root[data-theme="midnight"] .msx-modal { background: var(--surface-2, var(--surface)); }
.msx-modal.busy { opacity: 0.85; }
.msx-modal-head { flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 6px; }
.msx-modal-title { flex: 1; min-width: 0; }
.msx-modal-title h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.msx-modal-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.msx-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px 8px; }
.msx-modal-text { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.msx-modal-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }

.msx-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.msx-choice span { flex: 1; }
.msx-choice:hover { background: var(--hover); }
.msx-choice.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.msx-choice.add { border-style: dashed; color: var(--muted); }

/* ===== person picker ===== */
.msx-picker { display: flex; flex-direction: column; gap: 8px; }
.msx-picker-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: text; }
.msx-picker-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-chips { display: contents; }
.msx-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 4px; border-radius: 6px; background: var(--brand-soft); color: var(--text); font-size: 13px; }
.msx-chip-x { display: inline-flex; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 4px; cursor: pointer; }
.msx-chip-x:hover { background: var(--line); color: var(--text); }
.msx-picker-input { flex: 1; min-width: 120px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; height: 28px; }
.msx-picker-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.msx-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.msx-person.on { background: var(--hover); }
.msx-person .msg-avatar .msg-presence { border-color: var(--surface); }
.msx-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.msx-person-name { font-weight: 600; font-size: 14px; }
.msx-person-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== browse channels ===== */
.msx-browse .msx-modal-body { display: flex; flex-direction: column; min-height: 380px; }
.msx-browse-top { display: flex; gap: 10px; margin-bottom: 10px; }
.msx-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.msx-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.msx-browse-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.msx-browse-count { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }
.msx-browse-list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); margin: 0 -20px; }
.msx-browse-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.msx-browse-row:hover, .msx-browse-row:focus-visible { background: var(--hover); outline: 0; }
.msx-browse-text { flex: 1; min-width: 0; }
.msx-browse-lead { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.msx-browse-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.msx-browse-about { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-joined { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-weight: 600; }
.msx-dot { color: var(--dim); }
.msx-browse-act { flex: none; display: flex; gap: 6px; opacity: 0; }
.msx-browse-row:hover .msx-browse-act, .msx-browse-row:focus-within .msx-browse-act { opacity: 1; }
@media (hover: none) { .msx-browse-act { opacity: 1; } }

/* ===== quick switcher ===== */
.msx-switcher .msx-modal-body { padding: 0; }
.msx-switch-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.msx-switch-input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font-size: 17px; font-family: inherit; min-width: 0; }
.msx-switch-list { max-height: min(52vh, 440px); overflow-y: auto; padding: 6px 8px 8px; }
.msx-switch-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.msx-switch-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer; }
.msx-switch-row.on { background: var(--brand); color: #fff; }
.msx-switch-row.unread .msx-switch-label { font-weight: 700; }
.msx-switch-lead { flex: none; width: 22px; display: inline-flex; align-items: center; justify-content: center; }
.msx-switch-row .msg-avatar .msg-presence { border-color: var(--surface); }
.msx-switch-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-switch-hint { font-size: 12px; opacity: 0.65; }
.msx-switch-foot { flex: none; display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.msx-switcher kbd, .msx-switch-foot kbd { display: inline-block; min-width: 18px; padding: 1px 5px; margin: 0 2px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg); color: var(--muted); font: 11px/1.4 inherit; text-align: center; }

/* ===== emoji picker ===== */
.msx-emoji { width: 352px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.msx-emoji-head { display: flex; gap: 6px; padding: 10px 10px 6px; }
.msx-emoji-search { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.msx-emoji-search:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msx-emoji-tone { flex: none; width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 17px; cursor: pointer; padding: 0; }
.msx-emoji-tone:hover { background: var(--hover); }
.msx-emoji-tonepanel { display: flex; align-items: center; gap: 8px; padding: 4px 12px 8px; }
.msx-emoji-tonepanel[hidden] { display: none; }
.msx-emoji-tonelabel { font-size: 12px; color: var(--muted); margin-right: auto; }
.msx-emoji-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.msx-emoji-swatch.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--surface) inset; }
.msx-emoji-tabs { display: flex; gap: 0; padding: 0 6px; border-bottom: 1px solid var(--line); }
.msx-emoji-tab { flex: 1; height: 32px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 16px; cursor: pointer; filter: grayscale(0.75); opacity: 0.8; padding: 0; }
.msx-emoji-tab:hover { filter: none; opacity: 1; }
.msx-emoji-tab.on { border-bottom-color: var(--brand); filter: none; opacity: 1; }
.msx-emoji-scroll { position: relative; height: 288px; overflow-y: auto; padding: 0 6px 6px; }
.msx-emoji-sechead { position: sticky; top: 0; z-index: 1; padding: 8px 4px 4px; background: var(--surface); font-size: 12px; font-weight: 700; color: var(--muted); }
:root[data-theme="midnight"] .msx-emoji-sechead { background: var(--surface-2, var(--surface)); }
.msx-emoji-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 1px; }
.msx-emoji-cell { aspect-ratio: 1; min-width: 0; overflow: hidden; border: 0; border-radius: 6px; background: none; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.msx-emoji-cell:hover, .msx-emoji-cell:focus-visible { background: var(--hover); outline: 0; box-shadow: inset 0 0 0 2px var(--brand); }
.msx-emoji-none { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.msx-emoji-nonebig { font-size: 30px; margin-bottom: 6px; }
.msx-emoji-foot { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--bg); }
.msx-emoji-prev { font-size: 26px; width: 30px; text-align: center; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.msx-emoji-prevtext { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .msx-modal-back.top { padding-top: 6vh; }
  .msx-modal-head { padding: 14px 14px 4px; }
  .msx-modal-body { padding: 10px 14px 6px; }
  .msx-modal-foot { padding: 10px 14px 14px; }
  .msx-browse-list { margin: 0 -14px; }
  .msx-browse-row { padding: 10px 14px; }
  .msx-switch-foot span:nth-child(n + 2) { display: none; }
}
