/* Stemma Management UI */
.btn-stemma-action {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.btn-stemma-action.primary {
  background: #4f46e5;
  color: white;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.btn-stemma-action.primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.25);
}

.btn-stemma-action.upload-label {
  background: #f1f5f9;
  color: #64748b;
}

.btn-stemma-action.upload-label:hover {
  background: #e2e8f0;
  color: #334155;
  transform: translateY(-1px);
}

/* Profile Header & Identity */

.profile-avatar-container {
  position: absolute;
  bottom: -72px;
  left: 40px;
  padding: 6px;
  background: var(--surface-color);
  border-radius: 50%;
  z-index: 15;
}

.principal-relationship-slot--profile {
  position: relative;
  z-index: 16;
  min-height: 28px;
  min-width: 0;
  max-width: none;
  width: calc(100% - 248px);
  margin: 0 20px 12px 228px;
  display: flex;
  align-items: flex-start;
}

.principal-relationship-list--profile {
  justify-content: flex-start;
  width: 100%;
}

.principal-relationship--profile .principal-relationship__label {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.profile-container {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  position: relative;
}

.profile-container.ready {
  opacity: 1;
}

#profile-skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: white;
  overflow-y: auto;
  overflow-x: hidden;
}

#profile-skeleton-overlay.hidden {
  display: none;
}

@media (max-width: 768px) {
  #profile-skeleton-overlay,
  .tribute-modal-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  #profile-skeleton-overlay::-webkit-scrollbar,
  .tribute-modal-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

.profile-container--boot {
  opacity: 1;
}

.profile-avatar--skeleton {
  display: block;
  border: 4px solid var(--surface-color);
  background: rgba(226, 232, 240, 0.82);
}

.boot-profile-shell {
  max-width: 1000px;
  min-height: 100%;
  margin: 0 auto;
  background: white;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

.boot-profile-header {
  position: relative;
  height: 220px;
  overflow: visible;
}

.boot-profile-cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
}

.boot-profile-nav {
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  gap: 16px;
  z-index: 2;
}

.boot-profile-avatar-wrap {
  position: absolute;
  left: 40px;
  bottom: -72px;
  padding: 6px;
  border-radius: 50%;
  background: var(--surface-color);
  z-index: 2;
}

.boot-profile-avatar {
  display: block;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 4px solid var(--surface-color);
  background: rgba(226, 232, 240, 0.82);
}

.boot-profile-title-wrap {
  position: relative;
  min-height: 50px;
  margin-top: -20px;
  z-index: 1;
}

.boot-profile-title {
  margin-left: 228px;
  padding: 24px 20px 20px 0;
  box-sizing: border-box;
}

.boot-profile-title-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boot-profile-title-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.boot-profile-title-meta {
  height: 12px;
}

.boot-profile-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.boot-profile-title-action {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(226, 232, 240, 0.78);
}

.boot-profile-tribute-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 2rem 0;
}

.boot-profile-tribute-button {
  width: 148px;
  height: 28px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.82);
}

.boot-profile-content {
  padding: 1.5rem 2rem 2rem;
}

.boot-profile-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
}

.boot-profile-col {
  min-width: 0;
}

.boot-profile-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
}

.boot-profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

.boot-profile-card-action {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(226, 232, 240, 0.78);
  flex-shrink: 0;
}

.boot-profile-photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.boot-profile-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: rgba(226, 232, 240, 0.78);
}

.boot-profile-detail-list {
  margin-top: 0.25rem;
}

.boot-profile-detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid #f8fafc;
}

.boot-profile-detail-row:last-child {
  border-bottom: none;
}

.boot-profile-detail-label {
  display: block;
  width: 82px;
  height: 10px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.76);
}

.boot-profile-detail-value {
  display: block;
  justify-self: end;
  width: min(62%, 220px);
  height: 14px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.82);
}

.boot-profile-family-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.boot-profile-family-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.boot-profile-family-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}

.boot-profile-family-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.82);
  flex-shrink: 0;
}

.boot-profile-family-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.profile-avatar {
  box-sizing: border-box;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background-color: var(--bg-color);
  border: 4px solid var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  color: var(--text-secondary);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
}

.profile-title-wrapper {
  position: relative;
  width: 100%;
  min-height: 50px;
  background: transparent;
  margin-top: -20px; /* Ridotto: ora sta subito sotto la copertina invece che sopra */
  margin-bottom: 0;
  z-index: 10;
}

/* Modern, Circular & Minimal profile nav buttons */
.profile-nav-buttons {
  z-index: 1005;
  gap: 16px;
}

#back-to-tree,
#center-in-tree,
#help-tour-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-tree:hover,
#center-in-tree:hover,
#help-tour-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

#back-to-tree span,
#center-in-tree span,
#help-tour-btn span {
  font-size: 22px;
}

.profile-title {
  margin-left: 228px;
  padding: 24px 20px 20px 0; /* Aumentato il padding-top da 16px a 24px per abbassare il testo */
  box-sizing: border-box;
}

.profile-title-flex {
  display: flex;
  align-items: baseline; /* Allinea alla base delle lettere */
  flex-wrap: nowrap;
  gap: 12px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  align-items: baseline; /* Allinea matitina e secchiello sulla stessa linea */
  flex-shrink: 0;
}

.profile-title h1 {
  line-height: 1.1 !important; /* Rende il blocco testo piÃ¹ solido */
  margin: 0 !important;
  margin-bottom: 2px !important; /* Spinge il nome attaccato alle date */
  padding: 0 !important;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  word-break: break-word;
}

/* Profile Name Edit Modal (Dialog) */
.name-edit-dialog {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}

.name-edit-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.name-edit-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.name-edit-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 24px 32px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  animation: dialogScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@keyframes dialogScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.name-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.name-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .name-edit-card {
    padding: 20px;
    width: 85%;
    gap: 16px;
  }
  .name-edit-grid {
    gap: 12px;
  }
}

.name-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px; /* Reduced gap between label and input */
}

.name-edit-field label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  padding-left: 2px;
}

.name-edit-input {
  font: inherit;
  font-size: 1.35rem !important; /* Smaller, more balanced */
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid #f1f5f9 !important;
  padding: 6px 2px !important;
  width: 100%;
  outline: none !important;
  transition: all 0.2s;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: left; /* Standard alignment */
}

.name-edit-input:focus {
  border-color: var(--primary-color) !important;
}

.name-edit-input.small-input {
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
}

.name-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

.name-save-btn,
.name-cancel-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.name-save-btn {
  background: #10b981;
  color: white;
}

.name-cancel-btn {
  background: #f1f5f9;
  color: #64748b;
}

.name-save-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}
.name-cancel-btn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Mobile logic for name edit */
@media (max-width: 900px) {
  .name-edit-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .name-edit-field {
    width: 100%;
  }

  .name-edit-input {
    font-size: 1.1rem !important;
    padding: 12px 14px !important;
  }

  .name-edit-actions {
    justify-content: center;
    width: 100%;
    margin-top: 5px;
    height: auto;
  }
}

.profile-title p {
  margin: 0 !important; /* Azzera il margine superiore precedente di 6px */
  color: var(--text-secondary);
  font-size: 1.05rem; /* Misura premium per desktop */
  font-weight: 500;
}

/* Content Grid */
.profile-content {
  padding: 2rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
}

.info-card {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
}

.info-card h3 {
  margin-top: 0;
  color: #334155;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#profile-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#profile-details-list li {
  padding: 12px 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #f8fafc;
  display: grid !important;
  /* Solo 2 colonne: Label fissa (140px) e Valore flessibile (1fr) fino al bordo */
  grid-template-columns: 140px 1fr !important;
  align-items: center !important;
  min-height: 56px !important;
  box-sizing: border-box !important;
}

#profile-details-list li:last-child {
  border-bottom: none;
}

.detail-label {
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-value {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  text-align: right !important;
  width: 100%;
  height: 32px !important; /* Altezza fissa rigorosa per il blocco centrale */
  line-height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.95rem;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  height: auto !important;
  line-height: 1.25 !important;
  flex-wrap: wrap;
}

.profile-provenance-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.profile-provenance-badge .material-symbols-outlined {
  font-size: 15px;
}

.profile-provenance-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 60;
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 6px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s ease;
}

.profile-provenance-badge.status-attested {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.profile-provenance-badge.status-contested {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.profile-provenance-badge.status-candidate {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.profile-provenance-badge.is-database-only {
  cursor: default;
}

.profile-provenance-badge:hover,
.profile-provenance-badge:focus-visible {
  filter: brightness(0.97);
  outline: 2px solid rgba(79, 70, 229, 0.2);
  outline-offset: 1px;
}

.profile-provenance-badge:hover::after,
.profile-provenance-badge:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-place-badge {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 50%;
  color: #0f766e;
  background: rgba(240, 253, 250, 0.92);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  cursor: help;
}

.profile-place-badge > .material-symbols-outlined {
  font-size: 14px;
  font-variation-settings: 'FILL' 1;
}

.profile-place-badge:hover,
.profile-place-badge:focus-visible,
.profile-place-badge.is-open {
  border-color: rgba(13, 148, 136, 0.58);
  outline: 2px solid rgba(13, 148, 136, 0.13);
  outline-offset: 1px;
  color: #047857;
  background: #ecfdf5;
}

.profile-place-tooltip {
  position: absolute;
  right: -4px;
  bottom: calc(100% + 10px);
  z-index: 80;
  display: grid;
  width: max-content;
  min-width: 220px;
  max-width: min(320px, 82vw);
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 14px;
  color: #0f172a;
  text-align: left;
  white-space: normal;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.18),
    0 3px 10px rgba(15, 118, 110, 0.08);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.98);
  transform-origin: bottom right;
  transition:
    opacity 0.16s ease,
    visibility 0.16s ease,
    transform 0.16s ease;
}

.profile-place-tooltip::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-right: 1px solid rgba(15, 118, 110, 0.18);
  border-bottom: 1px solid rgba(15, 118, 110, 0.18);
  background: #fff;
  transform: rotate(45deg);
}

.profile-place-badge:hover .profile-place-tooltip,
.profile-place-badge:focus-visible .profile-place-tooltip,
.profile-place-badge.is-open .profile-place-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.profile-place-tooltip-eyebrow {
  color: #0f766e;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.profile-place-tooltip-title {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.profile-place-tooltip-history {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
}

.profile-place-tooltip-meta {
  margin-top: 2px;
  color: #047857;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-transform: uppercase;
}

.profile-place-tooltip-coordinates {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.61rem;
  font-weight: 650;
  line-height: 1.25;
}

.inline-edit-row .inline-edit-input,
.inline-edit-row .inline-edit-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 !important; /* ZERO padding per non spingere il testo a sinistra */
  background: transparent !important; /* Sfondo invisibile */
  border: none !important; /* Niente scatola */
  border-bottom: 1px solid rgba(148, 163, 184, 0.4) !important; /* Solo linea inferiore discreta */
  border-radius: 0 !important;
  color: #1e293b !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important; /* Stesso peso del testo statico */
  text-align: right !important; /* Tutto rigorosamente a destra */
  box-sizing: border-box !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
  width: 100%;
}

/* Focus State Premium (Solo linea sotto colorata) */
.inline-edit-row .inline-edit-input:focus,
.inline-edit-row .inline-edit-select:focus {
  border-bottom: 2px solid #4f46e5 !important; /* Colore primary */
  outline: none !important;
}

/* Freccia Discreta per le Select */
.inline-edit-row .inline-edit-select {
  padding-right: 16px !important; /* Piccolo spazio solo per la freccia */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0 center !important;
  background-size: 14px !important;
  cursor: pointer !important;
  text-align-last: right !important; /* Forza il testo a destra anche nel dropdown */
}

/* UCCIDE GLI SPIN BUTTONS DEI CAMPI NUMERICI (GG/AAAA) CAUSA DI DILATAZIONI */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
}

input[type='number'] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.inline-date-group {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

/* Calibrazione larghezze per evitare salti */
#edit-birth-prefix,
#edit-death-prefix,
#edit-marr-prefix {
  width: 75px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  flex-shrink: 0;
}
#edit-birth-day,
#edit-death-day,
#edit-marr-day {
  width: 35px !important;
  text-align: center !important;
  flex-shrink: 0;
}
#edit-birth-month,
#edit-death-month,
#edit-marr-month {
  width: 60px !important;
  flex-shrink: 0;
}
#edit-birth-year,
#edit-death-year,
#edit-marr-year {
  width: 55px !important;
  padding-right: 0 !important; /* L'anno tocca perfettamente il margine destro */
  background-image: none !important; /* Niente freccia sull'anno se Ã¨ input text */
  flex-shrink: 0;
}

.detail-actions {
  display: none !important;
}

/* Family List Styles */
.family-group {
  margin-bottom: 1.5rem;
}

.family-group h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
}

.family-member-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  flex-wrap: wrap;
}

.family-edit-card {
  flex-basis: 100%;
  min-width: 0;
}

.family-edit-card .inline-date-group {
  justify-content: flex-start !important;
}

.family-edit-card .inline-edit-input,
.family-edit-card .inline-edit-select {
  text-align: left !important;
}

.family-member-item:hover {
  background: #f8fafc;
  border-radius: 10px;
}

.fm-info {
  flex: 1;
  min-width: 0;
}

.fm-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fm-name .profile-provenance-badge {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.fm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.fm-info div:first-child {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.fm-info div:last-child {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Add Relative Button */
.btn-add-relative {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #4f46e5;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-add-relative:hover {
  background: #e0e7ff;
  border-color: #4f46e5;
}

/* Family Disconnect Button */
.fm-disconnect-btn {
  font-size: 18px !important;
  color: #94a3b8;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.fm-disconnect-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

/* Family Add Actions */
.fm-add-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 0;
}

.btn-add-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px dashed #cbd5e1;
  background: white;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-icon:hover {
  border: 1px solid #6366f1;
  color: #6366f1;
  background: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-add-icon .material-symbols-outlined {
  font-size: 20px;
}

/* Photos Section */
/* =========================================
   FIX GALLERIA FOTO - FORZA ALLINEAMENTO A SINISTRA
   ========================================= */
.photos-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  gap: 10px !important;
  justify-content: flex-start !important; /* Forza l'impacchettamento della griglia a sinistra */
  justify-items: start !important; /* ALLINEAMENTO FORCE START */
  align-items: start !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important; /* Annulla eventuali text-align: right ereditati */
}

.photo-item {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  background-color: #f8fafc !important;
  cursor: pointer !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  transition:
    transform 0.2s,
    box-shadow 0.2s !important;
  display: block !important;
  margin: 0 !important; /* Impedisce a margini automatici di spingere la foto */
}

.photo-item:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-document-stack {
  position: relative;
  isolation: isolate;
  appearance: none;
  padding: 0 !important;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
}

.profile-document-stack::before,
.profile-document-stack::after {
  content: '';
  position: absolute;
  inset: 4px;
  z-index: 0;
  border-radius: 10px;
  background: #e2e8f0;
  border: 1px solid rgba(71, 85, 105, 0.2);
  pointer-events: none;
}

.profile-document-stack::before {
  transform: translate(7px, -5px) rotate(2.5deg);
}

.profile-document-stack::after {
  z-index: 1;
  transform: translate(4px, -2px) rotate(1deg);
  background: #f8fafc;
}

.profile-document-stack-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  background: #f8fafc;
}

.profile-document-stack-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 30px;
  min-height: 25px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.profile-document-stack-badge .material-symbols-outlined {
  font-size: 16px;
}

.profile-document-stack:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45) !important;
  outline-offset: 4px;
}

.photo-item.model-placeholder {
  display: flex !important;
  align-items: stretch;
  justify-content: stretch;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%) !important;
  color: #4f46e5 !important;
  border: 1px solid rgba(79, 70, 229, 0.1) !important;
  position: relative;
  overflow: hidden;
}

.photo-item-model {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top left,
      rgba(15, 118, 110, 0.14),
      transparent 36%
    ),
    linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
}

.photo-item.model-placeholder .model-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.no-photos {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  grid-column: 1 / -1;
  text-align: center;
  padding: 1rem 0;
}

/* Photos & Info headers */
.photos-header,
.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.photos-header h3,
.info-header h3 {
  margin: 0;
}

/* Mobile Profile Optimization */
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-content {
    padding: 1rem;
  }

  .profile-avatar-container {
    left: 50%;
    transform: translateX(-50%);
    bottom: -60px;
  }

  .profile-title-wrapper {
    margin-top: 0;
  }

  .profile-title {
    margin-left: 0;
    padding: 75px 1rem 1rem 1rem;
    text-align: center;
  }

  .principal-relationship-slot--profile {
    position: static;
    left: auto;
    transform: none;
    bottom: auto;
    width: min(92vw, 520px);
    max-width: min(92vw, 520px);
    margin: 10px auto 4px;
    justify-content: center;
    align-items: center;
    min-height: auto;
  }

  .principal-relationship-list--profile {
    justify-content: center;
  }

  .profile-title-flex {
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .profile-actions {
    margin-top: 8px;
    flex-shrink: 0;
    justify-content: center;
    width: 100%;
  }

  .profile-title h1 {
    font-size: 1.6rem;
    flex: 0 1 auto;
    text-align: center;
  }

  .boot-profile-header {
    height: 140px;
  }

  .boot-profile-avatar-wrap {
    left: 50%;
    transform: translateX(-50%);
    bottom: -60px;
  }

  .boot-profile-avatar {
    width: 148px;
    height: 148px;
  }

  .boot-profile-title {
    margin-left: 0;
    padding: 75px 1rem 1rem 1rem;
    text-align: center;
  }

  .boot-profile-title-flex {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .boot-profile-title-copy {
    align-items: center;
  }

  .boot-profile-content {
    padding: 1rem;
  }

  .boot-profile-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .boot-profile-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .boot-profile-detail-row {
    grid-template-columns: 108px 1fr;
    gap: 12px;
    min-height: 50px;
  }

  .boot-profile-detail-label {
    width: 68px;
  }

  .boot-profile-detail-value {
    width: min(68%, 180px);
  }

  .boot-profile-tribute-shell {
    padding: 0.35rem 1rem 0;
    gap: 10px;
  }
}

@media (min-width: 900px) {
  #lightbox-image-area {
    background: transparent;
  }
}

/* ===== Contributions & Stories Section ===== */
#contributions-stories-card {
  margin: 0 0 2rem;
}

.contrib-post {
  position: relative;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition:
    opacity 0.3s,
    border-color 0.3s;
}

.contrib-post.pending,
.contrib-post.status-pending {
  opacity: 0.5;
  border-style: dashed;
  border-color: #cbd5e1;
}

.contrib-post.pending:hover,
.contrib-post.status-pending:hover {
  opacity: 0.85;
}

.contrib-post.approved,
.contrib-post.status-approved {
  opacity: 1;
  border-color: #e2e8f0;
}

.contrib-post.status-changes_requested {
  border-color: #f59e0b;
  background: #fffbeb;
}

.contrib-post.status-rejected {
  border-color: #fecaca;
  background: #fff7f7;
  opacity: 0.86;
}

.contrib-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.contrib-author-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}

.contrib-date-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.contrib-pending-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.contrib-status-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}

.contrib-status-badge.status-pending {
  background: #fef3c7;
  color: #b45309;
}

.contrib-status-badge.status-changes_requested {
  background: #ffedd5;
  color: #c2410c;
}

.contrib-status-badge.status-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.contrib-review-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #7c2d12;
  font-size: 0.78rem;
  line-height: 1.45;
}

.contrib-review-note strong {
  display: block;
  margin-bottom: 2px;
}

.contrib-review-note .material-symbols-outlined {
  font-size: 18px;
}

.contrib-review-note.status-rejected {
  color: #991b1b;
}

.contrib-message {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.5;
  margin: 0 0 0.5rem 0;
  white-space: pre-wrap;
}

.contrib-photos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.contrib-photo-frame {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}

.contrib-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  cursor: inherit;
  transition: transform 0.2s;
  display: block;
}

.contrib-photo:hover {
  transform: scale(1.01);
}

/* --- Social Interactions (Likes/Dislikes) --- */
.contrib-social-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.interaction-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  min-width: 60px;
  border-radius: 20px;
  transition:
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid transparent;
}

.interaction-count {
  min-width: 1.5ch;
  text-align: center;
  display: inline-block;
}

.interaction-btn:hover {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

.interaction-btn.active.like {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.05);
  border-color: rgba(22, 163, 74, 0.1);
}

.interaction-btn.active.dislike {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
  border-color: rgba(79, 70, 229, 0.1);
}

.interaction-btn .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 20;
}

.interaction-btn.active .material-symbols-outlined {
  font-variation-settings:
    'FILL' 1,
    'wght' 500,
    'GRAD' 0,
    'opsz' 20;
}

/* Tooltip for names */
.interaction-names-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #0f172a;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.interaction-btn:hover .interaction-names-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.interaction-names-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f172a;
}

/* Admin action buttons â€” visible on hover */
.contrib-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.contrib-post:hover .contrib-actions {
  opacity: 1;
  pointer-events: auto;
}

.contrib-post.is-editing .contrib-actions {
  opacity: 1;
  pointer-events: auto;
}

.contrib-edit-btn,
.contrib-approve-btn,
.contrib-review-btn,
.contrib-delete-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.contrib-edit-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.contrib-edit-btn:hover {
  background: #2563eb;
  color: white;
  transform: scale(1.1);
}

.contrib-approve-btn {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.contrib-approve-btn:hover {
  background: #16a34a;
  color: white;
  transform: scale(1.1);
}

.contrib-review-btn {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.contrib-review-btn:hover {
  background: #f59e0b;
  color: white;
  transform: scale(1.1);
}

.contrib-delete-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.contrib-delete-btn:hover {
  background: #ef4444;
  color: white;
  transform: scale(1.1);
}

.contrib-edit-btn .material-symbols-outlined,
.contrib-approve-btn .material-symbols-outlined,
.contrib-review-btn .material-symbols-outlined,
.contrib-delete-btn .material-symbols-outlined {
  font-size: 18px;
}

.contrib-inline-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 0.75rem 0;
}

.contrib-inline-textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
}

.contrib-inline-textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.contrib-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.contrib-inline-btn {
  min-width: 92px;
}

/* --- Mentions Autocomplete --- */
.mention-dropdown {
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  max-width: 300px;
  z-index: 1000;
  margin-top: 4px;
}

.mention-item,
.mention-item-empty {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1e293b;
  transition: background 0.15s;
}

.mention-item-empty {
  color: #94a3b8;
  font-style: italic;
  cursor: default;
}

.mention-item:hover,
.mention-item.active {
  background: #f1f5f9;
}

.mention-item-dates {
  font-size: 0.75rem;
  color: #64748b;
}

/* Relative positioning for the bio edit area to anchor the dropdown */
#bio-edit-area {
  position: relative;
}

/* === WYSIWYG Contenteditable Editor === */
.wysiwyg-editor {
  position: relative;
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
  outline: none;
  cursor: text;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.wysiwyg-editor:focus {
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wysiwyg-editor:empty::before {
  content: 'Scrivi qui le note biografiche...';
  color: #94a3b8;
  pointer-events: none;
}

/* Formatting inside the WYSIWYG editor */
.wysiwyg-editor strong,
.wysiwyg-editor b {
  font-weight: 700;
}

.wysiwyg-editor em,
.wysiwyg-editor i {
  font-style: italic;
}

.wysiwyg-editor u {
  text-decoration: underline;
}

.wysiwyg-editor h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 8px 0 4px;
  color: #1e293b;
}

.wysiwyg-editor h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 6px 0 4px;
  color: #334155;
}

.wysiwyg-editor blockquote {
  border: none;
  padding-left: 1.5rem;
  margin: 1rem 0 1rem 0.5rem;
  color: #64748b;
  font-style: italic;
  background: transparent;
  position: relative;
}

.wysiwyg-editor blockquote::before {
  content: '"';
  font-size: 2.5rem;
  color: #cbd5e1;
  position: absolute;
  left: -0.2rem;
  top: -0.2rem;
  font-family: Georgia, serif;
  line-height: 1;
  opacity: 0.6;
}

.wysiwyg-editor blockquote > div,
.wysiwyg-editor blockquote > p {
  margin: 0;
  padding: 0;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol {
  margin: 6px 0;
  padding-left: 24px;
}

.wysiwyg-editor li {
  margin-bottom: 2px;
}

.wysiwyg-editor hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
  margin: 12px 0;
}

.wysiwyg-editor a {
  color: var(--primary-color, #3b82f6);
  text-decoration: none;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.wysiwyg-editor img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

/* Mention tags in the editor */
.mention-tag {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: default;
  user-select: all;
  white-space: nowrap;
  vertical-align: baseline;
  line-height: 1;
}

/* --- Stemma Description Link styling --- */
#stemma-detail-desc .mention-link {
  color: var(--primary-color, #3b82f6);
  font-weight: 500;
  text-decoration: none;
}

#stemma-detail-desc .mention-link:hover {
  text-decoration: underline;
}

/* === Floating Formatting Toolbar === */
.formatting-toolbar.floating-toolbar {
  position: absolute;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  background: #1e293b;
  border: none;
  border-radius: 8px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 4px rgba(0, 0, 0, 0.1);
  flex-wrap: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: auto;
}

/* Small arrow/triangle at the bottom */
.formatting-toolbar.floating-toolbar::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #1e293b;
  border-radius: 0 0 2px 0;
  transform: translateX(-50%) rotate(45deg);
}

.formatting-toolbar-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.formatting-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.formatting-toolbar-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.95);
}

.formatting-toolbar-btn .material-symbols-outlined {
  font-size: 18px;
}

.formatting-toolbar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 3px;
  flex-shrink: 0;
}

/* === Rendered Formatted Content === */
.formatted-inline-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.formatted-link {
  color: var(--primary-color, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  transition: border-color 0.2s;
}

.formatted-link:hover {
  border-bottom-color: var(--primary-color, #3b82f6);
}

.formatted-hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
  margin: 12px 0;
}

.formatted-list {
  margin: 6px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.formatted-list li {
  margin-bottom: 4px;
  line-height: 1.5;
}

/* Mobile adjustments for floating toolbar */
@media (max-width: 480px) {
  .formatting-toolbar.floating-toolbar {
    gap: 1px;
    padding: 4px 5px;
  }

  .formatting-toolbar-btn {
    width: 26px;
    height: 26px;
  }

  .formatting-toolbar-btn .material-symbols-outlined {
    font-size: 16px;
  }
}

/* ===== Contribution Upload Dropzone ===== */
.contrib-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.contrib-dropzone:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

/* ===== Contribution Image Previews ===== */
.contrib-previews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.contrib-document-catalog {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

.contrib-document-catalog.hidden {
  display: none;
}

.contrib-document-catalog-header,
.contrib-document-group-header,
.contrib-document-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contrib-document-catalog-header {
  justify-content: space-between;
  margin-bottom: 6px;
}

.contrib-document-catalog-title {
  margin: 0;
  color: #1e3a8a;
  font-size: 0.88rem;
  font-weight: 700;
}

.contrib-document-catalog-help {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.contrib-document-add-btn {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.contrib-document-groups {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.contrib-document-group-header input,
.contrib-document-file-row select {
  min-width: 0;
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 7px 8px;
  font-size: 0.78rem;
}

.contrib-document-remove-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  padding: 4px;
}

.contrib-document-files {
  display: grid;
  gap: 7px;
}

.contrib-document-file-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #475569;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contrib-document-page {
  flex: 0 0 auto;
  min-width: 58px;
  color: #64748b;
  font-size: 0.72rem;
  text-align: right;
}

.contrib-challenge-slot {
  min-height: 66px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.contrib-challenge-slot.hidden {
  display: none;
}

.contrib-challenge-help {
  margin: 0 0 12px 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
}

.contrib-challenge-help.is-ready {
  color: #15803d;
}

.contrib-challenge-help.is-error {
  color: #b91c1c;
}

.preview-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #e2e8f0;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  cursor: default;
}

.preview-thumb:hover {
  transform: scale(1.04);
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.remove-preview {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.15s;
  z-index: 2;
}

.preview-thumb:hover .remove-preview {
  opacity: 1;
}

.remove-preview:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.add-more-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #94a3b8;
}

.add-more-preview:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
  color: #4f46e5;
  transform: scale(1.04);
}

.add-more-preview .material-symbols-outlined {
  font-size: 28px;
}

/* Restricted Profile View (Viewer/Guest) - SELECTIVE BLUR */
body.restricted-view .profile-content,
body.restricted-view .profile-cover,
body.restricted-view .profile-avatar-container,
body.restricted-view .profile-title-wrapper {
  filter: blur(40px);
  pointer-events: none;
  user-select: none;
}

body.restricted-view .profile-nav-buttons {
  filter: none;
  pointer-events: auto;
  z-index: 10001;
}

.privacy-blur {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
  transition: filter 0.3s ease;
}

/* The restricted message should be over the blurred container, not the whole body */
/* --- Restricted Access Message (OSCURATO PER PRIVACY) --- */
body.restricted-view::after {
  content: 'OSCURATO PER PRIVACY';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 30px 40px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.8rem;
  color: #1e293b;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 100000; /* Absolute top-layer */
  border: 1px solid rgba(0, 0, 0, 0.1);
  pointer-events: none;
  text-align: center;
  width: 80%;
  max-width: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  body.restricted-view::after {
    font-size: 1.25rem;
    padding: 20px 25px;
    width: 85%;
  }
}

body.restricted-view header,
body.restricted-view #site-footer {
  filter: none;
  opacity: 1;
  pointer-events: auto;
}

/* Hide all controls and action buttons on restricted (privacy) view */
body.restricted-view #controls,
body.restricted-view .header-top-actions {
  display: none !important;
}

/* Force the back and center buttons to be sharp and interactive */
body.restricted-view #back-to-tree,
body.restricted-view #center-in-tree {
  filter: none;
  pointer-events: auto;
  z-index: 10000;
  opacity: 1;
}

body.restricted-view #back-to-tree,
body.restricted-view #center-in-tree {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Profile Edit Actions (Premium Floating/Header attached) */
.info-edit-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.info-save-btn,
.info-cancel-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f1f5f9;
}

.info-save-btn {
  color: #16a34a;
}

.info-save-btn:hover {
  background: #16a34a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.2);
}

.info-cancel-btn {
  color: #ef4444;
}

.info-cancel-btn:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

/* Stemma Edit Layout within Grid */
.stemma-tags-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  align-items: center;
}

/* =========================================
   STEMMA SEARCH OVERLAY (Premium Layout)
   ========================================= */

/* Riga Stemmi in Edit */
.stemma-edit-wrapper.is-edit {
  align-items: center !important;
  height: auto !important;
  min-height: 56px !important;
}

.stemma-edit-wrapper.is-edit .detail-value {
  grid-column: 2 / -1 !important;
  position: relative !important;
  height: auto !important;
  overflow: visible !important;
}

/* Barra di ricerca full width */
#edit-stemmi-search {
  width: 100% !important;
  text-align: left !important;
  padding: 0 12px !important;
}

/* Posizionamento Assoluto per l'Autocomplete Stemmi */
.custom-autocomplete-results {
  position: absolute !important;
  top: 100% !important; /* Appare sotto la barra di ricerca */
  left: 0 !important;
  width: 100% !important; /* Tutta la larghezza */
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
  z-index: 2000 !important; /* Sopra tutto il resto del profilo */
  max-height: 250px !important; /* Blocca l'altezza massima */
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

/* =========================================
   FIX MOBILE - INLINE EDITING RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .profile-title-wrapper {
    margin-top: 0 !important; /* Rimuove il margine negativo che spingeva il testo sotto l'avatar */
  }

  .profile-title {
    margin-left: 0;
    padding: 72px 1rem 0.5rem 1rem !important; /* Ridotto da 85px per compattare */
    text-align: center;
  }

  .profile-title-flex {
    display: flex !important;
    flex-direction: column !important; /* Forza lo stack per evitare sovrapposizioni */
    justify-content: center;
    align-items: center;
    gap: 4px; /* Spazio controllato tra nome e pulsanti */
    margin-bottom: 6px !important; /* Spazio dai pulsanti alle date */
  }

  .profile-title h1 {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    overflow: visible !important;
  }

  .profile-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .profile-title p {
    font-size: 0.9rem !important;
    margin-top: 0 !important; /* Lo spazio Ã¨ gestito dal margin-bottom di .profile-title-flex */
    margin-bottom: 0 !important;
  }

  /* 1. Nome Edit: rimpicciolisci e centra come il testo statico */
  .name-edit-input {
    font-size: 1.6rem !important; /* Match esatto con la modalitÃ  view su mobile */
    text-align: center !important;
  }

  .name-edit-container {
    justify-content: center !important;
    flex-wrap: wrap !important; /* Se non c'Ã¨ spazio, manda i tasti a capo invece di tagliarli */
    gap: 8px !important;
  }

  /* 2. Stringi la griglia "Informazioni" */
  #profile-details-list li {
    grid-template-columns: 90px 1fr !important; /* Riduciamo la colonna etichette (es. "NASCITA") */
    padding: 10px 0 !important;
  }

  .detail-label {
    font-size: 0.75rem !important; /* Etichette leggermente piÃ¹ piccole */
  }

  /* 3. Compattamento Estremo per le Date */
  .inline-date-group {
    gap: 4px !important; /* Meno spazio tra i dropdown */
  }

  #edit-birth-prefix,
  #edit-death-prefix,
  #edit-marr-prefix {
    width: 50px !important; /* Stringi prefisso */
    font-size: 0.75rem !important;
    padding: 0 !important;
  }
  #edit-birth-day,
  #edit-death-day,
  #edit-marr-day {
    width: 25px !important;
  }
  #edit-birth-month,
  #edit-death-month,
  #edit-marr-month {
    width: 48px !important;
    padding-right: 12px !important; /* Spazio ridotto per la freccina SVG */
    background-size: 10px !important; /* Freccia piÃ¹ piccola */
  }
  #edit-birth-year,
  #edit-death-year,
  #edit-marr-year {
    width: 40px !important;
  }

  /* 4. Font generale degli input ridotto per i form mobile */
  .inline-edit-row .inline-edit-input,
  .inline-edit-row .inline-edit-select {
    font-size: 0.85rem !important;
  }

  /* 5. Fix Stemmi su Mobile */
  .stemma-edit-wrapper.is-edit {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 12px 0 !important;
  }

  .stemma-edit-wrapper.is-edit .detail-label {
    margin-bottom: 8px !important;
  }

  .stemma-edit-wrapper.is-edit .detail-value,
  .stemma-edit-wrapper.is-edit .stemma-edit-value {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  .stemma-tags-container {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

/* --- TRIBUTES SECTION --- */
.tributes-container {
  position: relative;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 14px 0 22px;
}

.tributes-container--wide {
  margin-top: 0;
}

.tributes-grid {
  margin-top: 0;
}

.tributes-empty-state {
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
  text-align: center;
}

.tributes-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.tributes-grid--symbols {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 16px;
}

.tributes-grid--floating {
  align-items: center;
  overflow: visible;
}

.tribute-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  width: 74px;
  height: 74px;
  padding: 0;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: none;
  overflow: visible;
}

.tribute-card--symbol:hover,
.tribute-card--symbol:focus-visible,
.tribute-card--symbol.is-active {
  transform: translateY(-6px) scale(1.14);
  outline: none;
  z-index: 40;
}

.tribute-icon {
  font-size: 36px;
  margin: 0;
  display: inline-block;
  animation: gentlePos 3s infinite ease-in-out;
  filter: drop-shadow(0 10px 16px rgba(190, 24, 93, 0.12));
}

.tribute-card--symbol .tribute-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tribute-detail {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translate(-50%, 10px) scale(0.96);
  display: grid;
  gap: 6px;
  min-width: 220px;
  max-width: min(320px, 70vw);
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #fbcfe8;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.14);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  z-index: 45;
  text-align: left;
}

.tribute-detail::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid #fbcfe8;
  border-bottom: 1px solid #fbcfe8;
  transform: translate(-50%, -7px) rotate(45deg);
}

.tribute-card--symbol:hover .tribute-detail,
.tribute-card--symbol:focus-visible .tribute-detail,
.tribute-card--symbol.is-active .tribute-detail {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.tribute-detail-author {
  display: block;
  color: #9f1239;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tribute-detail-message {
  display: block;
  color: #334155;
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: normal;
}

.tribute-detail-timer {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  color: #64748b;
  font-size: 0.77rem;
  font-weight: 600;
}

/* --- TRIBUTE ICON SPECIFIC ANIMATIONS --- */

.tribute-icon.icon-candle {
  animation: flickerGlow 1.5s infinite alternate;
}

.tribute-icon.icon-rose {
  transform-origin: bottom center;
  animation: swayRose 4s infinite ease-in-out;
}

.tribute-icon.icon-bouquet {
  animation: breatheBouquet 5s infinite ease-in-out;
}

.tribute-icon.icon-tree {
  transform-origin: bottom center;
  animation: swingTree 6s infinite ease-in-out;
}

.tribute-icon.icon-live-plant {
  transform-origin: bottom center;
  animation: swayRose 4.8s infinite ease-in-out;
}

.tribute-icon.icon-subscription {
  animation: floatDove 4s infinite ease-in-out;
}

@keyframes flickerGlow {
  0% {
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 0 4px rgba(255, 165, 0, 0.4));
    opacity: 1;
  }
  50% {
    transform: scale(1.02, 1.05) translateY(-1px);
    filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.8));
    opacity: 0.95;
  }
  100% {
    transform: scale(0.98, 0.98) translateY(1px);
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.6));
    opacity: 1;
  }
}

@keyframes swayRose {
  0%,
  100% {
    transform: rotate(-5deg) translateY(0);
  }
  50% {
    transform: rotate(5deg) translateY(-2px);
  }
}

@keyframes breatheBouquet {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08) translateY(-3px);
  }
}

@keyframes swingTree {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(4deg);
  }
  75% {
    transform: rotate(-4deg);
  }
}

@keyframes floatDove {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.05);
  }
}

@keyframes gentlePos {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tribute-card.fade-in {
  animation: fadeInScale 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.profile-tribute-badge {
  background: linear-gradient(135deg, #fce7f3, #fecdd3);
  border: 1px solid #fda4af;
  color: #be185d;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 0;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: gentlePulse 2s infinite;
}
.profile-tribute-badge:hover {
  background: #fbcfe8;
  transform: scale(1.05);
}
@keyframes gentlePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(225, 29, 72, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
  }
}

/* Modale Tributes Sidebar Modal styles */
.tribute-modal-dialog {
  width: min(92vw, 620px);
  max-width: 620px;
  max-height: 92vh;
  margin: auto;
  inset: 0;
  overflow: hidden;
  border-radius: 24px;
}

.tribute-modal-content {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border-radius: 24px;
  background: #fff;
}

.tribute-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.tribute-modal-title {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  line-height: 1.12;
  color: #be185d;
  letter-spacing: -0.02em;
}

.tribute-modal-intro {
  margin: 0 0 18px 0;
  max-width: 62ch;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.64;
}

.tribute-modal-section {
  margin-bottom: 18px;
}

.tribute-flow-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.tribute-flow-tab {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tribute-flow-tab.is-active {
  border-color: #f472b6;
  background: #fff1f2;
  color: #be185d;
  box-shadow: 0 8px 22px rgba(244, 114, 182, 0.12);
}

.tribute-flow-panel.hidden {
  display: none;
}

.tribute-modal-label {
  display: block;
  margin-bottom: 10px;
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.tribute-modal-label--secondary {
  margin-top: 4px;
}

.tribute-form-stack {
  margin-bottom: 16px;
}

.tribute-modal-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.45;
  box-sizing: border-box;
  background: #fff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.tribute-modal-input:focus {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.12);
}

.tribute-modal-textarea {
  min-height: 66px;
  resize: vertical;
}

.tribute-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}
.tribute-tier-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 16px 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 150px;
}
.tribute-tier-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.tribute-tier-card.selected {
  border-color: #ec4899;
  background: #fff1f2;
}
.tribute-tier-icon {
  font-size: 30px;
  margin-bottom: 8px;
}
.tribute-tier-name {
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.35;
  font-size: 0.95rem;
}
.tribute-tier-price {
  font-size: 0.88rem;
  color: #64748b;
}
.tribute-tier-price--strong {
  color: #e11d48;
  font-weight: 800;
}

.tribute-tier-hint {
  margin-top: 6px;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.4;
}

.tribute-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tribute-mode-card {
  border-radius: 12px;
  padding: 13px 14px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tribute-mode-title {
  display: block;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.tribute-mode-description {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}

.tribute-iban-box {
  background: #f0fdf4;
  border: 1px dashed #bbf7d0;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #166534;
  text-align: center;
}

.tribute-iban-box.hidden {
  display: none;
}

.tribute-direct-donation {
  margin-top: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f0fdf4 100%);
  border: 1px solid #dbeafe;
}

.tribute-direct-donation--standalone {
  margin-top: 0;
}

.tribute-direct-donation__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tribute-direct-donation__intro--stacked {
  align-items: flex-start;
}

.tribute-direct-donation__title {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 800;
  color: #14532d;
}

.tribute-direct-donation__text {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.62;
}

.tribute-donation-cta {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #f472b6;
  border-radius: 16px;
  background: linear-gradient(135deg, #be185d, #e11d48);
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(190, 24, 93, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.tribute-donation-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 13px 28px rgba(190, 24, 93, 0.3);
}

.tribute-donation-cta:focus-visible {
  outline: 3px solid rgba(244, 114, 182, 0.35);
  outline-offset: 3px;
}

.tribute-donation-cta__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  font-variation-settings: 'FILL' 1;
}

.tribute-donation-cta__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.tribute-donation-cta__copy strong {
  font-size: 0.94rem;
}

.tribute-donation-cta__copy small {
  color: #fff1f2;
  font-size: 0.74rem;
  line-height: 1.35;
}

.tribute-donation-cta__arrow {
  transition: transform 0.18s ease;
}

.tribute-donation-cta:hover .tribute-donation-cta__arrow {
  transform: translateX(3px);
}

.tribute-bank-toggle {
  flex-shrink: 0;
  border: 1px solid #86efac;
  background: #ffffff;
  color: #166534;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
}

.tribute-bank-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(22, 101, 52, 0.12);
  border-color: #4ade80;
}

.tribute-iban-box--enhanced {
  margin-top: 12px;
  padding: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed #86efac;
}

.tribute-bank-header strong {
  display: block;
  font-size: 0.98rem;
  color: #14532d;
}

.tribute-bank-header p {
  margin: 4px 0 0 0;
  color: #166534;
  font-size: 0.83rem;
  line-height: 1.5;
}

.tribute-bank-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tribute-bank-line {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(240, 253, 244, 0.88);
}

.tribute-bank-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #166534;
}

.tribute-bank-value {
  min-width: 0;
  color: #14532d;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.tribute-bank-copy {
  border: 1px solid #bbf7d0;
  background: #fff;
  color: #15803d;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.tribute-bank-copy:hover {
  background: #f0fdf4;
  transform: translateY(-1px);
}

.tribute-bank-note {
  margin: 12px 0 0 0;
  color: #166534;
  font-size: 0.8rem;
  line-height: 1.5;
}

.tribute-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 18px;
  padding-top: 6px;
}

.tribute-submit-btn {
  min-width: 210px;
}

.tribute-modal-content::-webkit-scrollbar {
  display: none;
}

.tribute-modal-content::-webkit-scrollbar-thumb {
  background: transparent;
}

@media (max-width: 1100px) {
  .tribute-modal-dialog {
    width: min(94vw, 580px);
    max-width: 580px;
  }

  .tribute-modal-content {
    max-width: 560px;
  }

  .tribute-tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.tribute-timer {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
    'Courier New', monospace;
  opacity: 0.8;
  padding: 2px 4px;
  border-radius: 999px;
  background: transparent;
  border: 0;
}

@media (max-width: 900px) {
  .tribute-modal-title {
    font-size: 1.6rem;
  }

  .tribute-modal-intro {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .tributes-container {
    margin: 10px 0 18px;
  }

  .tributes-grid--symbols {
    gap: 12px;
    justify-content: center;
  }

  .tribute-card {
    width: 64px;
    height: 64px;
  }

  .tribute-detail {
    bottom: calc(100% + 10px);
    min-width: 200px;
    max-width: min(260px, 78vw);
    padding: 12px 14px;
  }

  .tribute-direct-donation__intro {
    flex-direction: column;
    align-items: stretch;
  }

  .tribute-mode-grid {
    grid-template-columns: 1fr;
  }

  .tribute-flow-tabs {
    grid-template-columns: 1fr;
  }

  .tribute-bank-toggle {
    width: 100%;
  }

  .tribute-bank-line {
    grid-template-columns: 1fr;
  }

  .tribute-bank-copy {
    justify-self: start;
  }

  .tribute-modal-actions {
    justify-content: stretch;
  }

  .tribute-submit-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .tribute-modal-dialog {
    width: min(96vw, 96vw);
    max-width: none;
  }

  .tribute-modal-content {
    padding: 18px !important;
    max-width: none;
    border-radius: 18px;
    scrollbar-width: none;
  }

  .tribute-modal-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .tribute-modal-header {
    margin-bottom: 14px;
    gap: 12px;
  }

  .tribute-modal-title {
    font-size: 1.34rem;
    line-height: 1.18;
  }

  .tribute-modal-intro {
    margin-bottom: 18px;
    font-size: 0.89rem;
    line-height: 1.58;
  }

  .tribute-modal-section {
    margin-bottom: 18px;
  }

  .tribute-flow-tabs {
    gap: 8px;
    margin-bottom: 14px;
  }

  .tribute-flow-tab {
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .tribute-tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tribute-tier-card {
    padding: 14px 10px 13px;
    min-height: 148px;
  }

  .tribute-tier-icon {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .tribute-tier-name {
    font-size: 0.92rem;
    margin-bottom: 6px;
  }

  .tribute-tier-price {
    font-size: 0.92rem;
  }

  .tribute-tier-hint {
    font-size: 0.76rem;
    margin-top: 6px;
  }

  .tribute-mode-card {
    padding: 12px 12px 11px;
    min-height: 0;
  }

  .tribute-mode-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .tribute-mode-description {
    font-size: 0.79rem;
    line-height: 1.45;
  }

  .tribute-modal-label {
    margin-bottom: 8px;
    font-size: 0.82rem;
  }

  .tribute-modal-input {
    padding: 11px 12px;
    font-size: 0.92rem;
  }

  .tribute-modal-textarea {
    min-height: 72px;
  }

  .tribute-direct-donation {
    margin-top: 4px;
    padding: 15px 14px;
  }

  .tribute-direct-donation__title {
    font-size: 0.97rem;
    margin-bottom: 5px;
  }

  .tribute-direct-donation__text {
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .tribute-bank-toggle {
    padding: 11px 12px;
    font-size: 0.82rem;
  }

  .tribute-iban-box--enhanced {
    padding: 14px 12px;
  }

  .tribute-bank-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .tribute-bank-line {
    gap: 6px;
    padding: 10px;
  }

  .tribute-bank-label {
    font-size: 0.72rem;
  }

  .tribute-bank-value {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .tribute-bank-copy {
    width: 100%;
    justify-self: stretch;
    text-align: center;
  }

  .tribute-bank-note {
    margin-top: 12px;
    font-size: 0.79rem;
  }

  .tribute-modal-actions {
    margin-top: 20px;
  }

  .tribute-submit-btn {
    min-width: 0;
  }
}
.tribute-wallet-summary,
.points-wallet-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin: 12px 0 18px;
  border: 1px solid #fde68a;
  border-radius: 16px;
  background: #fffbeb;
  color: #92400e;
}

.tribute-donation-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.points-wallet-dialog {
  width: min(94vw, 720px);
  max-height: min(90vh, 780px);
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #f8fafc;
  color: #172033;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.3);
  scrollbar-width: none;
}

.points-wallet-dialog::-webkit-scrollbar,
.wallet-body::-webkit-scrollbar {
  display: none;
}

.points-wallet-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.wallet-shell {
  min-height: 540px;
}

.wallet-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  grid-template-areas:
    'brand brand'
    'balance benefit';
  column-gap: 28px;
  row-gap: 26px;
  min-height: 218px;
  box-sizing: border-box;
  padding: 28px 32px 26px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      circle at 82% 0%,
      rgba(250, 204, 21, 0.34),
      transparent 30%
    ),
    linear-gradient(135deg, #153c2b 0%, #0b2920 58%, #071b16 100%);
}

.wallet-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  bottom: -170px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(255, 255, 255, 0.025),
    0 0 0 76px rgba(255, 255, 255, 0.018);
}

.wallet-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 12px;
}
.wallet-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wallet-brand small,
.wallet-section-heading small {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0.72;
}
.wallet-brand strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
}
.wallet-brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(253, 224, 71, 0.38);
  border-radius: 14px;
  background: rgba(253, 224, 71, 0.12);
  color: #fde047;
}

.wallet-close {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.wallet-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.wallet-balance {
  grid-area: balance;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 0;
  align-self: end;
}
.wallet-balance > span {
  color: #bbd2c8;
  font-size: 0.82rem;
}
.wallet-balance > strong {
  margin: 4px 0;
  font-size: clamp(2.35rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.wallet-balance > small {
  color: #f9d866;
}

.wallet-benefit {
  position: relative;
  grid-area: benefit;
  z-index: 1;
  right: auto;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: none;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  align-self: end;
}
.wallet-benefit > span:last-child {
  display: flex;
  flex-direction: column;
}
.wallet-benefit .material-symbols-outlined {
  color: #fde047;
}
.wallet-benefit small {
  margin-top: 2px;
  color: #bdd0c8;
  font-size: 0.72rem;
}

.wallet-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 32px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.wallet-tabs button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 17px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-weight: 750;
  cursor: pointer;
}
.wallet-tabs button.is-active {
  border-bottom-color: #15803d;
  color: #166534;
}
.wallet-tabs .material-symbols-outlined {
  font-size: 19px;
}

.wallet-body {
  max-height: 380px;
  padding: 26px 32px 32px;
  overflow-y: auto;
  scrollbar-width: none;
}
.wallet-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.wallet-section-heading > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wallet-section-heading small {
  color: #b38716;
  opacity: 1;
}
.wallet-section-heading strong {
  font-size: 1.13rem;
}
.wallet-count {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f5ed;
  color: #166534;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.wallet-transaction {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #e8edf3;
}
.wallet-transaction-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}
.wallet-transaction-icon.is-credit {
  background: #dcfce7;
  color: #15803d;
}
.wallet-transaction-icon.is-debit {
  background: #ffe4e6;
  color: #be123c;
}
.wallet-transaction-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wallet-transaction-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-transaction-copy small {
  margin-top: 3px;
  color: #94a3b8;
}
.wallet-transaction-amount {
  white-space: nowrap;
}
.wallet-transaction-amount.is-credit {
  color: #15803d;
}
.wallet-transaction-amount.is-debit {
  color: #be123c;
}

.wallet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 38px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: #64748b;
  text-align: center;
}
.wallet-empty > .material-symbols-outlined {
  margin-bottom: 10px;
  font-size: 34px;
  color: #b38716;
}
.wallet-empty p {
  margin: 5px 0 0;
  font-size: 0.84rem;
}

.wallet-credit-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px 16px;
  padding: 22px;
  border: 1px solid #dbe4df;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff 0%, #f5faf7 100%);
}
.wallet-credit-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #e8f5ed;
  color: #15803d;
  font-size: 28px;
}
.wallet-credit-card p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}
.wallet-credit-card > label {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}
.wallet-amount-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.wallet-amount-field span {
  padding-left: 16px;
  color: #64748b;
  font-weight: 800;
}
.wallet-amount-field input {
  width: 100%;
  padding: 14px 16px 14px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1.12rem;
  font-weight: 800;
}
.wallet-conversion {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
}
.wallet-credit-card > button {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: #166534;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 101, 52, 0.2);
}
.wallet-credit-card > button:hover {
  background: #14532d;
}
.wallet-credit-card > button:disabled {
  opacity: 0.7;
  cursor: wait;
}
.wallet-secure-note {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  color: #64748b;
  text-align: center;
}
.wallet-secure-note .material-symbols-outlined {
  font-size: 15px;
  color: #15803d;
}
.wallet-button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (max-width: 620px) {
  .points-wallet-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    border-radius: 22px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .points-wallet-dialog::-webkit-scrollbar {
    display: none;
  }
  .wallet-shell {
    min-height: 0;
  }
  .wallet-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      'brand'
      'balance'
      'benefit';
    gap: 14px;
    min-height: 0;
    padding: 18px;
  }
  .wallet-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .wallet-brand strong {
    font-size: 1.15rem;
  }
  .wallet-brand small {
    font-size: 0.56rem;
  }
  .wallet-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
  }
  .wallet-balance {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2px 12px;
  }
  .wallet-balance > span {
    align-self: center;
  }
  .wallet-balance > strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 2rem;
    white-space: nowrap;
  }
  .wallet-balance > small {
    grid-column: 1;
  }
  .wallet-benefit {
    max-width: none;
    margin-top: 0;
    padding: 9px 11px;
    border-radius: 13px;
  }
  .wallet-benefit strong {
    font-size: 0.78rem;
  }
  .wallet-benefit small {
    font-size: 0.65rem;
  }
  .wallet-tabs {
    position: static;
    padding: 0 8px;
  }
  .wallet-tabs button {
    gap: 5px;
    padding: 12px 6px;
    font-size: 0.76rem;
  }
  .wallet-body {
    max-height: none;
    padding: 18px 16px 22px;
    overflow: visible;
  }
  .wallet-section-heading {
    margin-bottom: 10px;
  }
  .wallet-section-heading strong {
    font-size: 1rem;
  }
  .wallet-transaction {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 0;
  }
  .wallet-transaction-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .wallet-transaction-copy strong {
    font-size: 0.82rem;
  }
  .wallet-transaction-copy small,
  .wallet-transaction-amount {
    font-size: 0.7rem;
  }
  .wallet-transaction-amount {
    grid-column: auto;
  }
  .wallet-credit-card {
    grid-template-columns: 40px 1fr;
    gap: 10px 12px;
    padding: 16px;
  }
  .wallet-credit-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 23px;
  }
}
