@media (min-width:861px){
/* NearNow Web v209 — desktop Community fullscreen rooms + fullscreen topics.
   Authoritative basis: Web v193. v209 supersedes the old compact Community layout at all responsive widths. */
#screen-community.active{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
#screen-community .community-page{
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:clamp(10px,1.1vh,14px)!important;
}
#screen-community .community-toolbar{
  max-height:none!important;
  min-height:0!important;
  overflow:visible!important;
  padding:clamp(10px,1.15vw,16px) clamp(12px,1.35vw,18px)!important;
  gap:8px!important;
  border-radius:clamp(16px,1.3vw,22px)!important;
}
#screen-community .community-toolbar-top{align-items:center!important;flex-wrap:nowrap!important}
#screen-community .community-title-block{min-width:210px!important;gap:2px!important}
#screen-community .community-title-block #communityModeLabel{display:block!important}
#screen-community .community-title-block p{margin:0!important;font-size:clamp(10px,.72vw,12px)!important;line-height:1.3!important}
#screen-community .community-connection-path{display:none!important}
#screen-community .community-toolbar-actions{align-items:center!important;align-self:center!important;flex-wrap:nowrap!important;gap:8px!important}
#screen-community .community-toolbar-control-stack{display:flex!important;align-items:center!important;gap:8px!important}
#screen-community .community-filter-row.community-filter-row-inline{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;gap:7px!important}
#screen-community .community-filter-row.community-filter-row-inline select,
#screen-community .community-filter-row.community-filter-row-inline input[type=number]{padding:7px 9px!important;min-height:38px!important}
#screen-community .community-filter-row.community-filter-row-inline label{white-space:nowrap!important;font-size:11px!important}
#screen-community #communityRefreshBtn,#screen-community #communityComposeBtn{min-height:38px!important}

#screen-community .community-workspace{
  height:100%!important;
  min-height:0!important;
  width:100%!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:10px!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
#screen-community .community-stage-head{
  min-width:0;
  display:flex;
  align-items:center;
  gap:12px;
  padding:2px 2px 0;
}
#screen-community .community-stage-copy{min-width:0;display:grid;gap:1px}
#screen-community .community-stage-copy h2{margin:0;font-size:clamp(18px,1.55vw,25px);line-height:1.08;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#screen-community .community-stage-copy p{margin:0;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#screen-community .community-rooms-back{flex:0 0 auto;min-height:40px;padding-inline:14px!important}

/* ROOM OVERVIEW — the room cards consume the complete available Community stage. */
#screen-community .community-topic-dock{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:clamp(12px,1.3vw,18px)!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:clamp(10px,1.2vh,14px)!important;
  align-items:stretch!important;
  overflow:hidden!important;
  border-radius:clamp(18px,1.5vw,24px)!important;
  background:radial-gradient(circle at 8% 0%,rgba(47,111,237,.12),transparent 34%),linear-gradient(155deg,rgba(15,21,31,.98),rgba(8,12,18,.98))!important;
}
.sensual-mode #screen-community .community-topic-dock{
  background:radial-gradient(circle at 8% 0%,rgba(239,47,120,.13),transparent 34%),linear-gradient(155deg,rgba(27,12,21,.98),rgba(11,9,15,.98))!important;
}
#screen-community .community-topic-dock-head{
  min-width:0!important;
  padding:0 2px!important;
  display:flex!important;
  align-items:end!important;
  justify-content:space-between!important;
  gap:18px!important;
}
#screen-community .community-topic-dock-head>div{display:grid;gap:2px}
#screen-community .community-topic-dock-head b{font-size:clamp(18px,1.55vw,25px)!important;line-height:1.08!important}
#screen-community .community-topic-dock-head>span{max-width:560px;color:var(--muted)!important;font-size:clamp(10px,.72vw,12px)!important;line-height:1.35!important;text-align:right}
#screen-community .community-categories{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))!important;
  grid-auto-rows:minmax(128px,1fr)!important;
  align-content:stretch!important;
  gap:clamp(9px,.85vw,14px)!important;
  padding:0!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
}
#screen-community .community-category,
#screen-community .community-category-photo{
  width:100%!important;
  height:100%!important;
  min-height:128px!important;
  max-height:none!important;
  flex:none!important;
  padding:clamp(12px,1.15vw,18px)!important;
  display:grid!important;
  grid-template-columns:clamp(42px,3vw,54px) minmax(0,1fr)!important;
  gap:clamp(10px,.85vw,14px)!important;
  align-items:end!important;
  align-content:end!important;
  border-radius:clamp(15px,1.3vw,21px)!important;
  border-color:rgba(143,163,195,.28)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 12px 30px rgba(0,0,0,.20)!important;
  transform:none!important;
}
#screen-community .community-category-photo-bg{z-index:0!important;opacity:.96!important;filter:saturate(1.04) brightness(.90) contrast(1.03)!important;object-position:center 43%!important;transition:transform .22s ease,filter .22s ease,opacity .22s ease!important}
#screen-community .community-category-photo::before{z-index:1!important;background:linear-gradient(180deg,rgba(4,7,11,.04) 0%,rgba(4,7,11,.13) 42%,rgba(4,7,11,.78) 100%)!important}
#screen-community .community-category-photo::after{z-index:1!important}
#screen-community .community-category-photo .community-topic-icon-wrap,#screen-community .community-category-photo .community-category-copy{position:relative!important;z-index:2!important}
.sensual-mode #screen-community .community-category-photo::before{background:linear-gradient(180deg,rgba(18,4,11,.04) 0%,rgba(18,4,11,.15) 42%,rgba(18,4,11,.80) 100%)!important}
#screen-community .community-category-photo:hover{transform:translateY(-2px)!important}
#screen-community .community-category-photo:hover .community-category-photo-bg{transform:scale(1.025);filter:saturate(1.07) brightness(.91) contrast(1.03)!important}
#screen-community .community-category-photo.active{border-color:color-mix(in srgb,var(--topic-accent) 78%,#62708a)!important;box-shadow:0 14px 32px rgba(0,0,0,.25),0 0 0 1px color-mix(in srgb,var(--topic-accent) 22%,transparent)!important}
#screen-community .community-topic-icon-wrap{width:clamp(42px,3vw,54px)!important;height:clamp(42px,3vw,54px)!important;border-radius:clamp(12px,1vw,16px)!important}
#screen-community .community-topic-icon{width:clamp(22px,1.6vw,29px)!important;height:clamp(22px,1.6vw,29px)!important}
#screen-community .community-category-copy{align-self:end!important}
#screen-community .community-category-title{font-size:clamp(15px,1.05vw,19px)!important;line-height:1.12!important;letter-spacing:-.01em!important}
#screen-community .community-category-note{margin-top:4px!important;font-size:clamp(10px,.72vw,12px)!important;line-height:1.3!important;color:#e6edf7!important}

/* TOPIC LIST — once a room is opened, its topics own the whole stage. */
#screen-community .community-main{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  min-width:0!important;
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  gap:10px!important;
  overflow:hidden!important;
}
#screen-community .community-feed{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr))!important;
  grid-auto-rows:minmax(230px,1fr)!important;
  align-content:stretch!important;
  gap:clamp(10px,.9vw,15px)!important;
  padding:1px 5px 2px 1px!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
}
#screen-community .community-feed.thread-open{display:block!important;padding-right:7px!important}
#screen-community .community-post{height:100%!important;min-height:230px!important;border-radius:clamp(17px,1.25vw,22px)!important;padding:clamp(16px,1.25vw,21px)!important}
#screen-community .community-post h3{font-size:clamp(17px,1.2vw,21px)!important;line-height:1.2!important}
#screen-community .community-post-body{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
#screen-community .community-feed-empty,#screen-community .nn-empty-state{min-height:100%!important;grid-column:1/-1!important;display:grid!important;place-content:center!important;text-align:center!important}
#screen-community .nn-skeleton-community{grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))!important;gap:12px!important;height:100%!important}
#screen-community .community-inline-thread{min-height:100%!important;max-width:1180px!important;margin:0 auto!important;padding-bottom:12px!important}

/* Explicit stage switching: rooms and topics are separate full-area views on desktop. */
#screen-community .community-page.community-rooms-stage .community-stage-head,
#screen-community .community-page.community-rooms-stage .community-main{display:none!important}
#screen-community .community-page.community-rooms-stage .community-topic-dock{display:grid!important;grid-row:1/-1!important}
#screen-community .community-page.community-feed-stage .community-topic-dock,
#screen-community .community-page.community-thread-stage .community-topic-dock{display:none!important}
#screen-community .community-page.community-feed-stage .community-stage-head{display:flex!important}
#screen-community .community-page.community-feed-stage .community-main{display:grid!important}
#screen-community .community-page.community-thread-stage .community-stage-head{display:none!important}
#screen-community .community-page.community-thread-stage .community-main{display:grid!important;grid-row:1/-1!important}

/* Compact desktop / Lenovo-class widths: same hierarchy, fewer columns, no clipping. */
@media (max-width:1180px){
  #screen-community .community-toolbar-top{align-items:stretch!important;flex-wrap:wrap!important}
  #screen-community .community-title-block{flex:1 1 240px!important}
  #screen-community .community-toolbar-actions{flex:1 1 100%!important;justify-content:flex-start!important;flex-wrap:wrap!important}
  #screen-community .community-toolbar-control-stack{flex-wrap:wrap!important}
  #screen-community .community-filter-row.community-filter-row-inline{flex-wrap:wrap!important}
  #screen-community .community-categories{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))!important;grid-auto-rows:minmax(118px,1fr)!important}
  #screen-community .community-category,#screen-community .community-category-photo{min-height:118px!important}
  #screen-community .community-feed{grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr))!important;grid-auto-rows:minmax(215px,1fr)!important}
}
@media (max-height:760px){
  #screen-community .community-toolbar{padding-top:8px!important;padding-bottom:8px!important}
  #screen-community .community-title-block p{display:none!important}
  #screen-community .community-categories{grid-auto-rows:minmax(102px,1fr)!important}
  #screen-community .community-category,#screen-community .community-category-photo{min-height:102px!important;padding:10px 12px!important}
  #screen-community .community-topic-dock-head>span{display:none!important}
  #screen-community .community-feed{grid-auto-rows:minmax(190px,1fr)!important}
  #screen-community .community-post{min-height:190px!important}
}
@media (prefers-reduced-motion:reduce){
  #screen-community .community-category-photo-bg,#screen-community .community-category-photo{transition:none!important}
}

}


/* Mobile/tablet Community v209 — same fullscreen room → topics → thread flow.
   Loaded after the older mobile visual layer so the new structure is authoritative at every resolution. */
@media (max-width:860px){
  #screen-community.active{
    height:calc(100dvh - var(--nn-mobile-topbar,62px) - var(--nn-mobile-nav,72px) - 26px)!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #screen-community .community-page{
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:9px!important;
    overflow:hidden!important;
  }
  #screen-community .community-toolbar{
    max-height:none!important;
    min-height:0!important;
    padding:9px 10px!important;
    border-radius:17px!important;
    overflow:hidden!important;
  }
  #screen-community .community-toolbar-top{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
  #screen-community .community-title-block p,#screen-community .community-connection-path{display:none!important}
  #screen-community .community-title-block{min-width:0!important}
  #screen-community .community-title-block .auth-kicker{font-size:10px!important}
  #screen-community .community-toolbar-actions{display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;gap:7px!important;align-items:center!important}
  #screen-community .community-toolbar-control-stack{display:contents!important}
  #screen-community #communityRefreshBtn{grid-column:2!important;grid-row:1!important;width:44px!important;min-width:44px!important;height:44px!important;padding:0!important;font-size:0!important}
  #screen-community #communityRefreshBtn::before{content:'↻';font-size:20px}
  #screen-community .community-compose-primary{grid-column:1!important;grid-row:1!important;min-height:44px!important}
  #screen-community .community-filter-row.community-filter-row-inline{grid-column:1/-1!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:7px!important;margin:0!important}
  #screen-community .community-filter-row.community-filter-row-inline select,
  #screen-community .community-filter-row.community-filter-row-inline label{min-width:0!important;min-height:39px!important;padding:6px 8px!important;font-size:10px!important}
  #screen-community #communityRadiusWrap{grid-column:1/-1!important}
  #screen-community .community-rooms-stage .community-toolbar{display:none!important}
  #screen-community .community-thread-stage .community-toolbar{display:none!important}

  /* v209 replaces the old compact topic trigger/sheet with the actual full-stage room overview. */
  #screen-community .community-topic-mobile{display:none!important}
  #screen-community .community-workspace{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  #screen-community .community-stage-head{
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    padding:0 1px!important;
  }
  #screen-community .community-rooms-back{min-height:40px!important;padding:8px 11px!important;border-radius:12px!important;font-size:12px!important}
  #screen-community .community-stage-copy{min-width:0!important;display:grid!important;gap:0!important}
  #screen-community .community-stage-copy .auth-kicker{font-size:9px!important}
  #screen-community .community-stage-copy h2{margin:0!important;font-size:18px!important;line-height:1.08!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #screen-community .community-stage-copy p{margin:1px 0 0!important;font-size:9.5px!important;line-height:1.2!important;color:var(--muted)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  #screen-community .community-topic-dock{
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:10px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:8px!important;
    overflow:hidden!important;
    border-radius:18px!important;
    background:radial-gradient(circle at 8% 0%,rgba(47,111,237,.13),transparent 38%),linear-gradient(155deg,rgba(15,21,31,.98),rgba(8,12,18,.98))!important;
  }
  .sensual-mode #screen-community .community-topic-dock{background:radial-gradient(circle at 8% 0%,rgba(239,47,120,.14),transparent 38%),linear-gradient(155deg,rgba(27,12,21,.98),rgba(11,9,15,.98))!important}
  #screen-community .community-topic-dock-head{display:flex!important;align-items:end!important;justify-content:space-between!important;gap:10px!important;padding:0 1px!important}
  #screen-community .community-topic-dock-head>div{display:grid!important;gap:1px!important}
  #screen-community .community-topic-dock-head b{font-size:18px!important;line-height:1!important}
  #screen-community .community-topic-dock-head>span{display:none!important}
  #screen-community .community-categories{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:minmax(108px,1fr)!important;
    align-content:stretch!important;
    gap:8px!important;
    padding:0 2px 2px 0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
  #screen-community .community-category,#screen-community .community-category-photo{
    width:100%!important;
    height:100%!important;
    min-height:108px!important;
    max-height:none!important;
    padding:9px!important;
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr)!important;
    gap:8px!important;
    align-items:end!important;
    align-content:end!important;
    border-radius:15px!important;
    transform:none!important;
  }
  #screen-community .community-category-photo-bg{z-index:0!important;opacity:.96!important;filter:saturate(1.04) brightness(.88) contrast(1.03)!important;object-position:center 43%!important}
  #screen-community .community-category-photo::before{z-index:1!important;background:linear-gradient(180deg,rgba(4,7,11,.04),rgba(4,7,11,.16) 42%,rgba(4,7,11,.80))!important}
  #screen-community .community-topic-icon-wrap{width:36px!important;height:36px!important;border-radius:11px!important}
  #screen-community .community-topic-icon{width:20px!important;height:20px!important}
  #screen-community .community-category-title{font-size:12px!important;line-height:1.08!important}
  #screen-community .community-category-note{margin-top:2px!important;font-size:8.5px!important;line-height:1.16!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}

  #screen-community .community-main{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    gap:8px!important;
    overflow:hidden!important;
  }
  #screen-community .community-feed{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-rows:minmax(175px,1fr)!important;
    align-content:stretch!important;
    gap:9px!important;
    padding:1px 2px 3px 0!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
  #screen-community .community-feed.thread-open{display:block!important;padding-right:2px!important}
  #screen-community .community-post{height:auto!important;min-height:175px!important;padding:12px!important;border-radius:16px!important}
  #screen-community .community-inline-thread{min-height:100%!important;max-width:none!important;margin:0!important;padding-bottom:8px!important}

  #screen-community .community-rooms-stage .community-stage-head,
  #screen-community .community-rooms-stage .community-main{display:none!important}
  #screen-community .community-rooms-stage .community-topic-dock{grid-row:1/-1!important}
  #screen-community .community-feed-stage .community-topic-dock,
  #screen-community .community-thread-stage .community-topic-dock{display:none!important}
  #screen-community .community-feed-stage .community-stage-head{display:flex!important}
  #screen-community .community-feed-stage .community-main{display:grid!important}
  #screen-community .community-thread-stage .community-stage-head{display:none!important}
  #screen-community .community-thread-stage .community-main{display:grid!important;grid-row:1/-1!important}
}
@media (max-width:360px){
  #screen-community .community-categories{grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:minmax(96px,auto)!important}
  #screen-community .community-category,#screen-community .community-category-photo{min-height:96px!important}
}
