/* Toast region/styles live in loopin-platform-social.css — do not redefine here
   or later-loaded CSS will pin messages to the bottom corner again. */

.loopin-save-post-control {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.loopin-save-post-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: .35rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition: color .15s ease, opacity .15s ease;
}

.loopin-save-post-button:hover,
.loopin-save-post-button:focus-visible {
  color: var(--loopin-accent, #111);
}

.loopin-save-post-button.is-saved {
  color: var(--loopin-accent, #111);
}

.loopin-save-post-button.is-loading {
  opacity: .55;
  pointer-events: none;
}

.loopin-save-post-count {
  font-size: .8125rem;
  font-weight: 600;
}

.loopin-save-post-feedback {
  margin: .35rem 0 0;
  font-size: .8125rem;
  color: var(--loopin-muted, #666);
}

.loopin-save-login-prompt,
.loopin-save-post-login-prompt {
  margin-top: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--loopin-border, #e5e5e5);
  border-radius: .75rem;
  background: var(--loopin-surface, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.loopin-pin-hover .loopin-save-post-login-prompt,
.loopin-pin-hover .loopin-save-login-prompt {
  display: none !important;
}

html.loopin-save-modal-open {
  overflow: hidden;
}

/* Guest prompt modals (save + like) — aligned with share sheet */
.loopin-save-guest-modal {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

html.loopin-portfolio-shorts-open .loopin-save-guest-modal {
  z-index: 100100;
}

html.loopin-portfolio-shorts-open .loopin-like-guest-modal {
  z-index: 100100;
}

@media (max-width: 767px) {
  html.loopin-portfolio-shorts-open .loopin-save-guest-modal,
  html.loopin-portfolio-shorts-open .loopin-like-guest-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
}

.loopin-save-guest-modal[hidden] {
  display: none !important;
}

.loopin-save-guest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: loopin-guest-backdrop-in 0.22s ease;
}

.loopin-save-guest-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  padding: 22px 18px 16px;
  border-radius: 24px 24px 20px 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  box-sizing: border-box;
  text-align: center;
  animation: loopin-guest-sheet-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.loopin-guest-prompt-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loopin-guest-prompt-icon::before {
  content: '';
  display: block;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.loopin-guest-prompt-icon--save {
  background: #ede9fe;
  color: #7c3aed;
}

.loopin-guest-prompt-icon--save::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M17 3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V5c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M17 3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V5c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
}

.loopin-guest-prompt-icon--like {
  background: #ECECEC;
  color: #e11d48;
}

.loopin-guest-prompt-icon--like::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.loopin-guest-prompt-icon--follow {
  background: #dbeafe;
  color: #2563eb;
}

.loopin-guest-prompt-icon--follow::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

.loopin-save-guest-title {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--loopin-text, #111);
}

.loopin-save-guest-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.loopin-guest-prompt-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--loopin-red, #1B1B1B);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, transform 0.15s ease;
}

.loopin-guest-prompt-primary:hover,
.loopin-guest-prompt-primary:focus-visible {
  background: #000000;
  color: #fff;
}

.loopin-guest-prompt-primary:active {
  transform: scale(0.98);
}

.loopin-guest-prompt-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--loopin-muted, #6b7280);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.loopin-guest-prompt-cancel:hover,
.loopin-guest-prompt-cancel:focus-visible {
  color: var(--loopin-text, #111);
  background: #f3f4f6;
}

@keyframes loopin-guest-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes loopin-guest-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 768px) {
  .loopin-save-guest-modal {
    align-items: center;
    padding: 24px;
  }

  .loopin-save-guest-dialog {
    border-radius: 24px;
    padding: 24px 20px 18px;
  }
}

@media (max-width: 767px) {
  .loopin-save-guest-modal {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .loopin-save-guest-dialog {
    max-width: none;
  }
}

.loopin-saved-posts-panel-lead {
  margin: .35rem 0 1rem;
  color: var(--loopin-muted, #666);
  font-size: .875rem;
}

.loopin-saved-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.loopin-saved-post-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  overflow: hidden;
}

.loopin-saved-post-card-link {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
}

.loopin-saved-post-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: .65rem;
  background: var(--loopin-surface-muted, #f3f3f3);
}

.loopin-saved-post-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.loopin-saved-post-card-thumb--empty {
  min-height: 100%;
}

.loopin-saved-post-card-video-badge {
  position: absolute;
  inset-inline-end: .5rem;
  inset-block-end: .5rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .75rem;
}

.loopin-saved-post-card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.loopin-saved-post-card-excerpt,
.loopin-saved-post-card-author,
.loopin-saved-post-card-date {
  margin: 0;
  font-size: .8125rem;
  color: var(--loopin-muted, #666);
}

.loopin-saved-post-card-actions {
  display: flex;
  justify-content: flex-end;
}

.loopin-pin-hover .loopin-save-post-button,
.loopin-single-post-actions .loopin-save-post-button {
  color: inherit;
}

.loopin-single-post-actions .loopin-save-post-control {
  display: inline-flex;
}

.loopin-profile-tile-save .loopin-save-post-control,
.loopin-pin-hover .loopin-save-post-control {
  display: inline-flex;
}

.loopin-pin-hover .loopin-save-post-control {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  width: 1.75rem;
  min-width: 1.75rem;
  max-width: 1.75rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.loopin-pin-hover .loopin-save-post-feedback {
  display: none !important;
}

.loopin-pin-hover .loopin-save-post-button {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  filter: none;
}

.loopin-pin-hover .loopin-save-post-button:hover,
.loopin-pin-hover .loopin-save-post-button:focus-visible {
  background: transparent;
  color: #fff;
  opacity: 0.88;
}

.loopin-pin-hover .loopin-save-post-button.is-saved {
  color: #fff;
}

.loopin-pin-hover .loopin-save-post-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

.loopin-pin-hover .loopin-save-post-icon path {
  stroke: #fff;
}

.loopin-pin-hover .loopin-save-post-button.is-saved .loopin-save-post-icon--filled path {
  fill: #fff;
  stroke: none;
}

.loopin-profile-portfolio-tile .loopin-pin-hover .loopin-save-post-icon {
  width: 1.35rem;
  height: 1.35rem;
}

@media (max-width: 640px) {
  .loopin-saved-posts-grid {
    grid-template-columns: 1fr;
  }
}
