:root {
  --mps-brand-900: #9C27B0;
  --mps-brand-500: #A259FF;
  --mps-accent: #6EE7B7;
  --mps-text: #333333;
  --mps-text-soft: #666666;
  --mps-bg: #F7F7F7;
  --mps-bg-soft: #f9f5ff;
  --mps-border: #DDDDDD;
  --mps-white: #FFFFFF;
  --mps-danger: #c62828;
  --mps-warning: #fff4d6;

  --mps-radius: 16px;
  --mps-radius-lg: 22px;
  --mps-shadow: 0 10px 28px rgba(0, 0, 0, .10);
  --mps-shadow-soft: 0 8px 22px rgba(0, 0, 0, .08);
}

/* =========================
   HUB
========================= */

.mps-im-hub {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0px 14px 40px;
  color: var(--mps-text);
}

.mps-im-hub-header {
  background: linear-gradient(180deg, rgba(162, 89, 255, .12), rgba(156, 39, 176, .06));
  border: 1px solid rgba(162, 89, 255, .20);
  border-radius: calc(var(--mps-radius) + 6px);
  padding: 18px;
  box-shadow: var(--mps-shadow);
}

.mps-im-header-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.mps-im-subtitle {
  margin: 8px 0 0;
  opacity: .85;
}

/* =========================
   VIDEO HEADER/HERO
========================= */


.mps-im-hub-hero{
  overflow:hidden;
  border-radius:16px;
  margin:10px;
}

.mps-im-hub-hero-video{
  width:100%;
  height:240px;
  object-fit:cover;
  display:block;
  filter:brightness(.88);
}



/* =========================
   SEARCH
========================= */

.mps-im-search {
  margin: 14px 0 20px;
}

.mps-im-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mps-im-search-form input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--mps-border);
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--mps-white);
  color: var(--mps-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}

.mps-im-search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--mps-brand-500);
  box-shadow: 0 0 0 3px rgba(162, 89, 255, .14);
}

.mps-im-search-form button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--mps-brand-900);
  color: var(--mps-white);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.mps-im-search-form button:hover {
  background: var(--mps-brand-500);
  transform: translateY(-1px);
}

/* =========================
   GENERIC SECTIONS
========================= */

.mps-im-section {
  margin-top: 22px;
}

.mps-im-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mps-im-section-head h2,
.mps-im-section h3 {
  margin: 0;
  color: var(--mps-text);
}

.mps-im-section-head h2 {
  font-size: 22px;
}

/* =========================
   GRID + CARD
========================= */

.mps-im-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mps-im-card {
  display: block;
  background: var(--mps-white);
  border: 1px solid rgba(162, 89, 255, .20);
  border-radius: var(--mps-radius);
  overflow: hidden;
  box-shadow: var(--mps-shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none;
  color: var(--mps-text);
}

.mps-im-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
  border-color: rgba(162, 89, 255, .35);
}

.mps-im-card-media {
  position: relative;
  background: linear-gradient(180deg, rgba(156, 39, 176, .10), rgba(0, 0, 0, 0));
}

.mps-im-card-media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.mps-im-card-fallback {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 800;
  color: var(--mps-white);
  background: linear-gradient(135deg, var(--mps-brand-900), var(--mps-brand-500));
}

.mps-im-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(0, 0, 0, .58);
  color: var(--mps-white);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, .20);
}

.mps-im-card-body {
  padding: 12px 12px 14px;
}

.mps-im-card-name {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.mps-im-card-date {
  font-size: 13px;
  opacity: .80;
  margin-bottom: 10px;
}

.mps-im-card-lastcomment {
  border-top: 1px solid rgba(162, 89, 255, .18);
  padding-top: 10px;
  margin-top: 6px;
}

.mps-im-card-lastcomment-text {
  font-size: 13px;
  line-height: 1.4;
  opacity: .92;
}

.mps-im-card-lastcomment-meta {
  margin-top: 6px;
  font-size: 12px;
  opacity: .72;
}

.mps-im-card-lastcomment--empty {
  font-size: 13px;
  opacity: .70;
}

/* =========================
   BUTTONS
========================= */

.mps-im-loadmore-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.mps-im-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--mps-brand-900);
  color: var(--mps-white);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 18px rgba(156, 39, 176, .20);
}

.mps-im-btn:hover {
  background: var(--mps-brand-500);
  transform: translateY(-1px);
  color: var(--mps-white);
}

.mps-im-btn-approve {
  background: #2e7d32;
  box-shadow: none;
}

.mps-im-btn-approve:hover {
  background: #388e3c;
}

.mps-im-btn-delete {
  background: var(--mps-danger);
  box-shadow: none;
}

.mps-im-btn-delete:hover {
  background: #d32f2f;
}

/* =========================
  BADGE CHE LINKA (non farlo diventare blu)
========================= */


.mps-im-page-badge a{
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mps-im-page-badge a:hover{
  text-decoration: none;
  opacity: .85;
}



/* =========================
   MEMORIAL PAGE LAYOUT
========================= */

.mps-im-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 14px 40px;
  color: var(--mps-text);
}

.mps-im-page-header {
  background:
    radial-gradient(circle at top right, rgba(110, 231, 183, .10), transparent 30%),
    linear-gradient(180deg, rgba(162, 89, 255, .10), rgba(156, 39, 176, .04));
  border: 1px solid rgba(162, 89, 255, .20);
  border-radius: var(--mps-radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--mps-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mps-im-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mps-im-page-main {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.mps-im-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .68);
  color: var(--mps-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}

.mps-im-page-avatar {
  width: 148px;
  height: 148px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, .92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
  background: var(--mps-bg-soft);
}

.mps-im-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mps-im-page-title {
  margin: 0 0 6px;
  color: var(--mps-text);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .2px;
}

.mps-im-page-species {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 16px;
  font-style: italic;
  color: #6c5a7a;
}

.mps-im-page-date {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: .12px;
  color: #5f4d6d;
}

.mps-im-page-owners {
  max-width: 700px;
  margin: 0 auto;
}

.mps-im-page-owners strong {
  display: block;
  margin-bottom: 8px;
  color: var(--mps-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: .1px;
}

.mps-im-owner-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mps-im-owner-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(162, 89, 255, .22);
  background: rgba(255, 255, 255, .78);
  color: var(--mps-text);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.mps-im-owner-pill a {
  color: var(--mps-brand-900);
  text-decoration: none;
}

.mps-im-owner-pill a:hover {
  color: var(--mps-brand-500);
  text-decoration: underline;
}

.mps-im-page-body {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mps-im-page-body .mps-im-section {
  margin-top: 0;
  background: linear-gradient(180deg, #ffffff, #fcfaff);
  border: 1px solid rgba(162, 89, 255, .18);
  border-radius: var(--mps-radius);
  box-shadow: var(--mps-shadow-soft);
  padding: 18px;
}

.mps-im-section h3,
.mps-im-section-head h2,
.mps-im-bio-section h3,
.mps-im-gallery-section h3,
.mps-im-timebook-section h3,
.mps-im-guestbook-slot h3,
.mps-im-guestbook h3 {
  margin: 0 0 12px;
  color: var(--mps-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .1px;
}

.mps-im-page-bio {
  max-width: 620px;
  /*margin-left: auto;*/
  margin-right: auto;
  color: #3e3447;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.85;
  font-style: italic;
  letter-spacing: .15px;
}

.mps-im-page-bio p:last-child {
  margin-bottom: 0;
}

.mps-im-empty {
  color: var(--mps-text-soft);
  font-style: italic;
  margin: 0;
}

/* =========================
   FOLLOW SLOT
========================= */

.mps-im-follow-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mps-im-page-follow .mps-im-follow-btn,
.mps-im-follow-slot .mps-im-follow-btn {
  min-width: auto;
  padding: 10px 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: .1px;
}

/* =========================
  THOUGHTS TOGGLE
========================= */

.mps-im-page-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

.mps-im-thought-slot{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.mps-im-thought-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(162,89,255,.25);
  background:#fff;
  color:var(--mps-text);
  border-radius:999px;
  padding:9px 14px;
  font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight:500;
  letter-spacing:.1px;
  cursor:pointer;
  text-decoration:none;
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease,
    background .15s ease,
    color .15s ease,
    opacity .15s ease;
}

.mps-im-thought-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 14px rgba(0,0,0,.08);
  border-color:rgba(162,89,255,.45);
  color:var(--mps-text);
}

.mps-im-thought-btn.is-active{
  color:#6b4b88;
  border-color:rgba(162,89,255,.5);
  background:
    linear-gradient(90deg,
      rgba(255,99,132,.12),
      rgba(255,206,86,.12),
      rgba(110,231,183,.12),
      rgba(162,89,255,.12)
    ),
    #fff;
}

.mps-im-thought-btn.is-active .mps-im-thought-icon::after{
  content:"❤️";
  margin-left:2px;
}

.mps-im-thought-btn.is-guest{
  opacity:.92;
}

.mps-im-thought-btn:disabled,
.mps-im-thought-btn.is-loading{
  opacity:.7;
  cursor:wait;
  pointer-events:none;
}

.mps-im-thought-btn.is-loading .mps-im-thought-icon{
  animation:mps-im-pulse .8s infinite ease-in-out;
}

.mps-im-thought-count{
  font-size:13px;
  opacity:.78;
}

@keyframes mps-im-pulse{
  0%{ transform:scale(1); }
  50%{ transform:scale(1.18); }
  100%{ transform:scale(1); }
}

@media (max-width:768px){
  .mps-im-page-actions{
    gap:6px;
  }

  .mps-im-thought-btn{
    padding:8px 12px;
  }
}

.mps-im-page-actions{
  position:relative;
}

/* =========================
   OWNERS AVATAR
========================= */

.mps-im-owner-avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  object-fit:cover;
  flex:0 0 28px;
}

.mps-im-owner-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

/* =========================
   THOUGHT USERS LIST
========================= */

.mps-im-thought-users{
  width:100%;
  max-width:280px;
  max-height:220px;
  overflow-y:auto;

  padding:6px;
  margin-top:4px;

  background:#fff;
  border:1px solid rgba(162,89,255,.18);
  border-radius:12px;

  box-shadow:0 6px 16px rgba(0,0,0,.06);
}

.mps-im-thought-users[hidden]{
  display:none;
}

.mps-im-thought-user{
  display:flex;
  align-items:center;
  gap:8px;

  padding:6px 8px;
  border-radius:8px;

  color:var(--mps-text);
  text-decoration:none;
}

.mps-im-thought-user:hover{
  background:rgba(162,89,255,.07);
  color:var(--mps-text);
}

.mps-im-thought-user-avatar{
  width:28px;
  height:28px;
  flex:0 0 28px;

  border-radius:50%;
  object-fit:cover;
}

.mps-im-thought-user-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;

  font-size:14px;
  font-weight:500;
}
.mps-im-thought-users{
  position:absolute;
  top:100%;
  right:0;
  z-index:50;

  width:280px;
  max-height:220px;
  overflow-y:auto;

  padding:6px;
  margin-top:6px;

  background:#fff;
  border:1px solid rgba(162,89,255,.18);
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}

/* =========================
   TIMELINE / TIMEBOOK
========================= */
.mps-pet-timebook-section{
  max-height:520px;
  overflow-y:auto;
  overscroll-behavior:auto;
  padding-right:4px;
}

.mps-im-timebook-section .mps-pet-activity-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.mps-im-timebook-section .mps-pet-activity-section h3 {
  display: none;
}

.mps-im-timebook-section .mps-pet-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.mps-im-timebook-section .mps-pet-activity-item {
  background: var(--mps-bg-soft);
  border: 1px solid rgba(162, 89, 255, .18);
  border-radius: 14px;
  padding: 12px;
}

.mps-im-timebook-section .mps-pet-activity-link {
  background: transparent;
  color: var(--mps-brand-900);
  border: 1px solid rgba(162, 89, 255, .35);
}

.mps-im-timebook-section .mps-pet-activity-link:hover {
  background: rgba(162, 89, 255, .08);
  color: var(--mps-brand-500);
}

/* =========================
   OWNER MESSAGE
========================= */

.mps-im-owner-message-editor{
  margin-top:10px;
}

.mps-im-owner-message-edit-toggle{
  padding:0;
  border:0;
  background:none;
  color:#6b4b88;
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}

.mps-im-owner-message-edit-toggle:hover{
  color:var(--mps-text);
}

.mps-im-owner-message-edit-panel{
  margin-top:8px;
  padding:10px 12px;
  border:1px solid rgba(162,89,255,.16);
  border-radius:10px;
  background:rgba(162,89,255,.035);
}

.mps-im-owner-message-edit-panel[hidden]{
  display:none;
}

.mps-im-owner-message-label{
  display:block;
  margin-bottom:5px;
  font-size:12px;
  font-weight:600;
}

.mps-im-owner-message-input{
  width:100%;
  min-height:72px;
  padding:8px 10px;
  font-size:13px;
  line-height:1.45;
  resize:vertical;
}

.mps-im-owner-message-save{
  margin-top:6px;
  padding:6px 10px;
  font-size:12px;
}

.mps-im-owner-message-feedback{
  margin-left:8px;
  font-size:12px;
  opacity:.75;
}

.mps-im-owner-message{
  margin-top:8px;
  padding:10px 12px;
  background:rgba(162,89,255,.045);
  border:1px solid rgba(162,89,255,.14);
  border-radius:14px;
}

.mps-im-owner-message{
  width:auto;
  max-width:100%;
  flex:0 1 auto;

  padding:10px 12px;
  background:rgba(162,89,255,.045);
  border:1px solid rgba(162,89,255,.14);
  border-radius:14px;
}

.mps-im-owner-message-author a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--mps-text);
  text-decoration:none;
  font-size:12px;
  font-weight:600;
}

.mps-im-owner-message-avatar{
  width:24px;
  height:24px;
  border-radius:50%;
  object-fit:cover;
}

.mps-im-owner-message-text{
  margin-top:6px;
  font-size:13px;
  line-height:1.5;
  opacity:.9;
}

.mps-im-owner-message-text p{
  margin:0;
}

.mps-im-owner-messages{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:8px;
  margin-top:0px;
}

/* =========================
   RITUAL / MEMORIAL INFO
========================= */

.mps-im-ritual-info-section{
  margin-top:10px;
}

/* Informazione pubblica */
.mps-im-ritual-info-public{
  display:block;
  width:auto;
  max-width:100%;
  margin:0;
  padding:0;

  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}

.mps-im-ritual-info-title{
  margin:0 0 2px;
  padding:0;

  font-size:11px;
  line-height:1.3;
  font-weight:600;
  color:#888;
}

.mps-im-ritual-info-text{
  margin:0;
  padding:0;

  font-size:12px;
  line-height:1.45;
  font-weight:400;
  color:#777;
}

.mps-im-ritual-info-text p{
  margin:0;
  padding:0;
  color:inherit;
  font-size:inherit;
  line-height:inherit;
}


/* Comando owner */
.mps-im-ritual-info-edit-toggle{
  display:inline-block;
  margin-top:5px;
  padding:0;

  border:0;
  background:transparent;
  box-shadow:none;

  color:#777;
  font-size:11px;
  line-height:1.3;
  font-weight:500;

  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}

.mps-im-ritual-info-edit-toggle:hover{
  color:#555;
  background:transparent;
}


/* Editor owner */
.mps-im-ritual-info-editor{
  margin-top:7px;
  padding:8px 10px;

  background:rgba(0,0,0,.018);
  border:1px solid rgba(0,0,0,.07);
  border-radius:8px;
  box-shadow:none;
}

.mps-im-ritual-info-editor[hidden]{
  display:none;
}

.mps-im-ritual-info-input{
  display:block;
  width:100%;
  min-height:72px;
  padding:7px 9px;

  border:1px solid rgba(0,0,0,.12);
  border-radius:6px;

  background:#fff;
  color:var(--mps-text);

  font-size:12px;
  line-height:1.45;

  resize:vertical;
}


/* Salvataggio */
.mps-im-ritual-info-save{
  margin-top:6px;
  padding:5px 9px;

  font-size:11px;
  line-height:1.3;
}

.mps-im-ritual-info-feedback{
  margin-left:7px;

  font-size:11px;
  color:#777;
}

/* =========================
   GUESTBOOK
========================= */

.mps-im-comments-wrap{
  max-height:420px;
  overflow-y:auto;
  overscroll-behavior:auto;
  padding-right:4px;
}

.mps-im-guestbook {
  margin: 0;
}

.mps-im-comment-notice {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(110, 231, 183, .18);
  border: 1px solid rgba(110, 231, 183, .45);
  color: var(--mps-text);
  font-weight: 600;
}

.mps-im-comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.mps-im-comment-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--mps-border);
  background: var(--mps-white);
  color: var(--mps-text);
  line-height: 1.55;
  box-sizing: border-box;
}

.mps-im-comment-form textarea:focus {
  outline: none;
  border-color: var(--mps-brand-500);
  box-shadow: 0 0 0 3px rgba(162, 89, 255, .14);
}

.mps-im-comment-form .mps-im-btn,
.mps-im-guestbook-slot .mps-im-btn,
.mps-im-guestbook .mps-im-btn,
.mps-im-comment-form button,
.mps-im-comment-form input[type="submit"] {
  width: auto;
  min-width: 0;
  align-self: flex-start;
  display: inline-flex;
  padding: 10px 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: .1px;
}

.mps-im-comments-wrap {
  margin-top: 10px;
}

.mps-im-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mps-im-comment {
  padding: 14px;
  border: 1px solid rgba(162, 89, 255, .16);
  border-radius: 14px;
  background: var(--mps-bg-soft);
}

.mps-im-comment-pending {
  border-color: #f0c36d;
  background: var(--mps-warning);
}

.mps-im-comment-meta {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 13px;
  color: #7b6d86;
}

.mps-im-comment-pending-label {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0bf;
  color: #8a6200;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.mps-im-comment-content {
  color: #4a3c54;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 17px;
}

.mps-im-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* =========================
   GALLERY GRID
========================= */

.mps-media-pet-gallery{
  max-height:520px;
  overflow-y:auto;
  overscroll-behavior:auto;
  padding-right:4px;
}

.mps-im-pet-gallery {
  margin-top: 8px;
}

.mps-im-pet-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.mps-im-pet-gallery-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: #f7f7f7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mps-im-pet-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.mps-im-pet-gallery-image,
.mps-im-pet-gallery-video-poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mps-im-pet-gallery-item-video {
  position: relative;
  background: #111;
  overflow: hidden;
}

.mps-im-pet-gallery-item-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.10));
  pointer-events: none;
}

.mps-im-pet-gallery-item-video::before {
  content: 'VIDEO';
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.60);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
}

.mps-im-pet-gallery-video-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  background: linear-gradient(135deg, #444, #111);
}

.mps-im-pet-gallery-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.mps-im-pet-gallery-item-video:hover .mps-im-pet-gallery-video-badge {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0, 0, 0, 0.80);
}

.mps-im-gallery-loading {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  border-radius: 16px;
  background: #f7f7f7;
  text-align: center;
}

.mps-im-gallery-loading-text {
  font-size: 15px;
  line-height: 1.5;
  color: #555;
}

.mps-im-gallery-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(162, 89, 255, 0.18);
  border-top-color: #a259ff;
  border-radius: 999px;
  animation: mps-im-spin 0.9s linear infinite;
}

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

/* =========================
   LIGHTBOX
========================= */

body.mps-im-lightbox-open {
  overflow: hidden;
}

.mps-im-lightbox[hidden] {
  display: none !important;
}

.mps-im-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mps-im-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.mps-im-lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(92vw, 1100px);
  height: min(88vh, 800px);
  margin: 4vh auto;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}

.mps-im-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.mps-im-lightbox-image,
.mps-im-lightbox-video {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  background: #111;
}

.mps-im-lightbox-caption {
  color: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  max-width: 90%;
}

.mps-im-lightbox-close,
.mps-im-lightbox-prev,
.mps-im-lightbox-next {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  transition: background 0.18s ease, transform 0.18s ease;
}

.mps-im-lightbox-close:hover,
.mps-im-lightbox-prev:hover,
.mps-im-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.04);
}

.mps-im-lightbox-close {
  position: absolute;
  top: -8px;
  right: 0;
  z-index: 3;
}

.mps-im-lightbox-prev,
.mps-im-lightbox-next {
  justify-self: center;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
  .mps-im-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .mps-im-page-title {
    font-size: 31px;
  }

  .mps-im-page-header {
    padding: 18px 14px;
  }

  .mps-im-page-avatar {
    width: 124px;
    height: 124px;
  }

  .mps-im-page-bio,
  .mps-im-comment-content {
    font-size: 16px;
  }

  .mps-im-page-body .mps-im-section {
    padding: 15px 14px;
  }

  .mps-im-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .mps-im-search-form button {
    width: 100%;
  }
}

@media (max-width: 767px) {
  .mps-im-pet-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mps-im-pet-gallery-item {
    border-radius: 12px;
  }

  .mps-im-pet-gallery-item-video::before {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 3px 7px;
  }

  .mps-im-pet-gallery-video-badge {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .mps-im-lightbox-dialog {
    width: 94vw;
    height: 90vh;
    margin: 3vh auto;
    grid-template-columns: 44px 1fr 44px;
  }

  .mps-im-lightbox-image,
  .mps-im-lightbox-video {
    max-height: 68vh;
    border-radius: 12px;
  }

  .mps-im-lightbox-close,
  .mps-im-lightbox-prev,
  .mps-im-lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .mps-im-lightbox-caption {
    font-size: 13px;
  }
}

@media (max-width: 620px) {
  .mps-im-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   EMOJI IN COMMENTS
========================= */

.mps-im-emoji-bar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 8px;
}

.mps-im-emoji-bar button{
  border:1px solid rgba(162,89,255,.18);
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  cursor:pointer;
  font-size:20px;
  line-height:1;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.mps-im-emoji-bar button:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 10px rgba(0,0,0,.08);
  background:#faf7ff;
}

/* =========================
   HUB - TIPOLOGIE MEMORIALI
========================= */

/* Base comune delle tre vetrine */
.mps-im-hub .mps-im-owned,
.mps-im-hub .mps-im-followed,
.mps-im-hub .mps-im-latest {
  padding: 14px;
  border: 1px solid;
  border-radius: 16px;
}

/* I tuoi memoriali: tono più caldo e personale */
.mps-im-hub .mps-im-owned {
  background: linear-gradient(135deg, #FFF9FB 0%, #FBEFF4 100%);
  border-color: #E7B7C8;
}

/* Memoriali che segui: tono intermedio */
.mps-im-hub .mps-im-followed {
  background: linear-gradient(135deg, #FCF9FD 0%, #F4EBF7 100%);
  border-color: #D7B7DE;
}

/* Ultimi addii: tono più neutro e leggero */
.mps-im-hub .mps-im-latest {
  background: linear-gradient(135deg, #FDFCFD 0%, #F7F4F8 100%);
  border-color: #E3DDE5;
}

/* =========================
   HUB - VETRINE MOBILE
========================= */

@media (max-width: 620px) {

  .mps-im-hub .mps-im-owned .mps-im-grid,
  .mps-im-hub .mps-im-followed .mps-im-grid,
  .mps-im-hub .mps-im-latest .mps-im-grid {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;

    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
  }

  .mps-im-hub .mps-im-grid::-webkit-scrollbar {
    display: none;
  }

  .mps-im-hub .mps-im-card {
    flex: 0 0 38%;
    min-width: 0;
    scroll-snap-align: start;
  }

  .mps-im-hub .mps-im-card-media img,
  .mps-im-hub .mps-im-card-fallback {
    height: 110px;
  }

  .mps-im-hub .mps-im-card-fallback {
    font-size: 34px;
  }

  .mps-im-hub .mps-im-card-body {
    padding: 8px 8px 9px;
  }

  .mps-im-hub .mps-im-card-name {
    margin-bottom: 3px;
    font-size: 14px;
  }

  .mps-im-hub .mps-im-card-date {
    margin-bottom: 0;
    font-size: 11px;
  }

  .mps-im-hub .mps-im-badge {
    left: 6px;
    top: 6px;
    padding: 3px 6px;
    font-size: 9px;
  }
}