/* v30 — focused discover, profile, and mobile layout repairs. */
.discover-filter-panel{display:grid;grid-template-columns:minmax(180px,.7fr) minmax(240px,1fr) auto;gap:14px;align-items:end;margin-bottom:14px;padding:18px;border:1px solid var(--line);border-radius:22px;background:var(--card)}
.discover-filter-panel .field{margin:0;min-width:0}.discover-filter-panel .field>span{display:block;margin-bottom:7px;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.discover-filter-panel select{width:100%;height:46px}.discover-filter-reset{height:46px;white-space:nowrap}.discover-shortcuts{margin:0 0 10px}.discover-result-count{margin:0 0 14px;color:var(--muted);font-size:11px}
.profile-interest-block{display:grid;gap:8px;margin:15px 0 4px}.profile-interest-block>small{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.profile-interest-block .tag-row{margin:0}.profile-interest-block .tag-row span{background:color-mix(in srgb,var(--accent) 8%,var(--soft));border-color:color-mix(in srgb,var(--accent) 15%,var(--line))}
@media(max-width:760px){
html,body{max-width:100%;overflow-x:clip}.stage{width:100%;min-width:0;padding:18px 13px calc(98px + env(safe-area-inset-bottom))}.page-title{gap:14px;margin-bottom:20px}.page-title h1{font-size:clamp(30px,9vw,42px);line-height:1.06}
.discover-filter-panel{grid-template-columns:1fr 1fr;padding:14px;border-radius:19px}.discover-filter-reset{grid-column:1/-1;width:100%}.discover-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;padding:0}.discover-shortcuts button{min-width:0;padding-inline:8px;white-space:normal}.connections-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow:visible;padding:0}.connections-tabs button{width:100%;min-width:0;white-space:normal}.connections-tabs button:last-child:nth-child(odd){grid-column:1/-1}
.page-title:has(.page-actions){display:grid;grid-template-columns:minmax(0,1fr);align-items:start}.page-title>.page-actions{display:grid!important;grid-template-columns:minmax(0,1fr) 46px;width:100%;gap:10px}.page-title>.page-actions .secondary{width:100%;min-width:0}.page-title>.page-actions .primary{width:46px;min-width:46px;margin:0}
.messages{width:100%;max-width:100%;height:calc(100dvh - 196px);min-height:0;overflow:hidden}.messages .chat,.messages .thread-list{width:100%;min-width:0;max-width:100%}.messages .thread-list{display:block;border-inline-end:0}.messages:not(.mobile-thread-open) .chat{display:none}.messages.mobile-thread-open .thread-list{display:none}.messages .chat{min-height:0;overflow:hidden}.messages .chat-flow{min-height:0;overflow-y:auto}.messages.mobile-thread-open{grid-template-columns:minmax(0,1fr)}.messages.mobile-thread-open .chat{display:flex;width:100%;min-width:0}.thread-head .round-btn[data-new-chat]{display:grid;place-items:center;width:42px;height:42px;min-width:42px;padding:0;font-size:21px;line-height:1}.chat-head [data-mobile-threads]{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;padding:0}.chat-message .bubble{position:relative}.chat-message .bubble .content-menu{position:absolute;inset-inline-end:6px;top:6px;width:30px;min-width:30px;height:30px;padding:0;z-index:1}.chat-message .bubble:has(.content-menu){padding-inline-end:48px}.chat-head{min-width:0;padding-inline:11px;gap:8px}.chat-head .author-link{min-width:0;flex:1}.chat-head .author-link>span{min-width:0}.chat-head .author-link b,.chat-head .author-link small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-head .chat-delete{flex:0 0 38px}.chat-flow{min-width:0;padding:16px 12px;overscroll-behavior:contain}.chat-message{min-width:0;max-width:100%}.chat-message .bubble{min-width:0;max-width:min(78%,520px);overflow-wrap:anywhere}.chat-form{align-self:stretch;width:auto!important;max-width:none;margin:10px 12px calc(10px + env(safe-area-inset-bottom))!important;box-sizing:border-box}.chat-form input{width:0;min-width:0;flex:1}
.profile-interest-block{justify-items:center}.profile-interest-block .tag-row{justify-content:center}body.rtl .profile-interest-block{justify-items:center}}
@media(max-width:600px){.top{height:auto!important;min-height:116px;padding:10px 13px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px 48px;gap:8px 10px;align-content:center}.wordmark{grid-column:1;grid-row:1;min-width:0}.wordmark b{font-size:17px;white-space:nowrap}.top-actions{grid-column:2;grid-row:1;justify-self:end;min-width:0}.top-actions .round-btn,.top-actions .mini-avatar{width:38px;height:38px;flex-basis:38px;border-radius:12px}.top-actions .round-btn svg{width:17px;height:17px}.search{grid-column:1/-1;grid-row:2;width:100%;max-width:none;height:46px;margin:0}.search input{min-width:0;font-size:14px}.search .search-submit{width:38px;height:38px;flex:0 0 38px} .messages{height:calc(100dvh - 278px);min-height:0;margin-bottom:74px;border-radius:22px}.chat-flow{padding:14px 10px}.chat-form{margin-inline:10px!important}}
@media(max-width:430px){.discover-filter-panel{grid-template-columns:1fr;gap:11px}.discover-filter-reset{grid-column:auto}.page-title>.page-actions{grid-template-columns:minmax(0,1fr) 44px}.page-title>.page-actions .primary{width:44px;min-width:44px}.profile-hero{padding-inline:18px}.profile-interest-block .tag-row{gap:6px}.profile-interest-block .tag-row span{font-size:9px}}

/* Mobile create buttons: keep the compact + visually centered. */
@media(max-width:480px){
  .page-title{grid-template-columns:minmax(0,1fr) 52px;column-gap:12px}
  .page-title>.primary{grid-column:2;grid-row:1 / span 2;align-self:start;justify-self:end;display:grid;place-items:center;box-sizing:border-box;width:52px;height:52px;min-width:52px;min-height:52px;padding:0!important;line-height:1;font-size:0;border-radius:16px}
  .page-title>.primary:after{content:"+";display:grid;place-items:center;width:100%;height:100%;font-size:24px;font-weight:700;line-height:1;transform:none}
  .page-title>.circle-create-button:after{align-content:center;justify-content:center;padding-bottom:2px;line-height:1}
}


/* v60 — mobile comments, Circle header actions and WhatsApp-like Messages */
@media(max-width:760px){
  /* Keep comment actions on one compact row whenever the phone width allows it.
     Delete no longer drops into an isolated second line. */
  .reply-actions,
  .article-comment-actions{
    flex-wrap:nowrap!important;
    gap:1px!important;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    padding-bottom:2px;
  }
  .reply-actions::-webkit-scrollbar,
  .article-comment-actions::-webkit-scrollbar{display:none}
  .reply-actions .reply-action,
  .reply-actions button,
  .article-comment-actions button{
    flex:0 0 auto;
    min-width:0!important;
    min-height:30px!important;
    height:30px!important;
    padding:3px 6px!important;
    border-radius:8px!important;
    white-space:nowrap;
    font-size:9px!important;
  }
  .reply-actions [data-delete-reply],
  .article-comment-actions [data-article-delete]{
    margin-inline-start:1px!important;
    padding-inline:6px!important;
  }
  .reply-actions .creator-heart,
  .reply-actions .creator-heart-toggle,
  .article-comment-actions .creator-heart,
  .article-comment-actions .creator-heart-toggle{
    flex:0 0 28px!important;
    width:28px!important;
    min-width:28px!important;
    height:28px!important;
    min-height:28px!important;
  }

  /* Circle hero actions: no clipped text inside the green Manage Circle button. */
  .circle-hero .profile-hero-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
    width:100%!important;
    justify-content:stretch!important;
  }
  .circle-hero .profile-hero-actions button,
  .circle-hero .profile-hero-actions .primary,
  .circle-hero .profile-hero-actions .secondary{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding-inline:10px!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    justify-content:center;
  }

  /* Messages gets the full mobile content width instead of looking like a desktop card. */
  .view:has(.messages){
    width:calc(100% + 26px);
    max-width:none;
    margin-inline:-13px;
  }
  .messages{
    width:100%!important;
    max-width:none!important;
    margin-inline:0!important;
    border-inline:0!important;
    border-radius:0!important;
    background:var(--card);
  }
  .messages .thread-list,
  .messages .chat{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }

  /* WhatsApp-like conversation list. */
  .thread-head{
    height:64px;
    padding-inline:16px;
  }
  .thread-search{
    width:calc(100% - 28px);
    height:42px;
    margin:10px 14px 7px;
    border-radius:14px;
    background:var(--soft);
  }
  .thread-list-scroll{
    height:calc(100% - 123px);
    padding:2px 0 10px;
  }
  .thread{
    min-height:70px;
    padding:10px 15px;
    gap:11px;
    border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent);
  }
  .thread:last-child{border-bottom:0}
  .thread .avatar{
    width:48px;
    height:48px;
    flex:0 0 48px;
    border-radius:15px;
  }
  .thread>div{flex:1;min-width:0}
  .thread b{font-size:13px;line-height:1.25}
  .thread small{margin-top:3px;font-size:10.5px}
  .thread time{flex:0 0 auto;font-size:9px}
  .thread.active{background:color-mix(in srgb,var(--accent) 8%,var(--card))}

  /* Open conversation: full-screen-like, compact header, proper bubbles and composer. */
  .messages.mobile-thread-open{
    height:calc(100dvh - 116px - env(safe-area-inset-bottom))!important;
    margin-bottom:0!important;
  }
  .messages.mobile-thread-open .chat{
    display:flex!important;
    flex-direction:column;
    height:100%;
    border:0;
  }
  .messages.mobile-thread-open .chat-head{
    flex:0 0 62px;
    height:62px;
    padding-inline:10px 12px;
    gap:8px;
    background:var(--card);
  }
  .messages.mobile-thread-open .chat-head .avatar{
    width:38px;
    height:38px;
    flex:0 0 38px;
    border-radius:12px;
  }
  .messages.mobile-thread-open .chat-flow{
    flex:1 1 auto;
    min-height:0;
    padding:12px 10px 8px!important;
    gap:5px!important;
    background:color-mix(in srgb,var(--soft) 35%,var(--card));
    scroll-padding-bottom:76px;
  }
  .messages.mobile-thread-open .chat-message{
    width:100%;
    max-width:100%;
    gap:6px;
    align-items:flex-end;
  }
  .messages.mobile-thread-open .chat-message.grouped .avatar{
    visibility:hidden;
  }
  .messages.mobile-thread-open .chat-message .avatar{
    width:28px;
    height:28px;
    flex:0 0 28px;
    border-radius:9px;
  }
  .messages.mobile-thread-open .chat-message .bubble{
    max-width:82%!important;
    min-width:0;
    padding:8px 10px!important;
    border-radius:15px!important;
    background:var(--soft);
    box-shadow:0 1px 1px rgba(0,0,0,.04);
    overflow-wrap:anywhere;
  }
  .messages.mobile-thread-open .chat-message.mine .bubble,
  .messages.mobile-thread-open .chat-message .bubble.mine{
    margin-inline-start:auto;
    background:var(--accent)!important;
    color:#fff!important;
    border-end-end-radius:5px!important;
  }
  .messages.mobile-thread-open .chat-message:not(.mine) .bubble{
    border-end-start-radius:5px!important;
  }
  .messages.mobile-thread-open .bubble time{
    margin-top:3px;
    opacity:.7;
    font-size:8px;
    text-align:end;
  }
  .messages.mobile-thread-open .chat-form{
    position:relative;
    flex:0 0 auto;
    width:auto!important;
    margin:7px 9px calc(8px + env(safe-area-inset-bottom))!important;
    padding:6px!important;
    gap:6px;
    min-height:52px;
    border-radius:26px!important;
    background:var(--card);
    box-shadow:0 1px 8px rgba(0,0,0,.06);
  }
  .messages.mobile-thread-open .chat-form input,
  .messages.mobile-thread-open .chat-form textarea{
    min-width:0;
    min-height:38px;
    flex:1;
    padding-inline:8px;
    border:0;
    outline:0;
    background:transparent;
    color:var(--ink);
    font:inherit;
  }
  .messages.mobile-thread-open .chat-form button{
    width:40px;
    height:40px;
    min-width:40px;
    border-radius:50%!important;
    display:grid;
    place-items:center;
  }
}

@media(max-width:380px){
  .reply-actions .reply-action,
  .reply-actions button,
  .article-comment-actions button{
    padding-inline:5px!important;
    font-size:8.5px!important;
  }
}


/* v60.1 — make the mobile conversation column actually occupy the whole Messages width */
@media(max-width:760px){
  .messages:not(.mobile-thread-open){
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  .messages:not(.mobile-thread-open) .thread-list{
    grid-column:1/-1!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    justify-self:stretch!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
  }
  .messages:not(.mobile-thread-open) .thread-head,
  .messages:not(.mobile-thread-open) .thread-list-scroll{
    width:100%!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
  .messages:not(.mobile-thread-open) .thread-head{
    justify-content:space-between!important;
  }
  .messages:not(.mobile-thread-open) .thread-search{
    display:block!important;
    width:calc(100% - 28px)!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
  .messages:not(.mobile-thread-open) .thread{
    width:100%!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
}


/* v61 — mobile DM visual repair: cleaner WhatsApp-like conversation */
@media(max-width:760px){
  /* When a conversation is open, remove the large global search row so the chat has room. */
  body:has(.messages.mobile-thread-open) .top{
    min-height:58px!important;
    height:58px!important;
    padding:5px 13px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:48px!important;
    align-content:center!important;
  }
  body:has(.messages.mobile-thread-open) .top>.search{
    display:none!important;
  }
  body:has(.messages.mobile-thread-open) .wordmark{
    grid-column:1!important;
    grid-row:1!important;
  }
  body:has(.messages.mobile-thread-open) .top-actions{
    grid-column:2!important;
    grid-row:1!important;
  }
  body:has(.messages.mobile-thread-open) .stage{
    padding-top:0!important;
  }

  .messages.mobile-thread-open{
    height:calc(100dvh - 58px - 82px - env(safe-area-inset-bottom))!important;
    min-height:0!important;
    margin-bottom:82px!important;
  }
  .messages.mobile-thread-open .chat-head{
    border-bottom:1px solid var(--line)!important;
  }

  /* Direct messages do not need repeated avatars on every bubble; the header already identifies the person. */
  .messages.mobile-thread-open .chat-message>.avatar{
    display:none!important;
  }
  .messages.mobile-thread-open .chat-message{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:0!important;
  }
  .messages.mobile-thread-open .chat-message.mine{
    justify-content:flex-end!important;
    flex-direction:row!important;
  }
  .messages.mobile-thread-open .chat-message:not(.mine){
    justify-content:flex-start!important;
  }

  .messages.mobile-thread-open .chat-flow{
    padding:12px 10px 10px!important;
    gap:4px!important;
    background:color-mix(in srgb,var(--soft) 32%,var(--card))!important;
  }
  .messages.mobile-thread-open .chat-message .bubble{
    position:relative!important;
    width:auto!important;
    max-width:78%!important;
    min-width:54px!important;
    padding:8px 10px 6px!important;
    border-radius:14px!important;
    box-sizing:border-box!important;
    box-shadow:0 1px 1px rgba(0,0,0,.04)!important;
  }
  .messages.mobile-thread-open .chat-message.mine .bubble{
    margin-inline:0!important;
    background:var(--accent)!important;
    color:#fff!important;
    border-end-end-radius:4px!important;
  }
  .messages.mobile-thread-open .chat-message:not(.mine) .bubble{
    margin-inline:0!important;
    background:var(--soft)!important;
    border-end-start-radius:4px!important;
  }
  .messages.mobile-thread-open .message-text{
    display:block;
    font-size:13px!important;
    line-height:1.45!important;
    overflow-wrap:anywhere!important;
    word-break:break-word;
    unicode-bidi:plaintext;
    text-align:start;
  }
  .messages.mobile-thread-open .bubble time{
    display:block!important;
    margin-top:3px!important;
    padding-inline-end:0!important;
    font-size:7.5px!important;
    line-height:1.2!important;
    opacity:.68!important;
    text-align:end!important;
    white-space:nowrap;
  }

  /* Keep delete available without placing a grey square on top of the message text. */
  .messages.mobile-thread-open .chat-message .content-menu{
    position:absolute!important;
    top:50%!important;
    inset-inline-end:auto!important;
    inset-inline-start:-26px!important;
    transform:translateY(-50%)!important;
    width:22px!important;
    min-width:22px!important;
    height:28px!important;
    padding:0!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--muted)!important;
    font-size:0!important;
    opacity:.72;
  }
  .messages.mobile-thread-open .chat-message .content-menu::before{
    content:"•••";
    display:block;
    font-size:12px;
    letter-spacing:-1px;
    line-height:28px;
    text-align:center;
  }
  .messages.mobile-thread-open .chat-message:not(.mine) .content-menu{
    inset-inline-start:auto!important;
    inset-inline-end:-26px!important;
  }
  .messages.mobile-thread-open .chat-message .bubble:has(.content-menu){
    padding-inline-end:10px!important;
  }

  .messages.mobile-thread-open .chat-form{
    margin:7px 9px 8px!important;
    min-height:50px!important;
    border-radius:25px!important;
    background:var(--card)!important;
  }
}


/* v62 — center all mobile + controls, lock open DM to viewport, hide delete until long-press */
@media(max-width:760px){
  /* Any compact create/+ control should visually center its plus glyph. */
  .thread-head .round-btn[data-new-chat],
  .page-title>.primary,
  .page-title>.circle-create-button{
    display:grid!important;
    place-items:center!important;
    align-content:center!important;
    justify-content:center!important;
    text-align:center!important;
    line-height:1!important;
  }
  .thread-head .round-btn[data-new-chat]{
    padding:0!important;
    font-size:0!important;
  }
  .thread-head .round-btn[data-new-chat]::after{
    content:"+";
    display:grid;
    place-items:center;
    width:100%;
    height:100%;
    font-size:22px;
    font-weight:700;
    line-height:1;
    transform:translateY(-1px);
  }
  .page-title>.primary::after,
  .page-title>.circle-create-button::after{
    margin:0!important;
    line-height:1!important;
    transform:none!important;
  }

  /* Delete is not a permanent visual affordance on phone DMs. Long-press reveals actions. */
  .messages.mobile-thread-open .chat-message .content-menu{
    display:none!important;
  }
  .messages.mobile-thread-open .chat-message .bubble:has(.content-menu){
    padding-inline-end:10px!important;
  }

  /* Keep chat header + composer inside one viewport: no page scrolling to reach either end. */
  body:has(.messages.mobile-thread-open){
    height:100dvh;
    overflow:hidden!important;
  }
  body:has(.messages.mobile-thread-open) .stage{
    height:calc(100dvh - 58px)!important;
    min-height:0!important;
    padding:0 0 calc(82px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body:has(.messages.mobile-thread-open) .view:has(.messages){
    height:100%!important;
    min-height:0!important;
    width:100%!important;
    margin:0!important;
  }
  .messages.mobile-thread-open{
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  .messages.mobile-thread-open .chat{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .messages.mobile-thread-open .chat-head{
    position:relative;
    z-index:3;
    flex:0 0 62px!important;
  }
  .messages.mobile-thread-open .chat-flow{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }
  .messages.mobile-thread-open .chat-form{
    position:relative!important;
    z-index:3;
    flex:0 0 auto!important;
    margin:7px 9px 8px!important;
  }

  /* Long-press action sheet on mobile web. */
  .mobile-message-action-list{
    display:grid;
    gap:8px;
  }
  .mobile-message-action-list .account-row{
    width:100%;
    min-height:54px;
    text-align:start;
  }
  .mobile-message-action-list .danger{
    color:#a43d2f!important;
    background:color-mix(in srgb,#a43d2f 10%,var(--card))!important;
  }
}


/* v62.1 — restore clear vertical separation between mobile DM bubbles */
@media(max-width:760px){
  .messages.mobile-thread-open .chat-flow{
    gap:0!important;
  }
  .messages.mobile-thread-open .chat-message{
    flex:0 0 auto!important;
    margin:0!important;
    padding:0!important;
  }
  .messages.mobile-thread-open .chat-message + .chat-message{
    margin-top:8px!important;
  }
  .messages.mobile-thread-open .chat-message.grouped + .chat-message.grouped,
  .messages.mobile-thread-open .chat-message.grouped + .chat-message:not(.grouped){
    margin-top:5px!important;
  }
  .messages.mobile-thread-open .chat-message .bubble{
    display:block!important;
    flex:0 0 auto!important;
  }
}


/* v63 — mobile discussion reply alignment and single-row actions */
@media(max-width:760px){
  /* Replies should feel like a subtle indent, not a second nested column. */
  .reply-children{
    width:calc(100% - 16px)!important;
    margin-inline-start:16px!important;
  }
  .rtl .reply-children{
    margin-inline-start:0!important;
    margin-inline-end:16px!important;
  }

  .reply-card.is-reply .reply-body{
    margin-inline-start:46px!important;
  }
  .rtl .reply-card.is-reply .reply-body{
    margin-inline-start:0!important;
    margin-inline-end:46px!important;
  }

  .reply-card.is-reply .reply-actions{
    margin-inline-start:46px!important;
  }
  .rtl .reply-card.is-reply .reply-actions{
    margin-inline-start:0!important;
    margin-inline-end:46px!important;
  }

  /* All reply actions stay on one clean row. */
  .reply-card.is-reply .reply-actions{
    display:flex!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:2px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .reply-card.is-reply .reply-actions::-webkit-scrollbar{display:none}
  .reply-card.is-reply .reply-actions .reply-action,
  .reply-card.is-reply .reply-actions button{
    flex:0 0 auto!important;
    min-width:0!important;
    height:30px!important;
    min-height:30px!important;
    padding:3px 6px!important;
    white-space:nowrap!important;
    font-size:9px!important;
  }
  .reply-card.is-reply .reply-actions .creator-heart,
  .reply-card.is-reply .reply-actions .creator-heart-toggle{
    flex:0 0 28px!important;
    width:28px!important;
    min-width:28px!important;
    height:28px!important;
    min-height:28px!important;
  }
}


/* v64 — mobile keeps the same unified comment geometry */
@media(max-width:760px){
  .reply-children,
  .article-comment-replies{
    width:calc(100% - 16px)!important;
    margin-inline-start:16px!important;
  }
  .rtl .reply-children,
  .rtl .article-comment-replies{
    margin-inline-start:0!important;
    margin-inline-end:16px!important;
  }
  .reply-actions,
  .article-comment-actions{
    flex-wrap:nowrap!important;
    gap:2px!important;
  }
  .reply-actions .reply-action,
  .reply-actions button,
  .article-comment-actions button{
    height:30px!important;
    min-height:30px!important;
    padding:3px 6px!important;
    font-size:9px!important;
  }
}


/* v68 — tiny permanent delete button outside mobile message bubbles */
@media(max-width:760px){
  .messages.mobile-thread-open .chat-message .bubble{
    position:relative!important;
    overflow:visible!important;
  }
  .messages.mobile-thread-open .chat-message .content-menu{
    display:grid!important;
    place-items:center!important;
    position:absolute!important;
    top:50%!important;
    inset-inline-end:auto!important;
    inset-inline-start:-21px!important;
    transform:translateY(-50%)!important;
    width:17px!important;
    min-width:17px!important;
    height:17px!important;
    min-height:17px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid color-mix(in srgb,#a53a2d 38%,var(--line))!important;
    border-radius:5px!important;
    background:var(--card)!important;
    color:#a53a2d!important;
    box-shadow:none!important;
    font-size:11px!important;
    font-weight:700!important;
    line-height:1!important;
    opacity:.82!important;
    z-index:3!important;
  }
  .messages.mobile-thread-open .chat-message .content-menu::before{
    content:none!important;
  }
  .messages.mobile-thread-open .chat-message:not(.mine) .content-menu{
    inset-inline-start:auto!important;
    inset-inline-end:-21px!important;
  }
  .messages.mobile-thread-open .chat-message .bubble:has(.content-menu){
    padding-inline-end:10px!important;
  }
}


/* v76 — place tiny delete at the message's outer top corner */
@media(max-width:760px){
  .messages.mobile-thread-open .chat-message .content-menu{
    top:-6px!important;
    inset-inline-start:-8px!important;
    inset-inline-end:auto!important;
    transform:none!important;
  }
  .messages.mobile-thread-open .chat-message:not(.mine) .content-menu{
    inset-inline-start:auto!important;
    inset-inline-end:-8px!important;
  }
}


/* v77 — softer mobile delete affordance */
@media(max-width:760px){
  .messages.mobile-thread-open .chat-message .content-menu{
    opacity:.42!important;
    background:color-mix(in srgb,var(--card) 62%,transparent)!important;
    border-color:color-mix(in srgb,#a53a2d 24%,var(--line))!important;
  }
}


/* v79 — phone posts use the exact Article-comment geometry */
@media(max-width:760px){
  .reply-card,
  .reply-card.nested,
  .reply-card.is-reply{
    padding:14px 2px 12px!important;
  }
  .reply-head .avatar,
  .reply-card.is-reply .reply-head .avatar{
    width:40px!important;
    height:40px!important;
    flex:0 0 40px!important;
    border-radius:13px!important;
  }
  .reply-children{
    width:calc(100% - 16px)!important;
    margin-inline-start:16px!important;
  }
  body.rtl .reply-children{
    margin-inline-start:0!important;
    margin-inline-end:16px!important;
  }
  .reply-actions{
    flex-wrap:nowrap!important;
    gap:2px!important;
  }
  .reply-actions .reply-action,
  .reply-actions button{
    height:30px!important;
    min-height:30px!important;
    padding:3px 6px!important;
    font-size:9px!important;
  }
}


/* v82 — mobile settings/action-sheet sizing */
@media(max-width:760px){
  #modalRoot .modal:has([data-setting-plus]){
    width:calc(100vw - 22px)!important;
    max-height:78dvh!important;
    overflow-y:auto!important;
    padding:18px!important;
  }
  #modalRoot .message-actions-modal{
    width:calc(100vw - 34px)!important;
    max-width:390px!important;
    padding:16px!important;
  }
  .dm-reply-preview{margin-inline:9px!important}
}


/* v85 — WhatsApp-style swipe-right to reply in mobile DMs */
@media(max-width:760px){
  #chatFlow>.chat-message{
    position:relative;
    transform:translateX(var(--swipe-reply-x,0));
    transition:transform .16s ease;
    will-change:transform;
  }
  #chatFlow>.chat-message.swipe-reply-active{
    transition:none;
  }
  #chatFlow>.chat-message::before{
    content:"↩";
    position:absolute;
    top:50%;
    left:-32px;
    width:24px;
    height:24px;
    display:grid;
    place-items:center;
    transform:translateY(-50%) scale(.85);
    border-radius:50%;
    background:var(--accent);
    color:#fff;
    opacity:0;
    font-size:13px;
    font-weight:800;
    pointer-events:none;
    transition:opacity .12s ease,transform .12s ease;
  }
  #chatFlow>.chat-message.swipe-reply-active::before{
    opacity:.55;
  }
  #chatFlow>.chat-message.swipe-reply-ready::before{
    opacity:1;
    transform:translateY(-50%) scale(1);
  }
}

/* v91 — APK/mobile DM gestures */
@media(max-width:760px){
  #chatFlow > .chat-message,
  #chatFlow > .chat-message .bubble{
    touch-action:pan-y!important;
    -webkit-user-select:none;
    user-select:none;
  }
  #chatFlow > .chat-message .message-text,
  #circleChatFlow > .chat-message .message-text{
    -webkit-user-select:none!important;
    user-select:none!important;
    -webkit-touch-callout:none!important;
  }
  #chatFlow > .chat-message,
  #chatFlow > .chat-message .bubble,
  #circleChatFlow > .chat-message,
  #circleChatFlow > .chat-message .bubble{
    -webkit-touch-callout:none!important;
  }
}

/* v96 — Circle chat uses the same mobile geometry and behavior as Direct Messages */
@media(max-width:760px){
  .dm-like-circle-chat{
    height:calc(100dvh - 58px - 82px - env(safe-area-inset-bottom))!important;
    min-height:0!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    background:var(--card)!important;
  }
  .dm-like-circle-chat .circle-chat-head{
    flex:0 0 62px!important;
    height:62px!important;
    gap:8px!important;
    padding:10px 12px!important;
  }
  .dm-like-circle-chat .chat-flow{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    padding:12px 10px 10px!important;
    background:color-mix(in srgb,var(--soft) 32%,var(--card))!important;
  }
  .dm-like-circle-chat .chat-message{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:6px!important;
    align-items:flex-end!important;
    margin:0!important;
    padding:0!important;
  }
  .dm-like-circle-chat .chat-message + .chat-message{margin-top:8px!important}
  .dm-like-circle-chat .chat-message.grouped + .chat-message{margin-top:5px!important}
  .dm-like-circle-chat .chat-message.mine{justify-content:flex-end!important}
  .dm-like-circle-chat .chat-message:not(.mine){justify-content:flex-start!important}
  .dm-like-circle-chat .chat-message>.avatar{
    width:28px!important;height:28px!important;flex:0 0 28px!important;border-radius:9px!important;
  }
  .dm-like-circle-chat .chat-message.mine>.avatar{display:none!important}
  .dm-like-circle-chat .chat-message.grouped>.avatar{visibility:hidden!important}
  .dm-like-circle-chat .circle-message-stack{max-width:78%!important}
  .dm-like-circle-chat .chat-message .bubble{
    width:auto!important;
    max-width:100%!important;
    min-width:54px!important;
    padding:8px 10px 6px!important;
    border-radius:14px!important;
    box-sizing:border-box!important;
    box-shadow:0 1px 1px rgba(0,0,0,.04)!important;
  }
  .dm-like-circle-chat .chat-message.mine .bubble{
    background:var(--accent)!important;color:#fff!important;border-end-end-radius:4px!important;
  }
  .dm-like-circle-chat .chat-message:not(.mine) .bubble{
    background:var(--soft)!important;border-end-start-radius:4px!important;
  }
  .dm-like-circle-chat .message-text{display:block;font-size:13px!important;line-height:1.45!important;overflow-wrap:anywhere!important;word-break:break-word;unicode-bidi:plaintext;text-align:start}
  .dm-like-circle-chat .bubble time{display:block!important;margin-top:3px!important;font-size:7.5px!important;line-height:1.2!important;opacity:.68!important;text-align:end!important;white-space:nowrap}
  .dm-like-circle-chat .chat-form{
    position:relative!important;z-index:3;flex:0 0 auto!important;width:auto!important;
    margin:7px 9px 8px!important;padding:6px!important;gap:6px!important;min-height:50px!important;
    border-radius:25px!important;background:var(--card)!important;box-shadow:0 1px 8px rgba(0,0,0,.06)!important;
  }
  .dm-like-circle-chat .chat-form input{min-width:0!important;min-height:38px!important;flex:1!important;padding-inline:8px!important;border:0!important;outline:0!important;background:transparent!important;color:var(--ink)!important;font:inherit!important}
  .dm-like-circle-chat .chat-form button{width:40px!important;height:40px!important;min-width:40px!important;border-radius:50%!important;display:grid!important;place-items:center!important}
  #circleChatFlow>.chat-message{touch-action:pan-y!important}
}

/* v97 — pin Circle chat header/composer to the viewport exactly like open DMs */
@media(max-width:760px){
  body:has(.dm-like-circle-chat){
    height:100dvh!important;
    overflow:hidden!important;
  }
  body:has(.dm-like-circle-chat) .top{
    min-height:58px!important;
    height:58px!important;
    padding:5px 13px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:48px!important;
    align-content:center!important;
  }
  body:has(.dm-like-circle-chat) .top>.search{display:none!important}
  body:has(.dm-like-circle-chat) .stage{
    height:calc(100dvh - 58px)!important;
    min-height:0!important;
    padding:0 0 calc(82px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body:has(.dm-like-circle-chat) #view{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body:has(.dm-like-circle-chat) .circle-hero,
  body:has(.dm-like-circle-chat) .circle-tabs{
    display:none!important;
  }
  .dm-like-circle-chat{
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  .dm-like-circle-chat .circle-chat-head{
    position:relative!important;
    z-index:3!important;
    flex:0 0 62px!important;
  }
  .dm-like-circle-chat .circle-chat-back{
    display:grid!important;
    place-items:center!important;
    flex:0 0 38px!important;
    width:38px!important;
    height:38px!important;
    padding:0!important;
  }
  .dm-like-circle-chat #circleChatFlow{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }
  .dm-like-circle-chat .dm-reply-preview,
  .dm-like-circle-chat #circleChatForm{
    position:relative!important;
    z-index:3!important;
    flex:0 0 auto!important;
  }
  .dm-like-circle-chat #circleChatForm{
    margin:7px 9px 8px!important;
  }
}

@media(max-width:760px){
  .circle-chat-mark{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    padding:0!important;
    line-height:1!important;
  }
}

@media(max-width:760px){
  #modalRoot .message-actions-modal [data-mobile-delete-message],
  #modalRoot .message-actions-modal [data-native-delete-message]{
    -webkit-user-select:none!important;
    user-select:none!important;
    -webkit-touch-callout:none!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent!important;
  }
}


/* v104 — desktop-only inline message delete; mobile web/app use long-press actions */
@media(max-width:760px){
  .chat-message .content-menu,
  .messages.mobile-thread-open .chat-message .content-menu,
  .dm-like-circle-chat .chat-message .content-menu{
    display:none!important;
  }
  .chat-message .bubble:has(.content-menu),
  .messages.mobile-thread-open .chat-message .bubble:has(.content-menu),
  .dm-like-circle-chat .chat-message .bubble:has(.content-menu){
    padding-inline-end:10px!important;
  }
}


/* v105 — compact horizontal person cards for Discover + Connections (mobile only) */
@media(max-width:760px){
  .people-grid>.student-card,
  .connections-tabs + .grid-3>.student-card{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 94px!important;
    grid-template-rows:auto auto auto!important;
    column-gap:14px!important;
    row-gap:7px!important;
    align-items:center!important;
    min-height:0!important;
    padding:15px 16px!important;
    border-radius:22px!important;
  }

  .people-grid>.student-card>.person-card-head,
  .connections-tabs + .grid-3>.student-card>.person-card-head{
    grid-column:1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:54px minmax(0,1fr)!important;
    gap:12px!important;
    align-items:center!important;
    min-width:0!important;
  }

  .people-grid>.student-card>.person-card-head .avatar,
  .connections-tabs + .grid-3>.student-card>.person-card-head .avatar{
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
    border-radius:16px!important;
  }

  .people-grid>.student-card>.person-card-head h3,
  .connections-tabs + .grid-3>.student-card>.person-card-head h3{
    margin:0 0 2px!important;
    font-size:16px!important;
    line-height:1.15!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .people-grid>.student-card>.person-card-head .person-handle,
  .connections-tabs + .grid-3>.student-card>.person-card-head .person-handle{
    margin:0!important;
    font-size:11px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .people-grid>.student-card>.person-tags,
  .connections-tabs + .grid-3>.student-card>.person-tags{
    grid-column:1!important;
    grid-row:2!important;
    display:flex!important;
    flex-wrap:wrap!important;
    gap:6px!important;
    margin:0!important;
    padding-inline-start:66px!important;
  }

  .people-grid>.student-card>.person-tags .post-kind,
  .people-grid>.student-card>.person-tags .branch-tag,
  .connections-tabs + .grid-3>.student-card>.person-tags .post-kind,
  .connections-tabs + .grid-3>.student-card>.person-tags .branch-tag{
    padding:5px 8px!important;
    font-size:8px!important;
    border-radius:9px!important;
  }

  .people-grid>.student-card>.person-interests,
  .connections-tabs + .grid-3>.student-card>.person-interests{
    grid-column:1!important;
    grid-row:3!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding-inline-start:66px!important;
    font-size:10px!important;
    line-height:1.35!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .people-grid>.student-card>.profile-actions,
  .connections-tabs + .grid-3>.student-card>.profile-actions{
    grid-column:2!important;
    grid-row:1 / span 3!important;
    align-self:center!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:94px!important;
    margin:0!important;
    padding:0!important;
  }

  .people-grid>.student-card>.profile-actions button,
  .connections-tabs + .grid-3>.student-card>.profile-actions button{
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 8px!important;
    border-radius:12px!important;
    font-size:10px!important;
    white-space:nowrap!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card){
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 94px!important;
    grid-template-rows:auto auto!important;
    column-gap:14px!important;
    row-gap:7px!important;
    align-items:center!important;
    min-height:0!important;
    padding:15px 16px!important;
    border-radius:22px!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.identity-line{
    grid-column:1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:54px minmax(0,1fr)!important;
    gap:12px!important;
    align-items:center!important;
    min-width:0!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.identity-line .avatar{
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
    border-radius:16px!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.identity-line h3{
    margin:0 0 2px!important;
    font-size:16px!important;
    line-height:1.15!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>p{
    grid-column:1!important;
    grid-row:2!important;
    margin:0!important;
    padding-inline-start:66px!important;
    font-size:10px!important;
    color:var(--muted)!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.profile-actions{
    grid-column:2!important;
    grid-row:1 / span 2!important;
    align-self:center!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:94px!important;
    margin:0!important;
    padding:0!important;
  }

  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.profile-actions button{
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 8px!important;
    border-radius:12px!important;
    font-size:10px!important;
  }
}

@media(max-width:390px){
  .people-grid>.student-card,
  .connections-tabs + .grid-3>.student-card,
  .connections-tabs + .grid-3>.profile-card:not(.student-card){
    grid-template-columns:minmax(0,1fr) 84px!important;
    column-gap:10px!important;
    padding:13px!important;
  }
  .people-grid>.student-card>.profile-actions,
  .connections-tabs + .grid-3>.student-card>.profile-actions,
  .connections-tabs + .grid-3>.profile-card:not(.student-card)>.profile-actions{
    width:84px!important;
  }
}


/* v106 — compact mobile profile hero */
@media(max-width:760px){
  .profile-hero{
    display:grid!important;
    grid-template-columns:64px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:12px 14px!important;
    align-items:start!important;
    padding:18px!important;
    border-radius:22px!important;
    text-align:start!important;
  }
  .profile-hero>.avatar,
  .profile-hero>.avatar.xl{
    grid-column:1!important;
    grid-row:1!important;
    width:64px!important;
    height:64px!important;
    min-width:64px!important;
    margin:0!important;
    border-radius:18px!important;
    font-size:18px!important;
  }
  .profile-hero>div:not(.profile-hero-actions){
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
  }
  .profile-hero .identity-line{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    min-width:0!important;
  }
  .profile-hero h1{
    margin:0!important;
    font-size:22px!important;
    line-height:1.08!important;
    text-align:start!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .profile-hero p{
    margin:4px 0!important;
    font-size:11px!important;
    line-height:1.35!important;
    text-align:start!important;
  }
  .profile-hero .profile-interest-block{
    margin-top:10px!important;
    justify-items:start!important;
    text-align:start!important;
  }
  .profile-hero .profile-interest-block>small{
    font-size:8px!important;
    letter-spacing:.08em!important;
  }
  .profile-hero .profile-interest-block .tag-row{
    justify-content:flex-start!important;
    gap:5px!important;
    margin-top:5px!important;
  }
  .profile-hero .profile-interest-block .tag-row span{
    padding:5px 8px!important;
    border-radius:9px!important;
    font-size:8px!important;
  }
  .profile-hero .profile-stats{
    justify-content:flex-start!important;
    gap:12px!important;
    margin-top:10px!important;
    flex-wrap:wrap!important;
  }
  .profile-hero .profile-stats span{
    font-size:9px!important;
  }
  .profile-hero .profile-stats b{
    font-size:14px!important;
  }
  .profile-hero>.profile-hero-actions{
    grid-column:1/-1!important;
    grid-row:2!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    justify-content:stretch!important;
  }
  .profile-hero>.profile-hero-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    padding:0 10px!important;
    border-radius:12px!important;
    font-size:10px!important;
  }
  .profile-hero>.profile-hero-actions button:last-child:nth-child(3){
    grid-column:1/-1!important;
  }
}

@media(max-width:390px){
  .profile-hero{
    grid-template-columns:56px minmax(0,1fr)!important;
    gap:10px 12px!important;
    padding:15px!important;
  }
  .profile-hero>.avatar,
  .profile-hero>.avatar.xl{
    width:56px!important;
    height:56px!important;
    min-width:56px!important;
    border-radius:16px!important;
    font-size:16px!important;
  }
  .profile-hero h1{font-size:20px!important}
}


/* v107 — Instagram-like mobile profile + full-height Discover initials */
@media(max-width:760px){
  /* Profile: avatar + stats across the top, identity/bio below, compact actions. */
  .profile-hero{
    display:grid!important;
    grid-template-columns:76px minmax(0,1fr)!important;
    grid-template-rows:auto auto auto auto auto auto!important;
    column-gap:16px!important;
    row-gap:7px!important;
    align-items:start!important;
    padding:18px!important;
    border-radius:22px!important;
    text-align:start!important;
  }
  .profile-hero>.avatar,
  .profile-hero>.avatar.xl{
    grid-column:1!important;
    grid-row:1!important;
    width:76px!important;
    height:76px!important;
    min-width:76px!important;
    margin:0!important;
    border-radius:22px!important;
    font-size:19px!important;
    align-self:center!important;
  }
  .profile-hero>div:not(.profile-hero-actions){display:contents!important}
  .profile-hero .identity-line{
    grid-column:1/-1!important;
    grid-row:2!important;
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    min-width:0!important;
    margin-top:3px!important;
  }
  .profile-hero .identity-line h1{
    margin:0!important;
    font-size:19px!important;
    line-height:1.12!important;
    text-align:start!important;
  }
  .profile-hero>div:not(.profile-hero-actions)>p:nth-of-type(1){
    grid-column:1/-1!important;
    grid-row:3!important;
    margin:0!important;
    font-size:10.5px!important;
    line-height:1.35!important;
    color:var(--muted)!important;
    text-align:start!important;
  }
  .profile-hero>div:not(.profile-hero-actions)>p:nth-of-type(2){
    grid-column:1/-1!important;
    grid-row:4!important;
    margin:1px 0 0!important;
    font-size:11px!important;
    line-height:1.4!important;
    color:var(--ink)!important;
    text-align:start!important;
  }
  .profile-hero .profile-stats{
    grid-column:2!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;
    align-self:center!important;
    justify-content:stretch!important;
    width:100%!important;
    margin:0!important;
  }
  .profile-hero .profile-stats span{
    display:grid!important;
    justify-items:center!important;
    align-content:center!important;
    gap:1px!important;
    min-width:0!important;
    padding:0!important;
    color:var(--muted)!important;
    font-size:8px!important;
    line-height:1.15!important;
    text-align:center!important;
  }
  .profile-hero .profile-stats b{
    display:block!important;
    color:var(--ink)!important;
    font-size:15px!important;
    line-height:1!important;
  }
  .profile-hero .profile-interest-block{
    grid-column:1/-1!important;
    grid-row:5!important;
    margin-top:3px!important;
    justify-items:start!important;
    text-align:start!important;
  }
  .profile-hero .profile-interest-block>small{
    display:none!important;
  }
  .profile-hero .profile-interest-block .tag-row{
    justify-content:flex-start!important;
    gap:5px!important;
    margin:0!important;
  }
  .profile-hero .profile-interest-block .tag-row span{
    padding:5px 8px!important;
    border-radius:9px!important;
    font-size:8px!important;
  }
  .profile-hero>.profile-hero-actions{
    grid-column:1/-1!important;
    grid-row:6!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
    margin-top:4px!important;
    padding:0!important;
  }
  .profile-hero>.profile-hero-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    height:38px!important;
    padding:0 9px!important;
    border-radius:11px!important;
    font-size:9.5px!important;
  }
  .profile-hero>.profile-hero-actions button:last-child:nth-child(3){
    grid-column:auto!important;
  }
  .profile-hero>.profile-hero-actions button:nth-child(3){
    grid-column:1/-1!important;
    height:34px!important;
    min-height:34px!important;
  }

  /* Discover only: initials panel becomes a tall vertical block fitted to the card. */
  .people-grid>.student-card{
    display:grid!important;
    grid-template-columns:72px minmax(0,1fr) 94px!important;
    grid-template-rows:auto auto auto!important;
    column-gap:12px!important;
    row-gap:6px!important;
    align-items:stretch!important;
    padding:12px 14px!important;
  }
  .people-grid>.student-card>.person-card-head{display:contents!important}
  .people-grid>.student-card>.person-card-head .avatar{
    grid-column:1!important;
    grid-row:1 / span 3!important;
    align-self:stretch!important;
    justify-self:stretch!important;
    width:72px!important;
    min-width:72px!important;
    height:auto!important;
    min-height:104px!important;
    border-radius:17px!important;
    font-size:17px!important;
  }
  .people-grid>.student-card>.person-card-head>div{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    align-self:center!important;
  }
  .people-grid>.student-card>.person-tags{
    grid-column:2!important;
    grid-row:2!important;
    padding-inline-start:0!important;
    align-self:center!important;
  }
  .people-grid>.student-card>.person-interests{
    grid-column:2!important;
    grid-row:3!important;
    padding-inline-start:0!important;
    align-self:start!important;
  }
  .people-grid>.student-card>.profile-actions{
    grid-column:3!important;
    grid-row:1 / span 3!important;
    width:94px!important;
    align-self:center!important;
  }
}

@media(max-width:390px){
  .profile-hero{
    grid-template-columns:68px minmax(0,1fr)!important;
    column-gap:12px!important;
    padding:15px!important;
  }
  .profile-hero>.avatar,
  .profile-hero>.avatar.xl{
    width:68px!important;
    height:68px!important;
    min-width:68px!important;
    border-radius:20px!important;
  }
  .people-grid>.student-card{
    grid-template-columns:64px minmax(0,1fr) 84px!important;
    column-gap:9px!important;
    padding:11px 12px!important;
  }
  .people-grid>.student-card>.person-card-head .avatar{
    width:64px!important;
    min-width:64px!important;
    min-height:100px!important;
  }
  .people-grid>.student-card>.profile-actions{width:84px!important}
}


/* v110 — closed mobile conversation list must end above the fixed bottom nav */
@media(max-width:760px){
  .messages:not(.mobile-thread-open){
    min-height:0!important;
    margin-bottom:0!important;
    overflow:hidden!important;
  }
  .messages:not(.mobile-thread-open) .thread-list{
    display:flex!important;
    flex-direction:column!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .messages:not(.mobile-thread-open) .thread-head,
  .messages:not(.mobile-thread-open) .thread-search{
    flex:0 0 auto!important;
  }
  .messages:not(.mobile-thread-open) .thread-list-scroll{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    padding-bottom:18px!important;
    scroll-padding-bottom:18px!important;
  }
}

/* v126 — stable PWA chat gestures and keyboard-safe layout */
@media(max-width:760px){
  #chatFlow > .chat-message,
  #chatFlow > .chat-message *,
  #circleChatFlow > .chat-message,
  #circleChatFlow > .chat-message *{
    -webkit-user-select:none!important;
    user-select:none!important;
    -webkit-touch-callout:none!important;
    -webkit-tap-highlight-color:transparent!important;
  }

  [data-cancel-dm-reply],
  [data-cancel-circle-reply]{
    -webkit-tap-highlight-color:transparent!important;
    touch-action:manipulation!important;
    user-select:none!important;
    -webkit-user-select:none!important;
  }

  .messages.mobile-thread-open,
  .dm-like-circle-chat{
    min-height:220px!important;
    overflow:hidden!important;
  }

  .messages.mobile-thread-open .chat,
  .dm-like-circle-chat{
    min-height:0!important;
  }

  .messages.mobile-thread-open .chat-flow,
  .dm-like-circle-chat .chat-flow{
    min-height:0!important;
    overscroll-behavior:contain!important;
  }
}

/* v128 — independent mobile/PWA message action sheet */
@media(max-width:760px){
  .neis-message-sheet-layer{
    position:fixed!important;
    inset:0!important;
    z-index:2147483000!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:center!important;
    padding:12px 12px calc(12px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  .neis-message-sheet-backdrop{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:rgba(0,0,0,.28)!important;
  }
  .neis-message-sheet{
    position:relative!important;
    z-index:1!important;
    width:min(100%,420px)!important;
    padding:10px!important;
    border:1px solid var(--line)!important;
    border-radius:22px!important;
    background:var(--card)!important;
    box-shadow:0 20px 60px rgba(0,0,0,.22)!important;
  }
  .neis-message-sheet-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    padding:7px 8px 10px!important;
  }
  .neis-message-sheet-head>b{font-size:15px!important}
  .neis-message-sheet-head>button{
    width:34px!important;height:34px!important;min-width:34px!important;
    display:grid!important;place-items:center!important;
    border:1px solid var(--line)!important;border-radius:11px!important;
    background:var(--soft)!important;color:var(--ink)!important;
    font-size:20px!important;line-height:1!important;
    -webkit-tap-highlight-color:transparent!important;
  }
  .neis-message-sheet-action{
    width:100%!important;
    min-height:48px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    padding:11px 12px!important;
    border:0!important;
    border-radius:14px!important;
    background:transparent!important;
    color:var(--ink)!important;
    text-align:start!important;
    font:inherit!important;
    -webkit-tap-highlight-color:transparent!important;
    touch-action:manipulation!important;
  }
  .neis-message-sheet-action:active{
    background:var(--soft)!important;
  }
  .neis-message-sheet-action.danger{
    color:#a53a2d!important;
  }
}

/* v129 — desktop message actions trigger */
@media(min-width:761px){
  .chat-message .bubble{
    position:relative;
  }
  .message-actions-trigger{
    position:absolute!important;
    top:6px!important;
    inset-inline-end:6px!important;
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:9px!important;
    background:color-mix(in srgb,var(--card) 82%,transparent)!important;
    color:var(--muted)!important;
    font-size:12px!important;
    line-height:1!important;
    opacity:.14;
    cursor:pointer!important;
    transition:opacity .15s ease,background .15s ease!important;
  }
  .chat-message:hover .message-actions-trigger,
  .chat-message:focus-within .message-actions-trigger,
  .message-actions-trigger:focus-visible{
    opacity:.9;
  }
  .message-actions-trigger:hover{
    background:var(--soft)!important;
  }
  .chat-message .bubble:has(.message-actions-trigger){
    padding-inline-end:38px!important;
  }
}

/* v130 — native dialog message actions, shared by desktop and PWA */
.neis-message-actions-dialog{
  width:min(390px,calc(100vw - 28px))!important;
  max-width:390px!important;
  padding:0!important;
  border:0!important;
  border-radius:22px!important;
  background:transparent!important;
  color:var(--ink)!important;
  overflow:visible!important;
}
.neis-message-actions-dialog::backdrop{
  background:rgba(0,0,0,.30)!important;
  backdrop-filter:blur(2px);
}
.neis-message-dialog-card{
  padding:10px!important;
  border:1px solid var(--line)!important;
  border-radius:22px!important;
  background:var(--card)!important;
  box-shadow:0 20px 60px rgba(0,0,0,.22)!important;
}
.neis-message-dialog-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:7px 8px 10px!important;
}
.neis-message-dialog-head>b{font-size:15px!important}
.neis-message-dialog-head>button{
  width:34px!important;height:34px!important;min-width:34px!important;
  display:grid!important;place-items:center!important;
  border:1px solid var(--line)!important;
  border-radius:11px!important;
  background:var(--soft)!important;
  color:var(--ink)!important;
  font-size:20px!important;
  line-height:1!important;
  -webkit-tap-highlight-color:transparent!important;
}
.neis-message-dialog-action{
  width:100%!important;
  min-height:48px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:11px 12px!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:var(--ink)!important;
  text-align:start!important;
  font:inherit!important;
  cursor:pointer!important;
  -webkit-tap-highlight-color:transparent!important;
  touch-action:manipulation!important;
}
.neis-message-dialog-action:hover,
.neis-message-dialog-action:active{
  background:var(--soft)!important;
}
.neis-message-dialog-action.danger{
  color:#a53a2d!important;
}
@media(max-width:760px){
  .neis-message-actions-dialog{
    margin:auto auto 14px!important;
  }
}

/* v130 — remove legacy desktop inline delete */
.chat-message .content-menu{display:none!important}

/* v131 — three-dot message actions available on mobile too */
@media(max-width:760px){
  .chat-message .bubble{
    position:relative!important;
  }
  .message-actions-trigger{
    position:absolute!important;
    top:5px!important;
    inset-inline-end:5px!important;
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:9px!important;
    background:color-mix(in srgb,var(--card) 72%,transparent)!important;
    color:var(--muted)!important;
    font-size:12px!important;
    line-height:1!important;
    opacity:.68!important;
    z-index:2!important;
    -webkit-tap-highlight-color:transparent!important;
    touch-action:manipulation!important;
  }
  .chat-message.mine .message-actions-trigger{
    color:rgba(255,255,255,.82)!important;
    background:rgba(255,255,255,.14)!important;
  }
  .chat-message .bubble:has(.message-actions-trigger){
    padding-inline-end:40px!important;
  }
}


/* v133 — desktop-only message actions in original bubble position */
@media(max-width:760px){
  .message-actions-trigger{
    display:none!important;
  }
}
@media(min-width:761px){
  .chat-message .bubble{
    position:relative!important;
    overflow:visible!important;
  }
  .message-actions-trigger{
    position:absolute!important;
    top:6px!important;
    inset-inline-end:6px!important;
    inset-inline-start:auto!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:9px!important;
    background:color-mix(in srgb,var(--card) 82%,transparent)!important;
    color:var(--muted)!important;
    font-size:12px!important;
    line-height:1!important;
    opacity:.14!important;
    cursor:pointer!important;
  }
  .chat-message:hover .message-actions-trigger,
  .chat-message:focus-within .message-actions-trigger,
  .message-actions-trigger:focus-visible{
    opacity:.9!important;
  }
  .chat-message .bubble:has(.message-actions-trigger){
    padding-inline-end:38px!important;
  }
}

/* v135 — authoritative desktop placement for message actions */
@media(max-width:760px){
  .message-actions-trigger{display:none!important}
}
@media(min-width:761px){
  .chat-message .bubble{
    position:relative!important;
    overflow:visible!important;
  }
  .chat-message .message-actions-trigger{
    position:absolute!important;
    top:6px!important;
    inset-inline-end:6px!important;
    inset-inline-start:auto!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    margin:0!important;
    display:grid!important;
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
    min-height:26px!important;
    place-items:center!important;
    z-index:3!important;
  }
  .chat-message .bubble:has(.message-actions-trigger){
    padding-inline-end:38px!important;
  }
}

/* v136 — clean message action control + remove mobile tap highlight */
@media(min-width:761px){
  .chat-message .bubble{
    position:relative!important;
  }
  .chat-message .message-actions-trigger{
    position:absolute!important;
    top:5px!important;
    inset-inline-end:5px!important;
    inset-inline-start:auto!important;
    width:24px!important;
    height:24px!important;
    min-width:24px!important;
    min-height:24px!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    border-radius:7px!important;
    background:transparent!important;
    box-shadow:none!important;
    color:currentColor!important;
    opacity:.42!important;
    font-size:12px!important;
    line-height:1!important;
    letter-spacing:1px!important;
    transform:none!important;
    display:grid!important;
    place-items:center!important;
    z-index:4!important;
    cursor:pointer!important;
  }
  .chat-message.mine .message-actions-trigger{
    color:#fff!important;
  }
  .chat-message:hover .message-actions-trigger,
  .chat-message:focus-within .message-actions-trigger,
  .message-actions-trigger:focus-visible{
    opacity:.9!important;
  }
  .chat-message .bubble:has(.message-actions-trigger){
    padding-inline-end:34px!important;
  }
}

@media(max-width:760px), (pointer:coarse){
  html,body,
  button,a,input,textarea,select,label,
  [role="button"],[tabindex],
  .chat-message,.bubble,.account-row,.module-card,.nav-btn,.round-btn{
    -webkit-tap-highlight-color:transparent!important;
  }

  button:focus,
  a:focus,
  [role="button"]:focus,
  [tabindex]:focus{
    outline:none!important;
  }

  ::selection{
    background:transparent!important;
  }
}

/* v137 — exact notification target focus */
.notification-target-highlight{
  position:relative;
  z-index:1;
  outline:2px solid color-mix(in srgb,var(--accent) 48%,transparent)!important;
  outline-offset:3px!important;
  border-radius:16px!important;
  animation:neisNotificationTargetPulse 1.3s ease 2;
}
@keyframes neisNotificationTargetPulse{
  0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 0%,transparent)}
  50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--accent) 12%,transparent)}
}

/* v141 — mobile keeps original post formatting in collapsed previews */
@media(max-width:760px){
  .post .post-body{
    white-space:pre-wrap!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
  }
  .post .post-body.collapsed{
    display:block!important;
    max-height:8.5em!important;
    overflow:hidden!important;
    white-space:pre-wrap!important;
    -webkit-line-clamp:unset!important;
    -webkit-box-orient:unset!important;
    position:relative!important;
  }
  .post .post-body.collapsed::after{
    content:""!important;
    position:absolute!important;
    inset-inline:0!important;
    bottom:0!important;
    height:2.1em!important;
    pointer-events:none!important;
    background:linear-gradient(to bottom,transparent,var(--card))!important;
  }
}

/* v146 — Discover person cards exactly match Connections cards */
@media(max-width:760px){
  .discover-connections-grid>.student-card{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 94px!important;
    grid-template-rows:auto auto auto!important;
    column-gap:14px!important;
    row-gap:7px!important;
    align-items:center!important;
    min-height:0!important;
    height:auto!important;
    padding:15px 16px!important;
    border-radius:22px!important;
  }
  .discover-connections-grid>.student-card>.person-card-head{
    grid-column:1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:54px minmax(0,1fr)!important;
    gap:12px!important;
    align-items:center!important;
    min-width:0!important;
  }
  .discover-connections-grid>.student-card>.person-card-head .avatar{
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
    min-height:54px!important;
    border-radius:16px!important;
  }
  .discover-connections-grid>.student-card>.person-card-head h3{
    margin:0 0 2px!important;
    font-size:16px!important;
    line-height:1.15!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .discover-connections-grid>.student-card>.person-card-head .person-handle{
    margin:0!important;
    font-size:11px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .discover-connections-grid>.student-card>.person-tags{
    grid-column:1!important;
    grid-row:2!important;
    display:flex!important;
    flex-wrap:wrap!important;
    gap:6px!important;
    margin:0!important;
    padding-inline-start:66px!important;
  }
  .discover-connections-grid>.student-card>.person-tags .post-kind,
  .discover-connections-grid>.student-card>.person-tags .branch-tag{
    padding:5px 8px!important;
    font-size:8px!important;
    border-radius:9px!important;
  }
  .discover-connections-grid>.student-card>.person-interests{
    grid-column:1!important;
    grid-row:3!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding-inline-start:66px!important;
    font-size:10px!important;
    line-height:1.35!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    display:block!important;
  }
  .discover-connections-grid>.student-card>.profile-actions{
    grid-column:2!important;
    grid-row:1 / span 3!important;
    align-self:center!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:94px!important;
    margin:0!important;
    padding:0!important;
  }
  .discover-connections-grid>.student-card>.profile-actions button{
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 8px!important;
    border-radius:12px!important;
    font-size:10px!important;
    white-space:nowrap!important;
  }
}
@media(max-width:390px){
  .discover-connections-grid>.student-card{
    grid-template-columns:minmax(0,1fr) 84px!important;
    column-gap:10px!important;
    padding:13px!important;
  }
  .discover-connections-grid>.student-card>.profile-actions{
    width:84px!important;
  }
}


/* v159.8 — compact top actions with refresh button */
@media(max-width:380px){
  .top-actions{gap:4px!important}
  .top-actions .round-btn,
  .top-actions .mini-avatar{
    width:34px!important;
    height:34px!important;
    flex-basis:34px!important;
    border-radius:11px!important;
  }
  .wordmark b{font-size:15px!important}
}


/* v159.9 — Circle search visual polish on mobile only */
@media(max-width:760px){
  .circle-toolbar{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    margin:0 0 14px!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  .circle-toolbar .field{
    flex:1 1 auto!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
  }
  .circle-toolbar .field input{
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
    padding:0 16px!important;
    border:1px solid var(--line)!important;
    border-radius:16px!important;
    background:var(--card)!important;
    color:var(--ink)!important;
    box-shadow:none!important;
    font-size:14px!important;
    line-height:1!important;
  }
  .circle-toolbar .field input::placeholder{
    color:var(--muted)!important;
    opacity:.82!important;
  }
  .circle-toolbar>[data-clear-circle-search]{
    flex:0 0 auto!important;
    min-height:48px!important;
    border-radius:14px!important;
  }
}


/* v64 — final mobile DM viewport contract.
   Reserve the bottom navigation exactly once and keep the open thread inside
   the visible mobile viewport without page-level vertical overflow. */
@media(max-width:760px){
  body:has(.messages.mobile-thread-open){
    min-height:100dvh!important;
    height:100dvh!important;
    overflow:hidden!important;
  }
  body:has(.messages.mobile-thread-open) .stage{
    height:calc(100dvh - 58px)!important;
    min-height:0!important;
    padding:0 0 calc(74px + env(safe-area-inset-bottom))!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body:has(.messages.mobile-thread-open) .view:has(.messages){
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .messages.mobile-thread-open{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    border-radius:0!important;
    overflow:hidden!important;
  }
  .messages.mobile-thread-open .chat{
    display:flex!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .messages.mobile-thread-open .chat-head{
    flex:0 0 62px!important;
    min-height:62px!important;
  }
  .messages.mobile-thread-open .chat-flow{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .messages.mobile-thread-open .chat-form{
    flex:0 0 auto!important;
    margin:7px 9px max(8px,env(safe-area-inset-bottom))!important;
  }
}

@media(max-width:600px){
  body:has(.messages.mobile-thread-open) .stage{
    height:calc(100dvh - 58px)!important;
    padding-bottom:calc(74px + env(safe-area-inset-bottom))!important;
  }
  .messages.mobile-thread-open{
    margin-bottom:0!important;
  }
}
