/* =====================================================================
   ТЕЗАУРУС · поток мыслей и приглашения (центр хаба)
   ===================================================================== */

/* Поток листается колесом и пальцем.
   Важно: у #screen-hub .hub-stage стоит overflow: hidden с более сильным
   селектором — без явного правила здесь прокрутка не работала бы вовсе
   (и «Показать ещё» добавлял карточки ниже видимой части). */
#screen-hub .hub-stage.flow{
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#screen-hub .hub-stage.flow::-webkit-scrollbar{ width: 8px; }
#screen-hub .hub-stage.flow::-webkit-scrollbar-thumb{ background: rgba(13,20,36,.14); border-radius: 4px; }

.flow-wrap{
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 26px 70px;
}

.flow-head{
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 4px 0 16px;
  background: linear-gradient(180deg, rgba(241,245,251,.96) 60%, rgba(241,245,251,0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.flow-title{
  margin: 0;
  font-size: 20px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--grad-3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.flow-sub{
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  letter-spacing: .03em;
  max-width: 520px;
}
.flow-controls{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.seg{
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
}
.seg button{
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 7px 13px;
  border-radius: 8px;
  transition: .15s;
}
.seg button:hover{ color: #0079a8; }
.seg button.on{
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,140,255,.3);
}
.flow-search{ position: relative; flex: 1; min-width: 180px; }
.flow-search input{ padding-left: 32px; }
.flow-search .search-icon{
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: #8892a6;
  pointer-events: none;
}

.thought{
  position: relative;
  margin-top: 14px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-left: 3px solid hsl(var(--h,200) 85% 58%);
  box-shadow: 0 6px 22px rgba(13,20,36,.07);
  transition: transform .16s, box-shadow .2s;
  animation: riseIn .26s ease both;
}
.thought:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(13,20,36,.12);
}
.thought.mine{ border-left-style: dashed; }

.thought-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.thought-who{ flex: 1; min-width: 0; }
.thought-name{
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thought-name:hover{ color: var(--violet); }
.thought-meta{
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.thought-meta .mdot{
  width: 5px; height: 5px;
  border-radius: 2px;
  background: hsl(var(--fh,200) 85% 55%);
  box-shadow: 0 0 6px hsl(var(--fh,200) 85% 55%);
}

.thought-text{
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thought-foot{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.thought-foot .btn{ padding: 6px 11px; font-size: 10.5px; border-radius: 8px; }
.thought-foot .grow{ flex: 1; }

/* ---------- приглашения ---------- */
.invite{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 15px;
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(13,20,36,.06);
  animation: riseIn .26s ease both;
  flex-wrap: wrap;
}
.invite-txt{ flex: 1; min-width: 180px; }
.invite-txt .who{ font-size: 12.5px; font-weight: 700; }
.invite-txt .what{ font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.invite-txt .what b{ color: var(--ink-2); }
.invite-btns{ display: flex; gap: 7px; }
.invite.done{ opacity: .65; }

@media (max-width: 900px){
  .flow-wrap{ padding: 22px 16px 60px; }
}

/* =====================================================================
   СТОП / ИГРАТЬ В ПОТОКЕ
   ===================================================================== */
.flow-play{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #00c2ff, #7b5cff);
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,140,255,.35);
  transition: transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.flow-play:hover{ transform: translateY(-1px); box-shadow: 0 9px 24px rgba(0,140,255,.5); }
.flow-play .fp-icon{ font-size: 13px; line-height: 1; }
.flow-play.paused{
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
}
.flow-play.paused:hover{ border-color: var(--cyan); color: #0079a8; background: #fff; }

.flow-note{
  margin-top: 12px;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  line-height: 1.7;
}
.flow-note b{ color: var(--ink-2); }
.flow-note .live-dot{
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #00c86b;
  box-shadow: 0 0 8px #00c86b;
  animation: breathe 1.8s ease-in-out infinite;
  vertical-align: 1px;
}
.flow-note.frozen .live-dot{ background: var(--muted); box-shadow: none; animation: none; }

/* новые мысли, прилетевшие в поток */
.thought.fresh{ animation: freshIn .9s ease; }
@keyframes freshIn{
  0%  { opacity: 0; transform: translateY(-10px); box-shadow: 0 0 0 0 rgba(0,194,255,.5); }
  60% { box-shadow: 0 0 0 6px rgba(0,194,255,.18); }
  100%{ opacity: 1; transform: none; box-shadow: 0 6px 22px rgba(13,20,36,.07); }
}

.flow-more{
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 13px;
  border-radius: 13px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.6);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: .16s;
}
.flow-more:hover{ border-color: var(--violet); color: var(--violet); background: #fff; }

/* окончание потока: понятно, что дальше мыслей нет */
.flow-end{
  margin: 16px auto 8px;
  max-width: 640px;
  padding: 13px 16px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
  border-top: 1px dashed var(--line);
}
.flow-end b{ color: var(--ink-2); }
