/* Feed and related cards: how much of each opened post this reader has read. */
/* Bottom edge of the card image (the top-right corner is left for the like heart). */
.read-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 4px;
  background: rgba(11, 11, 11, 0.6);
  box-shadow: 0 -1px 0 rgba(244, 242, 236, 0.18);
  pointer-events: none;
}
.read-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--read, 0%);
  background: var(--accent);
}
/* Rests on the bottom edge so it is never clipped; stays inside the card at both ends. */
.read-dot {
  position: absolute;
  bottom: 0;
  left: clamp(0px, calc(var(--read, 0%) - 5px), calc(100% - 10px));
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
/* Read to the end: a full bar, no dot. */
.read-bar.is-done .read-dot { display: none; }
/* The card is its containing block: otherwise the note is placed against the page and, inside the
   sideways-scrolling "more posts" rail, escapes its clipping and widens the page on phones. */
.card:has(> .read-note) { position: relative; }
.read-note {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Только непрочитанное": a small switch next to the post count on feeds. */
.intro-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 8px; }
.intro-side .intro-count { margin: 0; }
.unread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 600 10px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.unread-toggle::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.unread-toggle:hover { color: var(--fg); border-color: var(--fg); }
.unread-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.unread-toggle[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); }
.unread-toggle[hidden], .card[hidden], [data-all-read][hidden] { display: none; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  .intro-side { justify-content: flex-start; gap: 10px; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .unread-toggle { transition: none; } }
