/* Suffah — X-style Notifications + Chat (Phase 54) */
.mobile-topbar--x { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; border-bottom: 1px solid transparent; }
.mobile-topbar--x > :first-child { justify-self: start; }
.mobile-topbar--x > :last-child { justify-self: end; }
.mobile-topbar__title { margin: 0; font-size: 1.35rem; font-weight: 800; text-align: center; }
.mobile-topbar__cancel { width: auto; font-size: 1.1rem; }
.mobile-topbar__done { border: 0; background: none; font: inherit; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); cursor: pointer; padding: 8px 4px; }
.mobile-topbar__done[disabled] { color: var(--text-tertiary); cursor: default; opacity: .7; }
.mobile-topbar--x:has(.xthread__who) { display: flex; gap: 8px; padding-right: 8px; border-bottom: 1px solid var(--border-color); }
.mobile-topbar--x:has(.xthread__who) .xchat__menuwrap { margin-left: auto; }

/* tabs */
.xtabs { display: flex; position: sticky; top: 56px; z-index: 5; background: var(--bg-primary); border-bottom: 1px solid var(--border-color); }
.xtabs__tab { flex: 1; text-align: center; color: var(--text-tertiary); font-size: 1.2rem; font-weight: 600; text-decoration: none; }
.xtabs__label { display: inline-flex; align-items: center; gap: 8px; padding: 16px 0 14px; border-bottom: 4px solid transparent; }
.xtabs__tab.is-on { color: var(--text-primary); font-weight: 800; }
.xtabs__tab.is-on .xtabs__label { border-bottom-color: var(--text-primary); border-radius: 2px; }

/* notification rows */
.xn { display: flex; gap: 8px; padding: 16px 16px 16px 12px; border-bottom: 1px solid var(--border-color); color: inherit; text-decoration: none; }
.xn--unread { background: var(--color-accent-subtle); }
.xn__side { flex: none; width: 48px; display: flex; justify-content: flex-end; padding-top: 2px; }
.xn__glyph { display: inline-flex; }
.xn__glyph--accent { color: var(--color-accent); }
.xn__glyph--like { color: #F91880; }
.xn__glyph--repost { color: #00BA7C; }
.xn__glyph--spark { color: #7856FF; }
.xn__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.xn__avatars { display: flex; gap: 8px; }
.xn__avatars .avatar { width: 32px; height: 32px; font-size: 13px; overflow: hidden; }
.xn__avatars .avatar img { width: 100%; height: 100%; object-fit: cover; }
.xn__text { font-size: 1.15rem; line-height: 1.35; }
.xn__time { color: var(--text-tertiary); }
.xn__excerpt { color: var(--text-tertiary); font-size: 1.1rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.xempty { padding: 32px 24px; }
.xempty__title { margin: 0 0 12px; font-size: 2.2rem; line-height: 1.15; font-weight: 800; }
.xempty__text { margin: 0 0 20px; color: var(--text-tertiary); font-size: 1.2rem; line-height: 1.4; }
.xempty__text a { color: var(--color-accent); text-decoration: none; }
.xempty__btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 30px; border-radius: 999px; background: var(--text-primary); color: var(--bg-primary); font-weight: 800; font-size: 1.2rem; text-decoration: none; }

/* chat */
.xchat { padding-bottom: 96px; }
.xchat__notice { margin: 8px 16px; padding: 12px 16px; border-radius: 12px; background: var(--bg-secondary); }
.xchat__menuwrap { position: relative; display: inline-flex; }
.xchat__pill { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-color-strong, var(--border-color)); background: none; color: var(--text-primary); font: inherit; font-size: 1.15rem; cursor: pointer; }
.xmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 300px; max-width: calc(100vw - 24px); background: var(--bg-primary); border-radius: 16px; box-shadow: 0 0 16px rgba(0,0,0,.25), 0 0 2px rgba(0,0,0,.2); overflow: hidden; }
.xmenu[hidden] { display: none; }
.xmenu--sm { width: 280px; }
.xmenu__item { display: flex; align-items: center; gap: 16px; width: 100%; box-sizing: border-box; padding: 16px; border: 0; background: none; font: inherit; font-size: 1.2rem; color: var(--text-primary); text-decoration: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--border-color); }
.xmenu__item:active { background: var(--bg-secondary); }
.xmenu__item span:first-of-type { flex: 1; }
.xmenu__check { margin-left: auto; display: inline-flex; }
.xmenu__form { margin: 0; }
.xmenu__sep { height: 12px; background: var(--bg-secondary); }
.xmenu__item--r { justify-content: space-between; font-weight: 500; }
.xmenu__item.is-danger { color: #f4212e; }
.xmenu--info { width: 290px; right: 0; top: calc(100% + 4px); }
.xchat__search { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 16px; height: 52px; border-radius: 999px; background: var(--bg-secondary); color: var(--text-tertiary); }
.xchat__search--left { justify-content: flex-start; padding: 0 18px; }
.xchat__search input { border: 0; background: none; font: inherit; font-size: 1.2rem; color: var(--text-primary); outline: none; min-width: 0; width: 80px; text-align: left; }
.xchat__search input:focus { width: 100%; }
.xchat__search--left input { width: 100%; }
.xchat__req { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: inherit; text-decoration: none; }
.xchat__req span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.xchat__req small { color: var(--text-tertiary); }
.xchat__reqicon { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-secondary); display: inline-flex; align-items: center; justify-content: center; }
.xchat__row, .xchat__sug, .xchat__person { display: flex; align-items: center; gap: 14px; width: 100%; box-sizing: border-box; padding: 12px 16px; color: inherit; text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.xchat__row:active, .xchat__person:active { background: var(--bg-secondary); }
.xchat__av { flex: none; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-tertiary, var(--bg-secondary)); }
.xchat__av img { width: 100%; height: 100%; object-fit: cover; }
.xchat__rowtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xchat__rowtop { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 1.2rem; }
.xchat__rowtop strong { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xchat__muted { color: var(--text-tertiary); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xchat__rowtop .xchat__muted { margin-left: 4px; }
.xchat__snippet { color: var(--text-tertiary); font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xchat__row.is-unread .xchat__snippet { color: var(--text-primary); font-weight: 600; }
.xchat__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--color-accent); flex: none; }
.xchat__empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px 28px; gap: 6px; }
.xchat__empty h2 { margin: 8px 0 0; font-size: 1.5rem; font-weight: 800; }
.xchat__empty p { margin: 0; color: var(--text-tertiary); font-size: 1.2rem; }
.xchat__rule { width: 55%; margin: 28px auto 24px; border: 0; border-top: 1px solid var(--border-color); }
.xchat__h { margin: 0; padding: 0 16px 8px; font-size: 1.3rem; font-weight: 800; }
.xchat__chatbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--bg-tertiary, #cfd9de); color: var(--text-primary); font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; text-decoration: none; }
.xchat__chatbtn--solid { background: var(--text-primary); color: var(--bg-primary); }
.xchat__group { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; background: none; font: inherit; font-size: 1.25rem; color: inherit; cursor: pointer; }
.xchat__group strong { flex: 1; text-align: left; font-weight: 800; }
.xchat__groupicon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-tertiary, #cfd9de); display: inline-flex; align-items: center; justify-content: center; }

/* thread */
body:has(.xthread) .mobile-nav, body:has(.xthread) .compose-fab, body:has(.xinfo) .mobile-nav, body:has(.xnick) .mobile-nav, body:has(.xchat__group) .mobile-nav { display: none; }
.xthread__who { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.xthread__whotx { display: flex; flex-direction: column; min-width: 0; }
.xthread__name { display: flex; align-items: center; gap: 4px; font-size: 1.3rem; }
.xthread__name strong { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xthread__enc { display: inline-flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 1.05rem; }
.xthread { display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.xthread__list { flex: 1; justify-content: flex-end; padding: 16px; gap: 6px; min-height: 0; }
.xthread__intro { align-self: center; text-align: center; color: var(--text-tertiary); font-size: 1.15rem; line-height: 1.5; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: auto 0 24px; }
.xthread__intro .xchat__chatbtn { margin-top: 12px; }
.xthread__none { text-align: center; color: var(--text-tertiary); }
.xthread__req { display: flex; gap: 8px; padding: 0 16px 16px; }
.xthread__search { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 0 14px; height: 46px; border-radius: 999px; background: var(--bg-secondary); color: var(--text-tertiary); }
.xthread__search[hidden] { display: none; }
.xthread__search input { flex: 1; border: 0; background: none; font: inherit; font-size: 1.1rem; color: var(--text-primary); outline: none; min-width: 0; }
.xthread__searchx { border: 0; background: none; color: inherit; display: inline-flex; cursor: pointer; }
.xmsg { max-width: 82%; padding: 12px 18px; border-radius: 24px; font-size: 1.2rem; line-height: 1.4; white-space: normal; }
.xmsg--mine { align-self: flex-end; background: var(--color-accent); color: var(--color-accent-contrast, #fff); border-bottom-right-radius: 8px; }
.xmsg--theirs { align-self: flex-start; background: var(--bg-secondary); color: var(--text-primary); border-bottom-left-radius: 8px; }
.xmsg img { max-width: 100%; border-radius: 14px; margin-top: 6px; display: block; }
.xmsg__text { display: block; white-space: pre-wrap; }
.xmsg.is-clamped .xmsg__text { display: -webkit-box; -webkit-line-clamp: 14; -webkit-box-orient: vertical; overflow: hidden; }
.xmsg__more { display: inline-block; margin-top: 2px; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.xmsg__stamp { align-self: center; color: var(--text-tertiary); font-size: 1.05rem; margin: 10px 0 2px; }
.xmsg__meta { align-self: flex-start; font-size: .95rem; color: var(--text-tertiary); margin: -2px 6px 4px; }
.xmsg.is-hit { outline: 2px solid var(--color-accent); }
.xcomposer { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; margin: 0 16px 12px; padding: 6px 8px 6px 14px; border: 1px solid var(--border-color-strong, var(--border-color)); border-radius: 26px; background: var(--bg-primary); }
.xcomposer__input { flex: 1; border: 0 !important; outline: none; background: none; resize: none; max-height: 140px; padding: 10px 0 !important; font: inherit; font-size: 1.2rem; color: var(--text-primary); }
.xcomposer__attach, .xcomposer__send { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--color-accent); cursor: pointer; border-radius: 50%; }

/* info */
.xinfo { display: flex; flex-direction: column; align-items: center; padding: 8px 16px 40px; }
.xinfo__name { display: flex; align-items: center; gap: 6px; margin: 22px 0 2px; font-size: 1.7rem; font-weight: 800; text-align: center; }
.xinfo__handle { color: var(--text-tertiary); font-size: 1.3rem; }
.xinfo__actions { display: flex; justify-content: space-between; width: 100%; max-width: 420px; margin: 30px 0 24px; }
.xinfo__act { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 1.15rem; color: var(--text-primary); text-decoration: none; cursor: pointer; }
.xinfo__act.is-off { color: var(--text-tertiary); cursor: default; }
.xinfo__circle { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-secondary); display: inline-flex; align-items: center; justify-content: center; }
.xinfo__act.is-off .xinfo__circle { color: var(--text-tertiary); }
.xinfo__more { flex-direction: column; }
.xinfo__card { width: 100%; max-width: 480px; background: var(--bg-secondary); border-radius: 16px; overflow: hidden; }
.xinfo__row { display: flex; align-items: center; gap: 14px; padding: 18px 16px; color: inherit; text-decoration: none; font-size: 1.3rem; border-top: 1px solid var(--border-color); }
.xinfo__row:first-child { border-top: 0; }
.xinfo__row span { flex: 1; }
.xinfo__row em { font-style: normal; color: var(--text-tertiary); }
.xinfo__row.is-off { color: var(--text-tertiary); opacity: .7; }
.xinfo__note { color: var(--text-tertiary); font-size: 1.05rem; text-align: center; margin: 14px 0 0; }
.xmenu--info { position: absolute; right: 0; top: 100%; }
.xinfo__more .xmenu { position: absolute; }

/* nickname */
.xnick { padding: 16px; }
.xnick__info { display: flex; align-items: center; gap: 18px; margin: 12px 8px 24px; color: var(--text-tertiary); font-size: 1.2rem; }
.xnick__label { display: block; margin: 0 8px 10px; color: var(--text-tertiary); font-size: 1.2rem; }
.xnick__field { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 18px; border: 1px solid var(--border-color-strong, var(--border-color)); border-radius: 999px; color: var(--text-tertiary); }
.xnick__field input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 1.2rem; color: var(--text-primary); }
.xnick__field:focus-within { border-color: var(--color-accent); }

/* media */
.xgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.xgrid__cell { aspect-ratio: 1; overflow: hidden; background: var(--bg-secondary); }
.xgrid__cell img { width: 100%; height: 100%; object-fit: cover; }
.xlink { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); color: inherit; text-decoration: none; }
.xlink span { display: flex; flex-direction: column; min-width: 0; }
.xlink small { color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xcomposer .rte-editor { flex: 1; min-width: 0; max-height: 140px; padding: 10px 0; font-size: 1.2rem; color: var(--text-primary); line-height: 1.35; }
