/* ==========================================================================
   Reusable components
   ========================================================================== */

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast),
    opacity var(--dur-fast), box-shadow var(--dur-fast);
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--sm {
  min-height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--fs-sm);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
}

.btn.htmx-request {
  opacity: 0.7;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border-radius: var(--radius-full);
  color: var(--text-2);
  transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.9);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.chip.is-on {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- avatar ---------- */

.avatar {
  --avatar: 42px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--avatar);
  height: var(--avatar);
  flex: none;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-3);
  color: var(--text);
}

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

.avatar__initial {
  font-weight: 700;
  font-size: calc(var(--avatar) * 0.44);
  line-height: 1;
}

.avatar--xs { --avatar: 28px; }
.avatar--sm { --avatar: 36px; }
.avatar--md { --avatar: 42px; }
.avatar--lg { --avatar: 64px; }
.avatar--xl { --avatar: 96px; }

a.avatar:hover {
  filter: brightness(1.08);
}

/* ---------- cards & posts ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2) 0;
}

@media (min-width: 768px) {
  .feed {
    padding: var(--space-3) 0 0;
  }
}

.post {
  padding: var(--space-4) var(--space-4) var(--space-2);
  /* No fill-mode: a finished animation must not keep a stacking context,
     or the "⋯" menu would be covered by the next card. */
  animation: post-in var(--dur-slow) var(--ease-out);
}

.post:has(.menu__list:not([style*="display: none"])) {
  position: relative;
  z-index: 15;
}

.post.htmx-swapping {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity var(--dur-base), transform var(--dur-base);
}

@keyframes post-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* just published from the editor: drops in at the top */
.post.is-new {
  animation: post-new 560ms var(--ease-spring);
}

@keyframes post-new {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  50% {
    opacity: 1;
  }
}

/* edited in place: a soft glow */
.post.is-updated {
  animation: post-updated 900ms var(--ease-out);
}

@keyframes post-updated {
  0% {
    box-shadow: 0 0 0 0 var(--border-strong);
    transform: scale(0.99);
  }
  30% {
    box-shadow: 0 0 0 4px var(--border-strong);
    transform: none;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.post__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.post__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.post__author {
  font-weight: 700;
  font-size: var(--fs-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.post__author:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__time {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.post__time:hover {
  color: var(--text-2);
  text-decoration: underline;
}

.post__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.post__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-2) calc(var(--space-2) * -1) 0;
}

/* user text */
.prose {
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: var(--lh-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose p + p {
  margin-top: 0.7em;
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--text);
}

/* v0.13: @mentions (posts/mentions.py renders them as links to the profile; the editor's node looks the same).
   v0.13.1 (owner): just bold, no tinted background. */
.prose a.mention,
.mention {
  color: var(--mention);
  font-weight: 700;
  text-decoration: none;
}

.prose a.mention:active {
  opacity: 0.7;
}

@media (hover: hover) {
  .prose a.mention:hover {
    text-decoration: underline;
    text-decoration-color: var(--text-3);
  }
}

.prose strong {
  font-weight: 700;
}

.post--detail .prose {
  font-size: 1.125rem;
}

.prose em {
  font-style: italic;
}

.prose s {
  text-decoration: line-through;
  text-decoration-color: var(--text-2);
}

/* what the editor shows is what the feed shows: spaces and empty lines are kept */
.prose p,
.prose li {
  white-space: pre-wrap;
}

.prose p:empty {
  min-height: 1.5em;
}

.prose blockquote {
  margin: 0.6em 0;
  padding: 0.1em 0 0.1em 0.9em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2);
}

.prose ul,
.prose ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.prose li + li {
  margin-top: 0.25em;
}

.prose li::marker {
  color: var(--text-3);
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

/* ---------- a post's pictures and videos (v0.10.3, posts/components/media_row.html) ----------
   One: at its own proportions. Two to four: a row that slides sideways, each ~85 % wide so the next one peeks (owner's
   choice), all as tall as the first one's proportions allow (`--row-ratio`), cropped to fill. */

.media-row {
  position: relative;
}

.media-row__track {
  display: flex;
  gap: 6px;
}

.media-row__item {
  position: relative;
  min-width: 0;
}

.media-row--one .media-row__item {
  width: 100%;
}

.media-row__link {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: zoom-in;
}

.media-row__link img {
  display: block;
  width: 100%;
  transition: filter var(--dur-fast);
}

.media-row__link:hover img {
  filter: brightness(0.94);
}

/* one picture: whole, at its own proportions (very tall ones are letterboxed) */
.media-row--one .media-row__link img {
  height: auto;
  max-height: min(75vh, 600px);
  object-fit: contain;
}

.media-row--many .media-row__track {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.media-row--many .media-row__track::-webkit-scrollbar {
  display: none;
}

.media-row--many .media-row__item {
  flex: 0 0 85%;
  aspect-ratio: var(--row-ratio, 1);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  scroll-snap-align: start;
}

.media-row--many .media-row__item:last-child {
  scroll-snap-align: end;
}

.media-row--many .media-row__link {
  width: 100%;
  height: 100%;
}

.media-row--many .media-row__link img {
  height: 100%;
  object-fit: cover;
}

.media-row--many .player--video {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

.media-row--many .player__video {
  object-fit: cover;
}

.media-row--many .media-state {
  flex-direction: column;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.media-row__count {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.media-row__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  transition: opacity var(--dur-fast), background-color var(--dur-fast);
}

.media-row__nav--prev {
  left: 8px;
}

.media-row__nav--next {
  right: 8px;
}

/* PC: arrows, always there while there's more to see that way (v0.10.4: only on hover, they went unnoticed);
   phones slide the row with the finger. The editor's row uses them too. */
@media (hover: hover) and (pointer: fine) {
  .media-row__nav {
    display: grid;
    opacity: 0.88;
  }

  .media-row__nav:hover,
  .media-row__nav:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.82);
  }

  .media-row__nav:active {
    transform: scale(0.92);
  }

  .media-row__nav[hidden] {
    display: none;
  }
}

/* ---------- video and audio players (v0.10; pause and a draggable bar since v0.10.2, core/js/media.js) ---------- */

/* the video at its own proportions; very tall ones are letterboxed on black (like single pictures) */
.player--video {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: var(--ratio, 16 / 9);
  max-height: min(75vh, 600px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #000;
}

/* a soft shade under the controls, so the bar and the time read on bright videos */
.player--video::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  pointer-events: none;
}

.player__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player__surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.player__big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-spring);
}

.player--video.is-playing .player__big-play,
.player--video.is-waiting .player__big-play {
  opacity: 0;
  transform: scale(0.7);
}

/* waiting for data: only when the wait is noticeable */
.player__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast);
}

.player--video.is-waiting .player__spinner {
  opacity: 1;
  transition-delay: 400ms;
  animation: media-spin 0.9s linear infinite;
}

/* one row at the bottom: the time left, the bar, sound and full screen. Its gaps are still the video (a tap there
   pauses it). */
.player__controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.player__time {
  flex: none;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* the bar: thin, but the whole row's height can be grabbed */
.player__seek {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 34px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none; /* dragging seeks instead of scrolling */
  -webkit-tap-highlight-color: transparent;
}

.player__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  margin-top: -2px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
  transition: height var(--dur-fast), margin-top var(--dur-fast);
}

.player__fill {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.player__knob {
  position: absolute;
  top: 50%;
  left: calc(var(--progress, 0) * 100%);
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: transform var(--dur-fast) var(--ease-spring);
}

/* while dragging: where it's going */
.player__seek-time {
  position: absolute;
  bottom: calc(100% - 2px);
  left: calc(var(--progress, 0) * 100%);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity var(--dur-fast);
}

.player--video.is-seeking .player__track {
  height: 6px;
  margin-top: -3px;
}

.player--video.is-seeking .player__knob {
  transform: scale(1.35);
}

.player--video.is-seeking .player__seek-time {
  opacity: 1;
}

@media (hover: hover) {
  .player__seek:hover .player__track {
    height: 6px;
    margin-top: -3px;
  }

  .player__seek:hover .player__knob {
    transform: scale(1.2);
  }
}

.player__seek:focus-visible {
  outline: none;
}

.player__seek:focus-visible .player__track {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.player__btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  pointer-events: auto;
  transition: background-color var(--dur-fast), transform var(--dur-fast);
}

.player__btn::before {
  content: "";
  position: absolute;
  inset: -5px;
}

.player__btn:hover {
  background: rgba(0, 0, 0, 0.82);
}

.player__btn:active {
  transform: scale(0.9);
}

.player__icon-on,
.player__icon-off,
.player__icon-play,
.player__icon-pause {
  display: grid;
}

.player--video.has-sound .player__icon-off,
.player--video:not(.has-sound) .player__icon-on,
.player--audio.is-playing .player__icon-play,
.player--audio:not(.is-playing) .player__icon-pause,
.player--video.is-playing .player__btn--play .player__icon-play,
.player--video:not(.is-playing) .player__btn--play .player__icon-pause {
  display: none;
}

/* a thin progress line along the bottom edge: phones only (v0.10.3) */
.player__line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.player__line span {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* v0.10.3, owner's design. With a mouse (PC): the controls and their shade show only while the mouse is over the
   video, or the keyboard is in it, or the bar is being dragged. No line. */
@media (hover: hover) and (pointer: fine) {
  .player--video:not(.player--viewer) .player__controls,
  .player--video:not(.player--viewer)::after {
    opacity: 0;
    transition: opacity var(--dur-base);
  }

  .player--video:not(.player--viewer):hover .player__controls,
  .player--video:not(.player--viewer):hover::after,
  .player--video:not(.player--viewer):focus-within .player__controls,
  .player--video:not(.player--viewer):focus-within::after,
  .player--video.is-seeking .player__controls {
    opacity: 1;
  }

  .player__line {
    display: none;
  }
}

/* Phones and tablets: in the feed only pause (bottom left) and sound (bottom right), plus the line; the time, the
   bar and full screen live in the viewer (a tap on the video opens it). */
@media (hover: none), (pointer: coarse) {
  .player--video:not(.player--viewer) .player__time,
  .player--video:not(.player--viewer) .player__seek,
  .player--video:not(.player--viewer) .player__btn--full {
    display: none;
  }

  .player--video:not(.player--viewer) .player__controls {
    justify-content: space-between;
    bottom: 8px;
  }

  .player--video:not(.player--viewer)::after {
    height: 52px;
  }
}

/* The viewer's player (core/components/viewer.html): the whole stage, controls always there. */
.player--viewer {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.player--viewer[hidden] {
  display: none;
}

.player--viewer .player__video {
  background: transparent;
}

.player--viewer .player__line {
  display: none;
}

.player--viewer .player__controls {
  left: 4px;
  right: 4px;
  bottom: 0;
}

.player--viewer .player__big-play {
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
}

.player--viewer::after {
  height: 80px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
}

/* the voice player: a pill with play, the waveform, the time and the speed */
.player--audio {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
}

.player__toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-accent);
  transition: transform var(--dur-fast) var(--ease-spring);
}

.player__toggle:active {
  transform: scale(0.9);
}

.player__wave {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
  min-width: 0;
  height: 38px;
  overflow: hidden; /* on narrow phones the bars get thinner, never under the time */
  cursor: pointer;
  touch-action: none; /* dragging seeks */
}

.player__wave span {
  flex: 1 1 0;
  min-width: 1px;
  max-width: 5px;
  height: calc(var(--h, 10) * 1%);
  min-height: 3px;
  border-radius: 2px;
  background: var(--text-3);
  opacity: 0.55;
  transition: background-color var(--dur-fast), opacity var(--dur-fast);
}

.player__wave span.is-played {
  background: var(--text);
  opacity: 1;
}

.player__wave:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.player--audio .player__time {
  position: static;
  min-width: 2.6em;
  padding: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--fs-xs);
  text-align: right;
}

.player__speed {
  position: relative;
  flex: none;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.player__speed::before {
  content: "";
  position: absolute;
  inset: -8px -2px;
}

/* a post whose video/audio is still processing or failed (only its author sees it) */
.media-state {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.media-state strong {
  display: block;
  color: var(--text);
}

.media-state--failed {
  border-style: solid;
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-2));
}

.media-state--failed .icon {
  flex: none;
  color: var(--danger);
}

.media-state__spinner {
  flex: none;
  width: 22px;
  height: 22px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: var(--radius-full);
  animation: media-spin 0.9s linear infinite;
}

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

.media-grid__badges {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  display: flex;
  gap: var(--space-1);
  pointer-events: none;
}

.media-grid__badge {
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0.04em;
}

/* ---------- actions (like / comment / repost) ---------- */

.action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}

.action:hover:not(:disabled) {
  color: var(--text);
  background: var(--accent-softer);
}

.action:disabled {
  color: var(--text-3);
}

.action__icon {
  position: relative;
  display: grid;
  place-items: center;
}

.action__icon .icon--on {
  display: none;
}

.action[aria-pressed="true"] .action__icon .icon--on {
  display: block;
}

.action[aria-pressed="true"] .action__icon .icon--off {
  display: none;
}

.action--like[aria-pressed="true"] {
  color: var(--like);
}

.action--like:hover:not(:disabled) {
  color: var(--like);
  background: color-mix(in srgb, var(--like) 10%, transparent);
}

/* like: pop + burst */
.action--like.is-popping .action__icon .icon {
  animation: like-pop 420ms var(--ease-spring);
}

.action--like.is-popping .action__icon::before,
.action--like.is-popping .action__icon::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  pointer-events: none;
}

.action--like.is-popping .action__icon::before {
  border: 2px solid var(--like);
  animation: like-ring 420ms var(--ease-out) forwards;
}

.action--like.is-popping .action__icon::after {
  background:
    radial-gradient(circle, var(--like) 2px, transparent 2.5px) 50% 0 / 6px 6px no-repeat,
    radial-gradient(circle, var(--like) 2px, transparent 2.5px) 100% 50% / 6px 6px no-repeat,
    radial-gradient(circle, var(--like) 2px, transparent 2.5px) 50% 100% / 6px 6px no-repeat,
    radial-gradient(circle, var(--like) 2px, transparent 2.5px) 0 50% / 6px 6px no-repeat,
    radial-gradient(circle, #ffb3c6 1.6px, transparent 2px) 85% 15% / 5px 5px no-repeat,
    radial-gradient(circle, #ffb3c6 1.6px, transparent 2px) 85% 85% / 5px 5px no-repeat,
    radial-gradient(circle, #ffb3c6 1.6px, transparent 2px) 15% 85% / 5px 5px no-repeat,
    radial-gradient(circle, #ffb3c6 1.6px, transparent 2px) 15% 15% / 5px 5px no-repeat;
  animation: like-burst 520ms var(--ease-out) forwards;
}

@keyframes like-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.7); }
  65% { transform: scale(1.32); }
  100% { transform: scale(1); }
}

@keyframes like-ring {
  0% { transform: scale(0.3); opacity: 0.9; border-width: 6px; }
  100% { transform: scale(1.1); opacity: 0; border-width: 0; }
}

@keyframes like-burst {
  0% { transform: scale(0.4); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}

.action__count.is-bumping {
  animation: count-bump var(--dur-base) var(--ease-out);
}

/* followers / following numbers after a follow anywhere on the page (v0.9.1, app.js) */
[data-followers-of] .is-bumping,
[data-following-of] .is-bumping,
[data-followers-of].is-bumping,
[data-following-of].is-bumping {
  display: inline-block;
  animation: count-bump var(--dur-base) var(--ease-out);
}

@keyframes count-bump {
  0% { transform: translateY(0); opacity: 1; }
  45% { transform: translateY(-5px); opacity: 0; }
  55% { transform: translateY(5px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- saved posts: the bookmark (v0.15) ----------
   No number (saving is private) and no color of its own: filled in the text color, black and white like the brand.
   v0.16 (owner's request): at the right, glued to the total (comment · repost · like …… save · total), a side
   function rather than a main interaction. */

.action--save {
  justify-content: center;
  margin-left: auto;
  padding: 0 var(--space-2);
}

.action--save + .post__total {
  margin-left: 0;
}

.action--save[aria-pressed="true"] {
  color: var(--text);
}

.action--save.is-popping .action__icon .icon {
  animation: save-drop 460ms var(--ease-spring);
}

@keyframes save-drop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-5px) scale(0.86); }
  70% { transform: translateY(1px) scale(1.18); }
  100% { transform: translateY(0) scale(1); }
}

/* Guardados: a card taken out leaves in place (it comes back with Deshacer) */
.post.is-unsaved {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

/* ---------- reposts, quotes and the interactions total (v0.7) ---------- */

.action--repost[aria-pressed="true"] {
  color: var(--repost);
}

.action--repost:hover:not(:disabled) {
  color: var(--repost);
  background: color-mix(in srgb, var(--repost) 10%, transparent);
}

.action--repost.is-spinning .action__icon .icon {
  animation: repost-spin 520ms var(--ease-spring);
}

@keyframes repost-spin {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(140deg) scale(0.8); }
  100% { transform: rotate(360deg) scale(1); }
}

/* The total at the bottom right of the card: information, not a button (v0.7.1: it isn't an .action anymore, so
   nothing reacts to a hover or a tap). Its number still bumps when it changes. */
.post__total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin-left: auto;
  padding: 0 var(--space-2);
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.post__total .action__icon {
  display: grid;
  place-items: center;
}

.menu--action {
  margin-right: 0;
}

/* "ana reposteó" above a card */
.post__context {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: calc(var(--space-1) * -1) 0 var(--space-2);
  padding-left: calc(42px - 15px);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  --icon-size: 15px;
}

.post__context span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- v0.16 (owner's request): what a reply shown on its own answers, above it ----------
   Its author's avatar in the same column as the reply's, joined by the thread line (like on X); a few lines of its text
   and a thumbnail. The whole block opens the conversation at the reply. */
.post-parent {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  column-gap: var(--space-3);
  align-items: start;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.post-parent__rail {
  position: relative;
  align-self: stretch;
  min-height: 42px;
}

/* the line from its avatar down to the reply's (ends just above it) */
.post-parent__rail::after {
  content: "";
  position: absolute;
  top: 48px;
  bottom: calc((var(--space-3) + var(--space-2) - 6px) * -1);
  left: calc(50% - 1px);
  width: 2px;
  border-radius: 2px;
  background: var(--border-strong);
}

.post-parent__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.post-parent__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.post-parent__head strong {
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-parent__head time {
  flex: none;
  color: var(--text-3);
}

.post-parent__text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  line-height: var(--lh-text);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.post-parent__note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}

.post-parent__thumb {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.post-parent__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) {
  a.post-parent:hover .post-parent__text {
    color: var(--text);
  }
}

.post-parent--gone {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  color: var(--text-3);
}

.post-parent__ghost {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px dashed var(--border-strong);
  border-radius: 50%;
}

/* v0.16: tapping a card where nothing else answers opens it (core/js/app.js) */
@media (hover: hover) and (pointer: fine) {
  article.post[data-href] {
    cursor: pointer;
  }
}

/* the line links to the profile of the person who reposted (v0.7.1) */
.post__context-link {
  color: inherit;
}

.post__context-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* detail page: "3 reposts · 1 cita" */
.post__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.post__stats a:hover {
  text-decoration: underline;
}

.post__stats strong {
  color: var(--text);
}

/* the post a quote embeds */
.quote-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background-color var(--dur-fast);
}

a.quote-card:hover {
  background: var(--accent-softer);
}

.quote-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--fs-sm);
}

.quote-card__author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-card__time {
  flex: none;
  color: var(--text-3);
}

.quote-card__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  line-height: var(--lh-text);
  overflow-wrap: anywhere;
}

/* The image whole, never cropped (v0.7.1): the frame takes the image's own proportions (`--ratio`) up to a max
   height; when a tall image hits it, `contain` keeps it whole and a blurred copy fills the sides (same as link
   cards since v0.5.2). */
.quote-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ratio, 16 / 9);
  max-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.quote-card__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(24px) saturate(1.3);
  opacity: 0.55;
  transform: scale(1.3);
}

.quote-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.quote-card__more {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.quote-card__note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.quote-card--gone {
  flex-direction: row;
  align-items: center;
  color: var(--text-2);
  font-size: var(--fs-sm);
  border-style: dashed;
}

.user-row__time {
  flex: none;
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* ---------- dropdown menu ---------- */

.menu {
  position: relative;
  margin-right: calc(var(--space-2) * -1);
}

.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 200px;
  padding: var(--space-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
}

.menu__list--up {
  top: auto;
  bottom: calc(100% + 4px);
  transform-origin: bottom left;
  left: 0;
  right: auto;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-weight: 500;
  text-align: left;
  color: var(--text);
  --icon-size: 20px;
}

.menu__item:hover {
  background: var(--accent-soft);
}

.menu__item.is-danger {
  color: var(--danger);
}

.menu__item[aria-disabled="true"] {
  color: var(--text-3);
}

/* "Cancelar" and the backdrop only exist in the phone's bottom-sheet version */
.menu__item--cancel,
.menu__backdrop {
  display: none;
}

/* Phones (v0.6): the "⋯" menu of posts, comments and profiles is a bottom sheet over a dimmed page */
@media (max-width: 767px) {
  .menu__backdrop {
    position: fixed;
    inset: 0;
    z-index: 64;
    display: block;
    background: var(--overlay);
  }

  .menu__list {
    position: fixed;
    left: var(--space-2);
    right: var(--space-2);
    top: auto;
    bottom: calc(var(--space-2) + var(--safe-bottom));
    z-index: 65;
    min-width: 0;
    padding: var(--space-2);
    border-radius: var(--radius-xl);
    transform-origin: bottom center;
    animation: sheet-up var(--dur-slow) var(--ease-spring);
  }

  .menu__item {
    min-height: 52px;
    font-size: var(--fs-lg);
  }

  .menu__item--cancel {
    display: flex;
    justify-content: center;
    margin-top: var(--space-1);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    color: var(--text-2);
  }

  /* the card holding an open sheet goes above the bars and the post button */
  .post:has(.menu__list:not([style*="display: none"])),
  .profile-card:has(.menu__list:not([style*="display: none"])) {
    z-index: 63;
  }
}

/* ---------- sheets / modals ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in var(--dur-base) var(--ease-out);
}

.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up var(--dur-slow) var(--ease-spring);
}

.sheet__grabber {
  width: 40px;
  height: 5px;
  margin: var(--space-2) auto 0;
  border-radius: var(--radius-full);
  background: var(--surface-3);
}

.sheet__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.sheet__title {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: 700;
}

.sheet__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--space-4) var(--space-4);
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

@media (min-width: 768px) {
  .sheet {
    align-items: flex-start;
    padding-top: 10vh;
  }

  .sheet__panel {
    width: min(560px, calc(100vw - 48px));
    max-height: 80vh;
    border-radius: var(--radius-xl);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    animation: pop-in var(--dur-slow) var(--ease-spring);
  }

  .sheet__grabber {
    display: none;
  }
}

/* ---------- image viewer (always dark: it's for looking at photos) ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  color: #fff;
  animation: fade-in var(--dur-base) var(--ease-out);
}

.viewer[hidden] {
  display: none;
}

.viewer__backdrop {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--backdrop, 1); /* fades while you drag the picture down to close it */
  transition: opacity var(--dur-base);
}

.viewer.is-closing .viewer__backdrop {
  opacity: 0;
}

.viewer__stage {
  position: absolute;
  inset: 0;
  /* flex (not grid): a definite height, so the image's max-height: 100% really fits it on screen */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(56px + var(--safe-top)) var(--space-2) calc(var(--space-4) + var(--safe-bottom));
  touch-action: none; /* we handle pinch, pan and swipes ourselves */
  user-select: none;
  -webkit-user-select: none;
}

.viewer__img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transform-origin: center;
  will-change: transform;
  cursor: zoom-in;
  -webkit-user-drag: none;
}

.viewer.is-zoomed .viewer__img {
  cursor: grab;
  border-radius: 0;
}

.viewer.is-loading .viewer__img {
  opacity: 0;
}

.viewer__spinner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: viewer-spin 800ms linear infinite;
  pointer-events: none;
}

.viewer.is-loading .viewer__spinner {
  opacity: 1;
}

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

.viewer__bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: calc(var(--space-2) + var(--safe-top)) var(--space-3) var(--space-6);
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
  font-size: var(--fs-sm);
  pointer-events: none;
}

.viewer__bar > * {
  pointer-events: auto;
}

.viewer__count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.viewer__caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.75);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer__btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background-color var(--dur-fast), transform var(--dur-fast);
}

.viewer__btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.viewer__btn:active {
  transform: scale(0.92);
}

.viewer__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.viewer__nav:active {
  transform: translateY(-50%) scale(0.92);
}

.viewer__nav[hidden] {
  display: none;
}

.viewer__nav--prev {
  left: calc(var(--space-3) + var(--safe-left));
}

.viewer__nav--next {
  right: calc(var(--space-3) + var(--safe-right));
}

/* On phones you swipe between images; the arrows would cover the picture. */
@media (hover: none) and (pointer: coarse) {
  .viewer__nav {
    display: none;
  }
}

.viewer.is-closing .viewer__bar,
.viewer.is-closing .viewer__nav {
  opacity: 0;
  transition: opacity 150ms;
}

/* Thumbnails that open the viewer say so */
a.media {
  cursor: zoom-in;
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 16px; /* 16px avoids iOS zooming into the field */
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__error,
.form-error {
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.form-error {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.field__help {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- small character counter ---------- */

.counter {
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.counter.is-warning {
  color: #ffb340;
}

.counter.is-over {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- link preview card ---------- */

.link-card {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color var(--dur-fast);
}

.link-card:hover {
  border-color: var(--border-strong);
}

/* The picture is shown whole (an album cover or a logo isn't cropped or zoomed), centered over a blurred,
   enlarged copy of itself that fills the rest of the frame. */
.link-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1.91 / 1;
  background: var(--surface-3);
}

.link-card__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(24px) saturate(1.3);
  opacity: 0.55;
  transform: scale(1.3);
}

.link-card__image {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.link-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
}

.link-card__domain {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.link-card__title {
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-card--pending {
  height: 74px;
}

/* next to images the link card gets small: thumbnail on the left, text on the right */
.link-card--compact {
  display: flex;
  align-items: stretch;
  min-height: 76px;
}

.link-card--compact .link-card__media {
  width: 96px;
  min-height: 76px;
  aspect-ratio: auto;
  flex: none;
  border-right: 1px solid var(--border);
}

.link-card--compact .link-card__image {
  position: absolute;
  inset: 0;
}

.link-card--compact .link-card__text {
  justify-content: center;
  min-width: 0;
}

/* ---------- skeleton loading ---------- */

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 37%, var(--skeleton) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.skeleton-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.skeleton--avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
}

.skeleton--line {
  height: 12px;
}

/* ---------- feed helpers ---------- */

.load-more {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
}

.feed-end,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  color: var(--text-3);
  text-align: center;
  font-size: var(--fs-sm);
}

.feed-end .icon {
  --icon-size: 20px;
}

.empty-state {
  padding: var(--space-10) var(--space-4);
}

.empty-state__title {
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 700;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--space-4));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  animation: pop-in var(--dur-slow) var(--ease-spring);
  --icon-size: 18px;
}

.toast--error {
  background: var(--danger);
  color: #fff;
}

.toast--link {
  pointer-events: auto;
}

.toast__link {
  margin: -10px -8px;
  padding: 10px 8px;
  font-weight: 800;
  white-space: nowrap;
}

.toast__link span:last-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .toasts {
    bottom: var(--space-6);
  }
}

/* ---------- user list (reposts list; the Posters lists have their own since v0.9) ---------- */

.user-list {
  display: flex;
  flex-direction: column;
}

.user-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background-color var(--dur-fast);
}

.user-row:hover {
  background: var(--accent-soft);
}

.user-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-row__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row__bio {
  color: var(--text-3);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- account chip (desktop nav footer) ---------- */

.account-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: var(--space-2);
  border-radius: var(--radius-full);
  text-align: left;
  transition: background-color var(--dur-fast);
}

.account-chip:hover {
  background: var(--accent-soft);
}

.account-chip__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1099px) {
  .account-chip {
    justify-content: center;
    width: auto;
    padding: var(--space-1);
  }

  .account-chip__name,
  .account-chip__more {
    display: none;
  }
}

/* ---------- v0.8: switch, notes, more skeletons, "Ver post" in the viewer ---------- */

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  cursor: pointer;
}

.switch__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.switch__text span {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  transition: background-color var(--dur-base), border-color var(--dur-base);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--text-2);
  transition: transform var(--dur-slow) var(--ease-spring), background-color var(--dur-base);
}

.switch__input:checked + .switch__track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch__input:checked + .switch__track::after {
  background: var(--on-accent);
  transform: translateX(20px);
}

.switch__input:focus-visible + .switch__track {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.notice .icon {
  flex: none;
  color: var(--text-3);
}

.skeleton--tile {
  aspect-ratio: 1;
  border-radius: 0;
}

.skeleton--row {
  height: 56px;
  border-radius: var(--radius-md);
}

.viewer__post {
  width: auto;
  padding: 0 var(--space-4);
  font-weight: 700;
}
/* ==========================================================================
   v0.9: presence, the "Posters" lists and the mini-profile
   ========================================================================== */

/* an avatar with the green "online" dot */
.presence {
  position: relative;
  display: inline-flex;
  flex: none;
}

.presence__dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--online);
  box-shadow: 0 0 0 2.5px var(--surface);
  animation: pop-in var(--dur-slow) var(--ease-spring);
}

.presence--lg .presence__dot {
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 3px var(--surface);
}

.presence--xl .presence__dot {
  right: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 4px var(--surface);
}

/* the "Posters" list: Seguidos / Todos, search in Todos */
.people {
  display: flex;
  flex-direction: column;
}

.people--aside {
  padding-bottom: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.people__header {
  padding: var(--space-3) var(--space-4) var(--space-1);
}

.people__title {
  font-size: var(--fs-xl);
}

.people__controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-2);
}

/* On phones the page has no visible title (v0.9.1): the tabs stick right under the top bar, and to the very top
   while it's hidden. From 768 px the page header shows and they stick under it (below). */
.people--page .people__controls {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top));
  z-index: 10;
  padding: var(--space-2) 0;
  background: var(--bg);
  transition: top var(--dur-slow) var(--ease-out);
}

html[data-scroll="down"] .people--page .people__controls {
  top: var(--safe-top);
}

@media (max-width: 767px) {
  .page-header.people-page__header { /* two classes: pages.css (loaded later) styles .page-header */
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.people__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
}

.people__tab {
  position: relative;
  z-index: 1;
  min-height: 38px;
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: color var(--dur-base);
}

.people__tab.is-active {
  color: var(--on-accent);
}

/* a pill slides under the chosen tab, like the login tabs */
.people__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: transform var(--dur-slow) var(--ease-spring);
}

.people__indicator.is-right {
  transform: translateX(100%);
}

.people__search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-3);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.people__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.people__input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px; /* no zoom on iOS */
  outline: none;
}

.people__list {
  display: flex;
  flex-direction: column;
}

.people--aside .people__list {
  padding: 0 var(--space-2);
}

.people--page .people__list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-2);
}

.person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 60px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background-color var(--dur-fast);
}

.person:hover,
.person:active {
  background: var(--accent-soft);
}

.person__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.person__name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person__bio {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person__status {
  flex: none;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.person__status.is-online {
  color: var(--online);
  font-weight: 700;
}

.people__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-3);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}

.people__empty .empty-state__title {
  font-size: var(--fs-md);
}

.page-header__title--solo {
  padding-left: var(--space-2);
}

/* ---------- mini-profile: floating card on PC, bottom sheet on phones ---------- */

.mini-pop {
  position: fixed;
  z-index: 45;
  width: 300px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}

.mini-pop.is-in {
  opacity: 1;
  transform: none;
}

.sheet__header--end {
  justify-content: flex-end;
  padding-bottom: 0;
}

.sheet--mini .sheet__body {
  padding: 0;
}

.mini-card {
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-4) var(--space-4);
}

.mini-card--loading {
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.mini-card__banner {
  aspect-ratio: 3 / 1;
  margin: 0 calc(var(--space-4) * -1);
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--surface-3) 0%, transparent 55%),
    var(--surface-2);
}

.mini-card__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-card__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: -32px;
}

.mini-card__avatar {
  border-radius: var(--radius-full);
}

.mini-card__avatar .avatar {
  border: 3px solid var(--surface);
  box-sizing: content-box;
}

.mini-card__name {
  margin-top: var(--space-2);
  overflow: hidden;
  font-size: var(--fs-xl);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card__name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mini-card__status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.mini-card__status.is-online {
  color: var(--online);
  font-weight: 700;
}

.mini-card__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--online);
}

.mini-card__bio {
  margin-top: var(--space-2);
  color: var(--text-2);
  font-family: var(--font-text);
  overflow-wrap: anywhere;
}

.mini-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin-top: var(--space-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.mini-card__stats > * {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 40px;
  padding-top: 10px;
}

.mini-card__stats strong {
  color: var(--text);
}

.mini-card__stats a:hover strong {
  text-decoration: underline;
}

.mini-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.mini-card__buttons .btn {
  flex: 1;
}
@media (min-width: 768px) {
  .people--page .people__controls,
  html[data-scroll="down"] .people--page .people__controls {
    top: 52px;
  }
}
/* the mini-profile sheet: the close button and the grabber sit on the banner */
.sheet--mini .sheet__panel {
  overflow: hidden;
}

.sheet--mini .sheet__grabber {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%);
}

.sheet--mini .sheet__header {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  padding: 0;
}

.sheet--mini .sheet__header .icon-btn {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sheet--mini .sheet__body {
  padding-bottom: var(--space-2);
}
/* v0.9 (phone review): a post's name and time are small text links; an invisible 44 px tall hit area, same look */
.post__author,
.post__time {
  position: relative;
}

.post__author::after,
.post__time::after {
  content: "";
  position: absolute;
  inset: -10px -4px;
}
/* ---------- v0.11: navigation without reloads (core/js/router.js, core/components/router_chrome.html) ---------- */

.view:focus {
  outline: none;
}

/* Changing views (View Transitions API, where the browser has it): the page underneath fades with a short slide,
   reversed going back; the bars, the side menu, the Posters column and the "post" button are captured on their own,
   so they stay still and above it. Names exist only while a change runs (html[data-nav-dir]). */
html[data-nav-dir] .topbar {
  view-transition-name: topbar;
}

html[data-nav-dir] .bottomnav {
  view-transition-name: bottomnav;
}

html[data-nav-dir] .sidenav {
  view-transition-name: sidenav;
}

html[data-nav-dir] .aside {
  view-transition-name: aside;
}

html[data-nav-dir] .fab {
  view-transition-name: fab;
}

::view-transition-group(*) {
  animation-duration: 220ms;
}

::view-transition-old(root) {
  animation: view-out 160ms var(--ease-out) both;
}

::view-transition-new(root) {
  animation: view-in 220ms var(--ease-out) both;
}

html[data-nav-dir="back"]::view-transition-old(root) {
  animation-name: view-out-back;
}

html[data-nav-dir="back"]::view-transition-new(root) {
  animation-name: view-in-back;
}

@keyframes view-out {
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes view-out-back {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes view-in-back {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* a view that takes more than ~300 ms: a thin bar at the top that creeps on until it arrives */
.router-progress {
  position: fixed;
  top: var(--safe-top);
  left: 0;
  right: 0;
  z-index: 80;
  height: 2px;
  background: var(--text);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.router-progress.is-on {
  opacity: 1;
  transform: scaleX(0.8);
  transition: transform 6s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 120ms;
}

.router-progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 180ms var(--ease-out), opacity 240ms 80ms;
}

.view--skeleton {
  pointer-events: none;
}

/* v0.13: a view reloaded in place (Inicio tapped at the top) settles in, so it's clear it updated */
.view--fresh {
  animation: view-fresh 320ms var(--ease-out);
}

@keyframes view-fresh {
  from {
    opacity: 0.35;
    transform: translateY(6px);
  }
}

.skeleton-profile {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
  overflow: hidden;
}

.skeleton-profile__banner {
  aspect-ratio: 3 / 1;
  border-radius: 0;
}

.skeleton-profile__avatar {
  width: 84px;
  height: 84px;
  margin: -54px 0 0 var(--space-4);
  border: 4px solid var(--surface);
}

.skeleton-profile__name {
  width: 40%;
  margin-left: var(--space-4);
}

.skeleton-profile__meta {
  width: 62%;
  margin-left: var(--space-4);
}

.skeleton-section {
  width: 30%;
  margin: var(--space-5) 0 var(--space-3);
}

/* pull down from the top to bring what's new (phones, owner's decision); it replaces the browser's own, which
   reloads the whole page */
html.has-pull {
  overscroll-behavior-y: contain;
}

.pull {
  --pull: 0;
  position: fixed;
  top: calc(var(--safe-top) + var(--topbar-h));
  left: 50%;
  z-index: 29; /* comes out from under the top bar */
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-3);
  opacity: 0;
  transform: translateY(calc(var(--pull) * 1px - 48px));
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast);
  pointer-events: none;
}

.pull .icon {
  transform: rotate(calc(var(--pull) * 3deg));
}

.pull.is-on {
  opacity: 1;
}

.pull.is-on:not(.is-spinning) {
  transition: none;
}

.pull.is-ready {
  color: var(--text);
}

.pull.is-spinning .icon {
  animation: pull-spin 700ms linear infinite;
}

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

/* "Posts nuevos": a kept Inicio caught up while you were further down (owner's decision: it updates by itself) */
.fresh-pill {
  position: fixed;
  top: calc(var(--safe-top) + var(--topbar-h) + var(--space-3));
  left: 50%;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: fresh-in var(--dur-slow) var(--ease-spring);
  --icon-size: 16px;
}

.fresh-pill::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

@keyframes fresh-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
}

@media (min-width: 768px) {
  .fresh-pill {
    top: var(--space-4);
  }
}

/* no connection: the view stays as it was, with a way to try again */
.router-offline {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--space-4));
  z-index: 61;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: pop-in var(--dur-slow) var(--ease-spring);
  --icon-size: 18px;
}

@media (min-width: 768px) {
  .router-offline {
    bottom: var(--space-6);
  }
}
/* ---------- v0.11: the installable app (core/js/pwa.js) ---------- */

/* "Hay una versión nueva": discreet, above the bar; the page keeps working until it's tapped */
.release-bar {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + var(--topbar-h) + var(--space-3)); /* clear of the post button and the toasts */
  z-index: 59;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: var(--space-2) var(--space-1) var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: pop-in var(--dur-slow) var(--ease-spring);
  --icon-size: 18px;
}

.release-bar .btn {
  margin-left: var(--space-1);
}

.release-bar__close {
  color: var(--text-3);
}

@media (min-width: 768px) {
  .release-bar {
    top: var(--space-4);
  }
}

/* installing on iPhone: the steps */
.install-steps {
  display: grid;
  gap: var(--space-4);
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
}

.install-steps__lead {
  margin: 0;
  color: var(--text-2);
}

.install-steps__list {
  display: grid;
  gap: var(--space-3);
}

.install-steps__list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: var(--space-3);
  line-height: var(--lh-text);
}

.install-steps__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
}

/* the page without a connection (core/templates/core/offline.html) */
.offline-card {
  text-align: center;
}

.offline-card .auth__brand .brand-wordmark {
  height: 48px;
  animation: none;
}

.offline-card__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
}
/* v0.11: a repost answers the tap at once, before the server does */
.action.is-pending .action__icon {
  animation: pending-pulse 700ms var(--ease-out) infinite alternate;
}

@keyframes pending-pulse {
  to {
    opacity: 0.45;
    transform: scale(0.9);
  }
}
/* the profile picture you tapped travels to its place on the profile (core/js/router.js, only during the change) */
::view-transition-group(profile-avatar) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

::view-transition-old(profile-avatar),
::view-transition-new(profile-avatar) {
  height: 100%;
  border-radius: 50%;
}
/* ---------- v0.12: notifications (notifications/templates/…, the bell in the menus) ---------- */

/* the bell's count: unseen groups (9+ at most) */
.nav-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--like);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pop-in var(--dur-slow) var(--ease-spring);
}

.nav-badge.is-bumping {
  animation: count-bump 420ms var(--ease-spring);
}

.notif-header {
  flex-wrap: wrap;
}

.notif-header__read,
.ul-header__read {
  margin-left: auto;
}

/* phones get the short label, so the button never spills out of the screen (v0.16: the Updatelog's too) */
.notif-header__short,
.ul-header__short {
  display: none;
}

@media (max-width: 479px) {
  .notif-header__long,
  .ul-header__long {
    display: none;
  }

  .notif-header__short,
  .ul-header__short {
    display: inline;
  }
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) 0;
}

.notif-day {
  margin: var(--space-3) var(--space-2) var(--space-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.notif {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: background var(--dur-fast);
}

/* not opened yet: highlighted, with a dot beside its icon */
.notif.is-unread {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.notif.is-unread::before {
  content: "";
  position: absolute;
  top: calc(var(--space-3) + 13px);
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--like);
}

@media (hover: hover) {
  .notif:has(.notif__link):hover {
    background: var(--surface-2);
  }
}

.notif__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-2);
}

.notif--like .notif__icon {
  color: var(--like);
}

.notif--repost .notif__icon {
  color: var(--repost);
}

.notif--follow .notif__icon {
  color: var(--follow);
}

.notif--comment .notif__icon {
  color: var(--comment);
}

.notif--moderation .notif__icon {
  color: var(--warning);
}

.notif__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notif__faces {
  display: flex;
}

.notif__faces .avatar {
  --avatar: 30px;
  margin-right: -8px;
  box-shadow: 0 0 0 2px var(--surface);
}

.notif.is-unread .notif__faces .avatar {
  box-shadow: 0 0 0 2px var(--surface-2);
}

.notif__text {
  margin: 0;
  color: var(--text);
  line-height: var(--lh-text);
  overflow-wrap: anywhere;
}

.notif__text strong {
  font-weight: 700;
}

.notif__link {
  color: inherit;
  text-decoration: none;
}

/* the whole card opens it */
.notif__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.notif__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-text);
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.notif__time {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* "Seguir también" sits above the card's link */
.notif__action {
  position: relative;
  z-index: 1;
  align-self: center;
}

.notif-empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
}

/* the quiet invitation to turn on the phone's notifications */
.notif-invite {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) var(--space-2) 0;
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
}

.notif-invite__icon {
  color: var(--follow);
}

.notif-invite__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: var(--fs-sm);
}

.notif-invite__text span {
  color: var(--text-2);
}

.notif-invite__close {
  color: var(--text-3);
}

/* Configuración → Notificaciones */
.push-state {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.push-state p {
  margin: 0;
  color: var(--text-2);
}

.switch-list {
  display: grid;
  gap: var(--space-2);
}
/* ---------- v0.13: the @ list, blocking, Menciones ---------- */

/* the editor's @ list: under the caret on PC; on phones a strip just above the keyboard (editor.js places it) */
.mention-menu {
  position: fixed;
  z-index: 58; /* over the editor's modal (55), under toasts (60) */
  width: min(300px, calc(100vw - 2 * var(--space-3)));
  max-height: 264px;
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  touch-action: pan-y; /* v0.13.1: only its own vertical scroll (editor.js stops it from reaching the page) */
}

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

.mention-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
}

.mention-menu__item.is-active,
.mention-menu__item:active {
  background: var(--accent-soft);
}

@media (hover: hover) {
  .mention-menu__item:hover {
    background: var(--accent-softer);
  }
}

.mention-menu__face {
  position: relative;
  flex: none;
}

.mention-menu__face .avatar {
  --avatar: 34px;
}

.mention-menu__dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 2px var(--surface);
}

.mention-menu__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mention-menu__name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-menu__hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.mention-menu__empty {
  padding: var(--space-3);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* the block confirmation (looks like the report dialog: moderation.css) */
.block-dialog__points {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.block-dialog__points li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-text);
}

.block-dialog__points .icon {
  margin-top: 2px;
  color: var(--text);
}

.block-dialog__text {
  margin: 0 0 var(--space-4);
  color: var(--text-2);
  line-height: var(--lh-text);
}

.block-dialog__buttons {
  display: grid;
  gap: var(--space-2);
}

/* the profile of someone blocked either way */
.blocked-note {
  margin-top: var(--space-4);
}

.blocked-note__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
}

/* Configuración → Privacidad → Cuentas bloqueadas */
.blocked-list {
  display: grid;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
}

.blocked-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
}

.blocked-list__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.blocked-list__text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-list__text .muted {
  font-size: var(--fs-xs);
}

/* Notificaciones: Todas · Menciones */
.notif-tabs {
  margin: var(--space-2) var(--space-2) 0;
}
