.feed-toolbar {
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.feed-scale {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.feed-scale input {
  width: 100px;
  accent-color: var(--accent);
}

/* Обычная сетка вместо кладки (Эдвард 27.08): в masonry карточки читались
   столбцами, а не строками, и одна высокая работа сдвигала весь столбец —
   глазу не за что зацепиться. Колонки равные, ряды выравнены по верху. */
.feed-grid {
  display: grid;
  align-items: start;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--feed-col, 340px)), 1fr));
}

.feed-post {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-16);
  overflow: hidden;
}

.feed-badge {
  min-height: 24px;
  flex: 0 0 auto;
  padding: 0 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: transparent;
  font-size: 10px;
}

.feed-badge .icon {
  width: 13px;
  height: 13px;
}

.feed-only-good {
  gap: 7px;
  cursor: pointer;
}

.feed-only-good input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.feed-post-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
}

.feed-more-menu {
  position: absolute;
  z-index: 5;
  top: 48px;
  right: 12px;
  display: grid;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
}

.feed-more-menu[hidden] {
  display: none;
}

.feed-more-menu button {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: inherit;
  background: transparent;
  border-radius: var(--radius-8);
  font-size: 11px;
  text-align: left;
}

.feed-more-menu button:hover {
  background: var(--paper);
}

.feed-more-menu button.danger {
  color: var(--accent);
}

.feed-more-menu .icon {
  width: 16px;
  height: 16px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 750;
}

.avatar.alt {
  background: #395466;
}

.avatar.gold {
  background: #b27b28;
}

.avatar.image {
  overflow: hidden;
  background: var(--surface-2);
}

.avatar.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Подсказку рисует модель, а не человек: вместо инициалов автора в кружке
   стоит значок, и вся карточка ведёт в задачу, а не в лайтбокс. */
.avatar.hint {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.avatar.hint .icon {
  width: 17px;
  height: 17px;
}

.feed-hint .feed-media {
  cursor: pointer;
}

.feed-post-head > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.feed-post-head strong,
.feed-post-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-post-head strong {
  font-size: 12px;
}

.feed-post-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

/* Ряд сетки ровный только при постоянной высоте кадра: карточки разных
   пропорций иначе разъезжаются, и «нормальная сетка» опять становится кладкой. */
.feed-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  cursor: zoom-in;
}

.feed-media.compact {
  min-height: 132px;
  padding: 18px;
  aspect-ratio: auto;
  cursor: pointer;
}

/* Скраб итераций: кадры лежат стопкой, видно один. Все кадры — превью;
   оригинал под курсор не подтягивается, его показывает лайтбокс.
   Кадр вписывается ЦЕЛИКОМ: макет — не фотография, обрезка съедает у него
   поля, подпись или половину композиции, и по такой карточке работу не
   узнать. Ровный ряд держит постоянная высота кадра, а не кроп. */
.feed-scrub .feed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 120ms ease;
}

.feed-scrub .feed-frame.is-frame {
  opacity: 1;
}

.feed-scrub.has-frames {
  cursor: ew-resize;
}

/* Полоска кадров — единственный признак, что карточку можно листать. Она лежит
   поверх картинки любой светлоты, поэтому у неё своя подложка: без неё светлые
   макеты съедали и активный кадр. */
.feed-scrub-dots {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  background: color-mix(in srgb, var(--surface-dark) 48%, transparent);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
}

.feed-scrub-dots i {
  height: 2px;
  flex: 1;
  background: color-mix(in srgb, var(--on-dark) 38%, transparent);
  border-radius: var(--radius-pill);
}

.feed-scrub-dots i.is-active {
  background: var(--on-dark);
}

.feed-media-placeholder {
  display: grid;
  min-height: 96px;
  place-content: center;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.feed-media-placeholder .icon {
  width: 28px;
  height: 28px;
}

.feed-media-placeholder strong {
  color: var(--ink);
  font-size: 13px;
}

.feed-media-placeholder small {
  font-size: 10px;
}

.feed-post img,
.feed-post video {
  width: 100%;
  height: auto;
}

.feed-post video {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface-2);
}

.feed-post-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.feed-post-copy > p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

.feed-post-copy .note-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.feed-dishes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  padding-top: 8px;
}

.feed-post-actions .icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
}

.feed-post-actions .icon-btn > span {
  position: absolute;
  right: 1px;
  bottom: 0;
  min-width: 14px;
  color: var(--muted);
  font-size: 8px;
}

.feed-post-actions .feed-like.active {
  color: var(--accent);
}

.feed-post-actions .feed-like.active .icon {
  fill: currentColor;
}

.feed-delete {
  margin-left: auto;
}

.feed-comments {
  padding-top: 13px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.feed-comment {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 0;
}

.feed-comment .avatar {
  width: 28px;
  height: 28px;
  font-size: 7px;
}

.feed-comment strong,
.feed-comment small {
  display: inline;
  font-size: 10px;
}

.feed-comment small {
  margin-left: 6px;
  color: var(--muted);
}

.feed-comment p {
  margin: 3px 0 0;
  font-size: 12px;
}

.feed-comment .icon-btn {
  width: 28px;
  height: 28px;
}

.feed-comment-form {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.feed-comment-form input {
  min-width: 0;
  height: 38px;
  flex: 1;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-8);
  outline: 0;
}

.feed-sentinel {
  height: 1px;
}

.feed-empty,
.feed-loader {
  display: grid;
  min-height: 320px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.feed-empty > span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.feed-empty strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
}

.feed-empty p {
  max-width: 420px;
  margin: 0;
}

.feed-loader span {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: feed-spin .7s linear infinite;
}

@keyframes feed-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .feed-toolbar {
    flex-wrap: wrap;
  }

  .feed-scale {
    display: none;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }
}
