/* Alcuni nostri elementi impostano "display" via classe (flex, grid…),
   che a parità di specificità può vincere sulla regola nativa
   "[hidden] { display: none }" del browser se dichiarata dopo. Questa
   regola garantisce che hidden nasconda sempre, ovunque nel plugin. */
.motomaps-app [hidden] {
  display: none !important;
}

/* Il tema del sito applica il maiuscolo a titoli/campi/placeholder in modo
   molto aggressivo, con regole che possono avere la stessa specificità (o
   più) delle nostre: la classe raddoppiata alza la nostra specificità così
   da vincere sempre, senza dover indovinare l'ordine di caricamento. */
.motomaps-app.motomaps-app input,
.motomaps-app.motomaps-app textarea,
.motomaps-app.motomaps-app select,
.motomaps-app.motomaps-app button,
.motomaps-app.motomaps-app label,
.motomaps-app.motomaps-app h1,
.motomaps-app.motomaps-app h2,
.motomaps-app.motomaps-app h3,
.motomaps-app.motomaps-app input::placeholder,
.motomaps-app.motomaps-app textarea::placeholder {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.motomaps-app {
  --mm-brand: #ed8b00;
  --mm-brand-dark: #b56c00;
  --mm-bg: #ffffff;
  --mm-bg-soft: #f5f5f5;
  --mm-border: #dcdcdc;
  --mm-text: #1c1c1c;
  --mm-text-muted: #6b6b6b;
  color: var(--mm-text);
}

:where(.motomaps-app) a {
  color: var(--mm-brand);
}

.motomaps-notice {
  color: var(--mm-text-muted);
  padding: 1rem 0;
}

.motomaps-notice-success {
  color: #15803d;
  font-weight: 600;
}

.motomaps-error {
  color: #f87171;
  font-size: 0.9rem;
}

.motomaps-success {
  color: #4ade80;
  font-size: 0.9rem;
  line-height: 1.5;
}

.motomaps-form {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.motomaps-lost-password {
  text-align: center;
  font-size: 0.82rem;
}

.motomaps-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--mm-text-muted);
}

/* Regola unica e robusta per TUTTI i campi di testo del plugin: prima
   d'ora i campi di ricerca tappe nell'editor non avevano nessuno stile
   scritto da noi e restavano in balìa (invisibile) dello stile del tema. */
.motomaps-app.motomaps-app input[type='text'],
.motomaps-app.motomaps-app input[type='email'],
.motomaps-app.motomaps-app input[type='password'],
.motomaps-app.motomaps-app input[type='search'],
.motomaps-app.motomaps-app input[type='url'],
.motomaps-app.motomaps-app input[type='file'],
.motomaps-app.motomaps-app input:not([type]),
.motomaps-app.motomaps-app textarea,
.motomaps-app.motomaps-app select {
  background: var(--mm-bg) !important;
  border: 1px solid var(--mm-border) !important;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--mm-text) !important;
  font-size: 1rem;
  /* Senza questa riga un <textarea> non stilizzato dal browser prende il
     font monospace di default invece di ereditare quello del sito (bio
     profilo segnalata come "sembra un computer anni '80"). */
  font-family: inherit !important;
  /* Il tema imposta il grassetto sui campi in modo aggressivo (stessa
     causa già vista sui placeholder): senza questa riga il testo scelto
     o digitato (es. "Non indicata" nel menu Difficoltà, "Nessun file
     scelto" nei campi foto) resta pesante mentre il placeholder accanto
     è leggero, e sembrano scritti con due font diversi. */
  font-weight: 400 !important;
  width: 100%;
  box-sizing: border-box;
}

.motomaps-app.motomaps-app input:focus,
.motomaps-app.motomaps-app textarea:focus,
.motomaps-app.motomaps-app select:focus {
  outline: none !important;
  border-color: var(--mm-brand) !important;
  box-shadow: 0 0 0 3px rgba(237, 139, 0, 0.15) !important;
}

/* Placeholder uniformi ovunque (prima ogni campo prendeva un peso/misura
   diverso a seconda del tema/tipo di elemento) - leggeri e piccoli cosi'
   si capisce subito che sono un suggerimento, non testo gia' inserito. */
.motomaps-app.motomaps-app input::placeholder,
.motomaps-app.motomaps-app textarea::placeholder {
  color: var(--mm-text-muted) !important;
  opacity: 1;
  font-weight: 400 !important;
  font-size: 0.82rem !important;
}

.motomaps-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.motomaps-btn,
.motomaps-form button,
.motomaps-profile-settings button {
  background: var(--mm-brand) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.motomaps-btn:hover,
.motomaps-form button:hover,
.motomaps-profile-settings button:hover {
  background: var(--mm-brand-dark) !important;
  color: #fff !important;
}

.motomaps-btn-outline {
  border: 1px solid var(--mm-border) !important;
  color: var(--mm-text) !important;
  background: transparent !important;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  /* Un <button> (Scarica GPX/KML) e un <a> (Apri in Google Maps) hanno
     font-family E peso del testo predefiniti diversi nel browser se non
     li si forza qui: senza queste righe sembrano scritti con due
     caratteri diversi, anche a font-family uguale (i bottoni nativi
     restano più "in grassetto" per via dello stile nativo del sistema,
     "appearance: none" lo toglie del tutto). */
  font-family: inherit;
  font-weight: inherit;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.motomaps-btn-outline:hover {
  border-color: var(--mm-brand) !important;
  color: var(--mm-brand) !important;
}

.motomaps-btn-danger {
  border: 1px solid var(--mm-border) !important;
  color: #f87171 !important;
  background: transparent !important;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.motomaps-btn-danger:hover {
  border-color: #f87171 !important;
}

/* ---- "Elimina il mio profilo" (fuori dal box delle info apposta) ---- */

.motomaps-danger-zone {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mm-border);
  text-align: center;
}

.motomaps-link-danger {
  background: none !important;
  border: none !important;
  color: #b91c1c !important;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem;
}

.motomaps-link-danger:hover {
  color: #f87171 !important;
}

.motomaps-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.motomaps-confirm-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.motomaps-confirm-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.motomaps-confirm-card p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--mm-text-muted);
}

.motomaps-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.motomaps-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.motomaps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.motomaps-list-item {
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--mm-bg-soft);
}

.motomaps-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.motomaps-meta {
  color: var(--mm-text-muted);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.motomaps-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.motomaps-dashboard-cover {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-border);
  margin-bottom: 0.75rem;
}

/* ---- Card itinerario in Esplora, evidenziata quando "in anteprima" ---- */

.motomaps-esplora-item {
  cursor: default;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.motomaps-esplora-item.is-active {
  border-color: var(--mm-brand);
  background: var(--mm-bg);
}

.motomaps-esplora-cover {
  width: 100%;
  height: 110px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-border);
  margin-bottom: 0.6rem;
}

.motomaps-origin-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.motomaps-origin-badge.is-official {
  background: rgba(237, 139, 0, 0.14);
  color: #b56c00;
}

.motomaps-origin-badge.is-community {
  background: rgba(20, 184, 166, 0.14);
  color: #0c7d6f;
}

.motomaps-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--mm-text-muted);
  margin: 0.4rem 0 0.9rem;
}

.motomaps-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.motomaps-editor-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  min-height: 520px;
}

.motomaps-map-pane {
  position: relative;
  flex: 1 1 420px;
  min-height: 420px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
}

/* Piccola anteprima mappa nell'editor articolo (percorso GPX caricato o
   punto di una Destinazione) - stessa mappa di sempre, solo in formato
   compatto e non a piena larghezza come il planner. */
.motomaps-art-mini-map {
  position: relative;
  height: 220px;
  margin-top: 0.6rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
}

/* Solo su Esplora la mappa resta fissa in vista mentre l'elenco scorre
   accanto (su schermi larghi) - --mm-header-h e' sincronizzata da
   esplora.js con l'altezza reale dell'header del tema attivo. Scoperto
   apposta per l'ID della pagina, cosi' l'editor itinerario (che riusa la
   stessa classe .motomaps-map-pane) non viene toccato. */
@media (min-width: 821px) {
  #motomaps-esplora .motomaps-map-pane {
    position: sticky;
    top: calc(var(--mm-header-h, 0px) + 1.5rem);
    align-self: flex-start;
    /* Non solo un tetto massimo (max-height): senza un'altezza vera e
       propria la mappa restava ferma al min-height di base (420px) anche
       su schermi molto piu' alti, risultando piccola rispetto alla lista
       accanto - segnalato dall'utente come "sottodimensionata". */
    height: calc(100vh - var(--mm-header-h, 0px) - 3rem);
    max-height: calc(100vh - var(--mm-header-h, 0px) - 3rem);
  }
}

.motomaps-destfilter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.motomaps-destfilter-child {
  padding-left: 0.75rem;
  border-left: 2px solid var(--mm-border);
  margin-bottom: 1rem;
}

.motomaps-dest-pill {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mm-text);
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.motomaps-dest-pill-sub {
  font-size: 0.78rem;
  padding: 0.32rem 0.75rem;
}

.motomaps-dest-pill:hover {
  border-color: var(--mm-brand);
}

.motomaps-dest-pill.is-active {
  background: var(--mm-brand) !important;
  border-color: var(--mm-brand) !important;
  color: #fff !important;
}

.motomaps-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.motomaps-pagination-label {
  font-size: 0.85rem;
  color: var(--mm-text-muted);
}

.motomaps-pagination button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.motomaps-map-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 900;
  /* Sempre scuro con testo chiaro: questa "bolla" galleggia sopra i
     tile della mappa, non sullo sfondo del pannello, quindi non deve
     seguire il tema chiaro/scuro del resto dell'app. */
  background: rgba(23, 23, 23, 0.85);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .motomaps-map-hint {
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
    max-width: 80%;
  }
}

/* ---- Toast "Annulla" (rimozione tappa dalla mappa) ---- */

.motomaps-undo-toast {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(23, 23, 23, 0.92);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.motomaps-undo-toast button {
  background: rgba(237, 139, 0, 0.9) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 14px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Banner "bozza ritrovata" ---- */

.motomaps-draft-banner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(237, 139, 0, 0.08);
  border: 1px solid rgba(237, 139, 0, 0.35);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.motomaps-draft-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mm-text);
}

.motomaps-draft-banner-actions {
  display: flex;
  gap: 0.5rem;
}

.motomaps-side-pane {
  flex: 1 1 320px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  /* Il box del planner resta bianco: ridefinendo qui le variabili di sfondo
     (invece di toccare le regole globali di input/pulsanti), tutto quello
     che sta dentro — campi di testo, pulsanti "tipo di percorso", le
     statistiche — prende automaticamente un tono "ghiaccio" al posto del
     grigio, senza intaccare il resto del plugin (login, registrazione,
     profilo continuano come prima). */
  --mm-bg: #eef6fb;
  --mm-bg-soft: #eef6fb;
  --mm-border: #cfe3ee;
  background: #ffffff !important;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 1.25rem;
}

.motomaps-side-pane label,
.motomaps-profile-settings label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mm-text);
}

.motomaps-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

/* ---- Scelta obbligatoria pubblico/privato (Planner) ---- */

.motomaps-visibility-choice {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.motomaps-visibility-label {
  font-weight: 600;
  margin: 0;
}

.motomaps-stops {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.motomaps-stops li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.motomaps-remove-stop {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 1rem;
}

.motomaps-actions-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}


.motomaps-profile-settings,
.motomaps-public-profile {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.motomaps-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mm-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.motomaps-share-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.motomaps-avatar-photo {
  background-color: var(--mm-bg-soft);
  background-size: cover;
  background-position: center;
}

/* Solo l'avatar in cima al profilo pubblico (2026-08-28, richiesta
   esplicita dell'utente: "risulta troppo piccola") - la stessa classe
   .motomaps-avatar resta piccola ovunque altrove (es. l'anteprima nel
   modulo Impostazioni), qui la ingrandiamo solo dove serve. */
.motomaps-avatar-hero {
  width: 100px;
  height: 100px;
  font-size: 2.2rem;
}

.motomaps-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Al passaggio del mouse, ogni pulsante social prende il colore ufficiale
   di quella piattaforma (2026-08-28, richiesta esplicita dell'utente) -
   solo un effetto hover, il pulsante resta neutro a riposo come tutti gli
   altri. "Altro" (sito web generico) usa il colore del brand MotoMaps
   invece di un colore ufficiale, perche' non rappresenta una piattaforma
   specifica. */
.motomaps-social-link[data-platform="facebook"]:hover {
  background: #1877f2 !important;
  border-color: #1877f2 !important;
  color: #fff !important;
}
.motomaps-social-link[data-platform="instagram"]:hover {
  background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.motomaps-social-link[data-platform="youtube"]:hover {
  background: #ff0000 !important;
  border-color: #ff0000 !important;
  color: #fff !important;
}
.motomaps-social-link[data-platform="tiktok"]:hover {
  background: #010101 !important;
  border-color: #010101 !important;
  color: #25f4ee !important;
  text-shadow: 1px 0 #fe2c55;
}
.motomaps-social-link[data-platform="altro"]:hover {
  background: var(--mm-brand) !important;
  border-color: var(--mm-brand) !important;
  color: #fff !important;
}

.motomaps-social-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motomaps-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ---- Card profilo: intestazione (foto grande + username in cima) ---- */

.motomaps-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding-bottom: 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--mm-border);
}

.motomaps-avatar-upload {
  display: block;
  cursor: pointer;
}

.motomaps-avatar-upload .motomaps-photo-preview {
  margin-top: 0;
}

.motomaps-avatar-upload-preview,
.motomaps-avatar-upload-preview .motomaps-thumb,
.motomaps-avatar-upload-preview .motomaps-avatar {
  width: 112px;
  height: 112px;
  font-size: 2.2rem;
}

.motomaps-avatar-upload-hint {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mm-brand);
  cursor: pointer;
}

.motomaps-profile-username {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--mm-text);
  margin: 0.35rem 0 0;
}

.motomaps-required { color: #dc2626; font-weight: 700; }

/* Evidenzia un campo obbligatorio rimasto vuoto al momento del salvataggio
   (aggiunta/rimossa via JS ad ogni tentativo, non e' uno stato permanente). */
.motomaps-field-error.motomaps-app.motomaps-app,
.motomaps-app.motomaps-app select.motomaps-field-error,
.motomaps-app.motomaps-app textarea.motomaps-field-error,
.motomaps-app.motomaps-app input.motomaps-field-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}
.motomaps-avatar-upload-preview.motomaps-field-error {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
  border-radius: 50%;
}

.motomaps-profile-header .motomaps-share-row {
  justify-content: center;
  margin-top: 0.35rem;
}

/* Righe social a ordine fisso (Facebook, Instagram, YouTube, TikTok,
   Altro sempre nella stessa posizione, non scelto dall'utente) - vedi
   Motomaps_User_Meta::SOCIAL_PLATFORMS lato server, stesso ordine. */
.motomaps-social-fixed-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.motomaps-social-fixed-label {
  flex: 0 0 88px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mm-text-muted);
}

.motomaps-social-fixed-row input {
  flex: 1;
}

.motomaps-author-link {
  font-size: 0.8rem;
}

.motomaps-author-row,
.motomaps-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.3rem 0;
}

.motomaps-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.motomaps-author-social {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.2rem;
}

.motomaps-author-social a {
  width: 20px;
  height: 20px;
  color: var(--mm-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.motomaps-author-social a:hover {
  color: var(--mm-brand);
}

.motomaps-author-social svg {
  width: 16px;
  height: 16px;
}

/* ---- Ricerca indirizzi (stile Google Maps) ---- */

.motomaps-geo-wrap {
  position: relative;
}

.motomaps-geo-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 950;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.motomaps-geo-suggestions li {
  padding: 0.5rem 0.7rem;
  font-size: 0.83rem;
  cursor: pointer;
  border-bottom: 1px solid var(--mm-border);
}

.motomaps-geo-suggestions li:last-child {
  border-bottom: none;
}

.motomaps-geo-suggestions li:hover {
  background: var(--mm-brand);
  color: #fff;
}

.motomaps-geo-no-results {
  cursor: default !important;
  color: var(--mm-text-muted);
  font-style: italic;
  line-height: 1.4;
}

.motomaps-geo-no-results:hover {
  background: none !important;
  color: var(--mm-text-muted) !important;
}

/* ---- Planner: tappe A / numeri / B ---- */

.motomaps-waypoints {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.motomaps-waypoint-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.motomaps-waypoint-row .motomaps-geo-wrap {
  flex: 1;
  min-width: 0;
}

/* Campi Partenza/Arrivo/Tappa leggermente più compatti delle altre voci
   del form (Titolo, Descrizione…): qui le righe si accumulano una sopra
   l'altra, quindi conviene restino un po' più snelle. */
.motomaps-app.motomaps-app .motomaps-waypoint-row input[type='text'] {
  padding: 0.42rem 0.6rem;
  font-size: 0.88rem;
}

.motomaps-waypoint-badge {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.motomaps-waypoint-badge.role-start {
  background: #22c55e;
}

.motomaps-waypoint-badge.role-end {
  background: #ef4444;
}

.motomaps-waypoint-badge.role-way {
  background: var(--mm-brand);
}

.motomaps-wp-actions {
  display: flex;
  gap: 0.2rem;
  flex: none;
}

.motomaps-wp-actions button {
  background: none !important;
  border: none !important;
  color: var(--mm-text-muted) !important;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.motomaps-wp-actions button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--mm-brand) !important;
}

.motomaps-wp-actions button:disabled {
  opacity: 0.3;
  cursor: default;
}

.motomaps-add-waypoint {
  align-self: flex-start;
  background: none !important;
  border: 1px dashed var(--mm-border) !important;
  color: var(--mm-text-muted) !important;
  border-radius: 6px;
  padding: 0.32rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.motomaps-add-waypoint:hover {
  border-color: var(--mm-brand);
  color: var(--mm-brand);
}

.motomaps-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mm-text);
  margin: 0;
}

/* Il titolo dell'opzione secondaria (importa un file) resta piu' piccolo
   e discreto: il planner e' pensato prima di tutto per chi traccia un
   itinerario nuovo, l'import e' un'alternativa, non la scelta principale. */
.motomaps-section-title-secondary {
  font-size: 0.85rem;
  color: var(--mm-text-muted);
}

/* ---- Import file GPX/KML ---- */

.motomaps-file-import {
  border: 1px dashed var(--mm-border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.82rem;
  color: var(--mm-text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.motomaps-file-import input[type='file'] {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
  max-width: 100%;
}

.motomaps-source-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--mm-border);
  color: var(--mm-text-muted);
  display: inline-block;
  width: fit-content;
}

.motomaps-source-badge.is-imported {
  border-color: rgba(237, 139, 0, 0.4);
  color: var(--mm-brand);
}

.motomaps-export-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.motomaps-divider {
  border: none;
  border-top: 1px solid var(--mm-border);
  margin: 0.2rem 0;
}

.motomaps-route-type {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.motomaps-app .motomaps-route-type-btn {
  flex: 1 1 auto;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--mm-border) !important;
  background: var(--mm-bg-soft) !important;
  color: var(--mm-text-muted) !important;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.motomaps-app .motomaps-route-type-btn.is-active {
  background: var(--mm-brand) !important;
  border-color: var(--mm-brand) !important;
  color: #fff !important;
}

.motomaps-routing-notice {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
  margin: -0.3rem 0 0;
}

/* ---- Statistiche itinerario (tappe / km / tempo) ---- */

.motomaps-stats-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.motomaps-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  flex: 1 1 auto;
}

.motomaps-stat-icon {
  display: inline-flex;
  align-items: center;
  color: var(--mm-text-muted);
}

.motomaps-stat-value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--mm-text);
}

.motomaps-stat-label {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
}

/* ---- Pannello guida "Come usare MotoMaps Planner" (solo pagina editor) ---- */

/* A piena larghezza sotto mappa+form, il pannello è orizzontale: titolo
   sopra, poi guida / contatore / contatti affiancati (impilati se lo
   schermo è troppo stretto per starci tutti e tre in riga). */
.motomaps-help-pane {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem 2rem;
  --mm-bg: #eef6fb;
  --mm-bg-soft: #eef6fb;
  --mm-border: #cfe3ee;
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 1.5rem;
}

.motomaps-help-pane h3 {
  width: 100%;
  margin: 0;
  font-size: 1rem;
}

.motomaps-guide-list {
  flex: 2 1 320px;
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--mm-text-muted);
}

.motomaps-guide-list li::marker {
  color: var(--mm-brand);
  font-weight: 700;
}

.motomaps-guide-list strong {
  color: var(--mm-text);
}

.motomaps-help-counter {
  flex: 1 1 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 0.9rem 0.75rem;
  align-self: stretch;
  justify-content: center;
}

.motomaps-help-counter-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mm-brand);
  line-height: 1.1;
}

.motomaps-help-counter-label {
  font-size: 0.76rem;
  color: var(--mm-text-muted);
}

.motomaps-help-contact {
  flex: 1 1 190px;
  align-self: center;
  margin: 0;
  font-size: 0.78rem;
  color: var(--mm-text-muted);
}

/* ---- Pin etichettati sulla mappa (stile Google Maps: A / numeri / B) ---- */

.motomaps-pin-icon {
  background: none;
  border: none;
}

.motomaps-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.motomaps-pin span {
  transform: rotate(45deg);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-family: Arial, sans-serif;
}

.motomaps-pin-start {
  background: #22c55e;
}

.motomaps-pin-end {
  background: #ef4444;
}

.motomaps-pin-way {
  background: var(--mm-brand, #ed8b00);
}

/* ---- Copertina e riassunto nella pagina di dettaglio itinerario ---- */

/* ---- Anteprima foto a schermo (galleria itinerario) ---- */

.motomaps-lightbox {
  position: fixed;
  inset: 0;
  /* Deve stare sopra la barra admin di WordPress (z-index 99999 quando si
     naviga da loggati), altrimenti la barra copre il pulsante di chiusura
     in alto a destra e i click su di esso non arrivano mai al bottone. */
  z-index: 999999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.motomaps-lightbox-open {
  overflow: hidden;
}

.motomaps-lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
}

.motomaps-lightbox-close,
.motomaps-lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.motomaps-lightbox-close:hover,
.motomaps-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

.motomaps-lightbox-close {
  top: 1.2rem;
  right: 1.2rem;
}

.motomaps-lightbox-prev {
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
}

.motomaps-lightbox-next {
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
}

.motomaps-lightbox-counter {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

.motomaps-hero-cover {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-bg-soft);
  margin-bottom: 1rem;
}

/* ---- Muro "registrati per continuare" (dettaglio itinerario) ---- */

.motomaps-gate-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.motomaps-gate-wrap h2 { margin: 0 0 0.4rem; }

.motomaps-content-gate {
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 16px;
  padding: 1.75rem 1.85rem;
  margin-top: 1.5rem;
  text-align: center;
}
.motomaps-content-gate-title { font-size: 1.15rem; font-weight: 800; color: var(--mm-text); margin: 0 0 0.5rem; }
.motomaps-content-gate-text { font-size: 0.9rem; color: var(--mm-text-muted); margin: 0 0 1.25rem; max-width: 420px; margin-left: auto; margin-right: auto; }
.motomaps-content-gate-actions { display: flex; align-items: center; justify-content: center; gap: 1.1rem; flex-wrap: wrap; }

.motomaps-excerpt {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--mm-text-muted);
}

/* ---- Marker "extra" fuori tracciato (campeggio, bivacco, ecc.) ---- */

.motomaps-poi-icon {
  background: none;
  border: none;
}

.motomaps-poi-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mm-brand, #ed8b00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ---- Campi affiancati nel form (es. Periodo / Difficoltà) ---- */

.motomaps-field-row {
  display: flex;
  gap: 0.8rem;
}

.motomaps-field-row label {
  flex: 1;
  min-width: 0;
}

.motomaps-hint-small {
  font-size: 0.76rem;
  margin: 0.2rem 0 0;
}

/* ---- Upload foto (copertina / galleria) ---- */

.motomaps-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.motomaps-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
  flex: none;
}

/* Foto profilo: tonda come gli avatar mostrati altrove nel sito (Esplora,
   profilo pubblico), non un quadrato con angoli smussati come copertina
   e galleria. */
.motomaps-thumb-round {
  border-radius: 50%;
}

.motomaps-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.motomaps-photo-uploading {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
}

/* ---- Segnala un luogo (punti extra fuori tracciato) ---- */

.motomaps-poi-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motomaps-poi-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motomaps-poi-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.motomaps-poi-row .motomaps-geo-wrap {
  flex: 1;
  min-width: 0;
}

.motomaps-app.motomaps-app .motomaps-poi-row input[type='text'],
.motomaps-app.motomaps-app .motomaps-poi-row input[type='url'] {
  width: 100%;
  padding: 0.42rem 0.6rem;
  font-size: 0.88rem;
}

/* Specificita' raddoppiata di proposito (vedi nota in cima al file): la
   regola generale "width: 100%" sui select vincerebbe altrimenti anche
   qui, schiacciando il campo di testo accanto a larghezza quasi zero
   (bug reale, trovato testando il modulo social). */
.motomaps-app.motomaps-app .motomaps-poi-row select {
  flex: none;
  width: auto;
  font-size: 0.8rem;
  padding: 0.35rem 0.4rem;
}

.motomaps-poi-row [data-action="remove-poi"] {
  background: none !important;
  border: none !important;
  color: var(--mm-text-muted) !important;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  flex: none;
}

.motomaps-poi-row [data-action="remove-poi"]:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--mm-brand) !important;
}

/* ---- Pulsante "installa l'app" (dentro "Il mio profilo") ---- */

.motomaps-pwa-card {
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
  max-width: 520px;
}

.motomaps-pwa-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.motomaps-pwa-card p {
  margin: 0;
  color: var(--mm-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.motomaps-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.motomaps-install-tip {
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem !important;
}

/* ---- Pagina "Nuovo itinerario" a schermo intero ----
   Il form del planner galleggia SOPRA la mappa (pannello semi-trasparente
   a sinistra, leggibile ma con la mappa visibile sotto/intorno) invece di
   occupare una colonna separata: piu' spazio alla mappa, resa piu' "app"
   e meno "modulo compilato accanto a una cartina". Altezza dell'intero
   blocco limitata (non piu' sempre 100vh) cosi' non risulta sproporzionato
   su schermi grandi (richiesta esplicita, si notava anche su un 24"). */

body.motomaps-fullscreen-editor .motomaps-app {
  padding: 1.25rem 0;
}

body.motomaps-fullscreen-editor .motomaps-editor-layout {
  display: block;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

body.motomaps-fullscreen-editor .motomaps-editor-row {
  /* .motomaps-editor-layout resta "display:flex" (regola base): senza
     un width esplicito qui, questo elemento e' un flex-item il cui
     flex-basis si calcola dal contenuto - ma il contenuto (mappa e
     pannello) e' assolutamente posizionato quindi non "conta" piu' ai
     fini della larghezza, e la riga collassava quasi a 0px (bug reale,
     trovato testando: mappa e pannello sparivano del tutto). */
  display: block;
  width: 100%;
  position: relative;
  height: calc(100vh - var(--mm-header-h, 90px) - 2.5rem);
  max-height: 820px;
  min-height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
}

body.motomaps-fullscreen-editor .motomaps-map-pane {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 0;
}

/* Il controllo zoom di Leaflet nasce in alto a sinistra per default:
   spostato a destra per non finire nascosto sotto il pannello. */
body.motomaps-fullscreen-editor .motomaps-map-pane .leaflet-top.leaflet-left {
  left: auto;
  right: 10px;
}

body.motomaps-fullscreen-editor .motomaps-side-pane {
  position: absolute;
  top: 1rem;
  left: 1rem;
  bottom: 1rem;
  width: 360px;
  max-width: calc(100% - 2rem);
  z-index: 1100;
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 14px;
  /* Quasi trasparente ma sempre leggibile: la mappa resta visibile
     dietro/attorno al pannello, senza compromettere la leggibilita' del
     testo che ci si scrive dentro (da qui lo sfondo bianco all'88% e non
     piu' sotto, e il leggero sfocamento di quello che c'e' dietro). */
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

@media (max-width: 820px) {
  /* Sotto gli 820px il pannello che galleggia sopra la mappa toglierebbe
     troppo spazio utile per scrivere: qui si torna a mappa sopra/form
     sotto, entrambi a piena larghezza e sfondo pieno, piu' leggibile su
     schermi piccoli. */
  body.motomaps-fullscreen-editor .motomaps-editor-layout {
    padding: 0;
  }
  body.motomaps-fullscreen-editor .motomaps-editor-row {
    position: static;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }
  body.motomaps-fullscreen-editor .motomaps-map-pane {
    position: static;
    height: 46vh;
    min-height: 240px;
    border-radius: 0;
  }
  body.motomaps-fullscreen-editor .motomaps-map-pane .leaflet-top.leaflet-left {
    left: 10px;
    right: auto;
  }
  body.motomaps-fullscreen-editor .motomaps-side-pane {
    position: static;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);
    border: none;
    border-top: 1px solid var(--mm-border);
    padding: 1.5rem 1.25rem 2.5rem;
  }
}

/* ---- Pagina "Autori": elenco pubblico dei profili community ---- */

.motomaps-authors-page {
  max-width: 1280px;
}

/* Righe da 5, piu' compatte (2026-08-28, richiesta esplicita dell'utente:
   "le card risultano troppo grandi, prova una soluzione piu' piccola con
   righe da 5") - scala a 3/2/1 colonne sugli schermi piu' stretti. */
.motomaps-authors-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .motomaps-authors-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .motomaps-authors-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .motomaps-authors-grid { grid-template-columns: 1fr; }
}

.motomaps-authors-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.motomaps-author-card {
  display: flex;
  flex-direction: column;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.motomaps-author-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* La foto e' la protagonista della card (a differenza del piccolo tondo
   usato accanto al nome altrove nel plugin) - un quadrato pieno in alto,
   non un cerchio minuscolo perso in mezzo al testo. */
.motomaps-author-card-avatar {
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--mm-brand);
  background-size: cover;
  background-position: center;
}

.motomaps-author-card-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

.motomaps-author-card-body {
  padding: 0.65rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.motomaps-author-card-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.motomaps-author-card-bio {
  font-size: 0.76rem;
  color: var(--mm-text-muted);
  line-height: 1.4;
  margin: 0.2rem 0 0.1rem;
  /* Non lasciamo che una bio lunga sfondi l'altezza della card e sfasi
     l'allineamento di tutte le altre righe della griglia - una sola riga
     nella versione compatta, non piu' tre. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.motomaps-author-card .motomaps-author-social {
  margin: 0.2rem 0 0;
}

.motomaps-author-card-count {
  font-size: 0.8rem;
  color: var(--mm-text-muted, #767676);
  margin-top: 0.4rem;
}

/* ---- Data e destinazione sulle card di Esplora ---- */

.motomaps-destination-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--mm-text-muted, #767676);
}

/* ---- Community: bacheca stile social ---- */

.motomaps-community-feed {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.motomaps-feed-card {
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  background: var(--mm-bg);
  overflow: hidden;
}

.motomaps-feed-cover {
  display: block;
  height: 220px;
  background-color: var(--mm-border);
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 0.85rem;
}

.motomaps-feed-cover .motomaps-origin-badge {
  margin-bottom: 0;
}

.motomaps-feed-stats {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.motomaps-feed-stats span {
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.motomaps-feed-body {
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motomaps-feed-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.motomaps-feed-author .motomaps-author-avatar {
  width: 26px;
  height: 26px;
}

.motomaps-feed-date {
  color: var(--mm-text-muted);
}

.motomaps-feed-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mm-text) !important;
  text-decoration: none;
}

.motomaps-feed-excerpt {
  font-size: 0.9rem;
  color: var(--mm-text-muted);
  line-height: 1.5;
}

.motomaps-feed-story {
  font-size: 0.88rem;
  line-height: 1.6;
  max-height: 4.8em;
  overflow: hidden;
  position: relative;
}

.motomaps-feed-story::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.6em;
  background: linear-gradient(0deg, var(--mm-bg) 20%, transparent);
}

.motomaps-feed-readmore {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mm-brand) !important;
  text-decoration: none;
  align-self: flex-start;
}

.motomaps-feed-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--mm-border);
  margin-top: 0.35rem;
}

.motomaps-feed-action {
  background: transparent !important;
  border: none !important;
  color: var(--mm-text-muted) !important;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.motomaps-feed-action:hover {
  color: var(--mm-brand) !important;
}

.motomaps-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.motomaps-rating-stars {
  display: inline-flex;
}

.motomaps-star {
  background: none !important;
  border: none !important;
  color: var(--mm-border) !important;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 1px;
}

.motomaps-star.is-filled {
  color: var(--mm-brand) !important;
}

.motomaps-rating-count {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
}

.motomaps-feed-comments {
  border-top: 1px solid var(--mm-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.motomaps-comment {
  background: var(--mm-bg-soft);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.motomaps-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.motomaps-comment-author {
  font-weight: 700;
}

.motomaps-comment-date {
  color: var(--mm-text-muted);
}

.motomaps-comment-body {
  font-size: 0.88rem;
  line-height: 1.5;
}

.motomaps-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motomaps-comment-form textarea {
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
}

.motomaps-comment-form button {
  align-self: flex-end;
}

.motomaps-feed-more {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

@media (max-width: 640px) {
  .motomaps-community-feed { max-width: none; }
  .motomaps-feed-cover { height: 170px; }
}

/* ---- Campanella notifiche (montata nell'header del tema) ---- */

.motomaps-notif {
  position: relative;
}

.motomaps-notif-trigger {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #6B665C !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.motomaps-notif-trigger:hover,
.motomaps-notif.is-open .motomaps-notif-trigger {
  border-color: rgba(20, 15, 5, 0.10) !important;
  background: rgba(20, 15, 5, 0.03) !important;
  color: #1A1A1A !important;
}

/* La campana stessa diventa arancione quando c'e' una notifica non letta,
   non solo il numerino sopra - si nota a colpo d'occhio anche da lontano. */
.motomaps-notif-trigger.has-unread {
  color: #ed8b00 !important;
}

.motomaps-notif-trigger.has-unread:hover {
  color: #c26e00 !important;
}

.motomaps-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ed8b00;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.motomaps-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  max-height: 380px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid rgba(20, 15, 5, 0.10);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 16px 32px rgba(20, 15, 5, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.motomaps-notif.is-open .motomaps-notif-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.motomaps-notif-title {
  font-size: 12px;
  font-weight: 800;
  color: #1A1A1A;
  padding: 6px 8px 10px;
}

.motomaps-notif-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.motomaps-notif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 8px;
  border-radius: 9px;
  text-decoration: none !important;
}

.motomaps-notif-item:hover {
  background: rgba(20, 15, 5, 0.04);
}

.motomaps-notif-item.is-unread {
  background: rgba(237, 139, 0, 0.08);
}

.motomaps-notif-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #1A1A1A !important;
}

.motomaps-notif-date {
  font-size: 11px;
  color: #9B9587;
}

.motomaps-notif .motomaps-notice {
  color: #9B9587;
  font-size: 12.5px;
  padding: 8px;
}

/* ---- Segui / Salvati ---- */

.motomaps-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.25rem;
}

.motomaps-follow-counts {
  font-size: 0.85rem;
  color: var(--mm-text-muted);
  margin: 0.2rem 0 0.5rem;
}

.motomaps-follow-counts strong {
  color: var(--mm-text);
}

#motomaps-follow-btn {
  align-self: flex-start;
  margin: 0.4rem 0 0.6rem;
}

.motomaps-followed-page,
.motomaps-saved-page {
  max-width: 900px;
  margin: 0 auto;
}

.motomaps-follow-mini {
  margin-top: 0.5rem;
}

/* ---- Testo formattato nel racconto di un itinerario ---- */
/* Stessa esigenza degli articoli Magazine (vedi .mm-article-content nel
   tema): chi scrive puo' incollare HTML con titoli/elenchi/citazioni gia'
   pronto, qui lo stile perche' non venga mostrato con l'aspetto grezzo di
   default del browser (2026-08-27). */

.motomaps-description {
  font-size: 16px;
  line-height: 1.75;
  color: var(--mm-text);
}
.motomaps-description p { margin: 0 0 20px; }
.motomaps-description h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin: 32px 0 14px;
}
.motomaps-description h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin: 26px 0 12px;
}
.motomaps-description ul,
.motomaps-description ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.motomaps-description li { margin-bottom: 8px; }
.motomaps-description strong { font-weight: 700; }
.motomaps-description blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--mm-brand);
  font-size: 17px;
  font-style: italic;
  color: var(--mm-text-muted);
}
.motomaps-description img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 8px 0 18px;
  display: block;
}

/* ---- Commenti/stelline sul dettaglio itinerario ---- */

.motomaps-itinerario-comments {
  border-top: 1px solid var(--mm-border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.motomaps-feed-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---- Area redazione + editor articoli ---- */

.motomaps-article-editor,
.motomaps-redazione {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Queste due pagine vivono dentro il tema scuro (non solo dentro le
     altre pagine del plugin, gia' tutte su sfondo bianco): senza uno
     sfondo esplicito qui, il testo (pensato scuro su bianco) finiva
     scuro su scuro, quasi invisibile - bug reale, segnalato testando
     dal vivo sul sito. */
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  padding: 1.75rem;
  color: var(--mm-text);
}

.motomaps-article-editor label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mm-text);
}

.motomaps-art-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.motomaps-art-col {
  flex: 1 1 220px;
}

.motomaps-art-section {
  border-top: 1px solid var(--mm-border);
  padding-top: 1rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.motomaps-red-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.motomaps-red-top .motomaps-page-title { margin: 0; }

.motomaps-create-menu {
  position: relative;
}

.motomaps-create-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 40;
}

.motomaps-create-menu.is-open .motomaps-create-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.motomaps-create-panel a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--mm-text) !important;
  text-decoration: none !important;
}

.motomaps-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.motomaps-dash-card {
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.motomaps-dash-card strong {
  font-size: 1.6rem;
  color: var(--mm-brand);
}

.motomaps-dash-card span {
  font-size: 0.85rem;
  color: var(--mm-text-muted);
}

.motomaps-dash-subtitle {
  margin: 0.9rem 0 0.2rem;
  font-size: 1rem;
}

.motomaps-dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.motomaps-dash-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--mm-bg-soft);
  font-size: 0.9rem;
}

.motomaps-dash-list li strong {
  color: var(--mm-brand);
}
.motomaps-create-panel a:hover {
  background: var(--mm-bg-soft);
}
.motomaps-create-panel a strong {
  font-size: 0.9rem;
}
.motomaps-create-panel a span {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
}

.motomaps-dest-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--mm-border);
}

/* ---- Aree geografiche raggruppate per macroarea (tendina) ---- */

.motomaps-dest-group {
  border-bottom: 1px solid var(--mm-border);
}

.motomaps-dest-group summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 0;
  font-weight: 700;
  font-size: 1rem;
}
.motomaps-dest-group summary::-webkit-details-marker { display: none; }
.motomaps-dest-group summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--mm-text-muted);
  transition: transform 0.15s ease;
}
.motomaps-dest-group[open] summary::before {
  transform: rotate(90deg);
}

.motomaps-dest-group .motomaps-dest-row {
  padding-left: 1.25rem;
}

/* La riga della macroarea stessa (non una sua regione/nazione figlia):
   leggermente evidenziata per distinguerla dalle righe sotto, che sono
   invece le singole regioni/nazioni al suo interno. */
.motomaps-dest-row-macroarea {
  background: var(--mm-bg-soft);
  border-radius: 8px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.motomaps-dest-row-photo {
  flex: none;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  background-color: var(--mm-border);
  background-size: cover;
  background-position: center;
}

.motomaps-dest-row-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.motomaps-dest-row-body textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem;
  border: 1px solid var(--mm-border);
  border-radius: 6px;
  resize: vertical;
}

/* ---- Magazine digitale (sfoglio a scorrimento) ---- */

.motomaps-ebook-frame {
  position: relative;
  max-width: 640px;
  height: min(78vh, 780px);
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 15, 5, 0.16);
  border: 1px solid var(--mm-border);
  background: #fff;
}

.motomaps-ebook-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.motomaps-ebook-page {
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Copertina generata: sempre lo stesso trattamento a marchio, nessuna
   foto scelta a mano - coerenza garantita ad ogni numero. */
.motomaps-ebook-cover {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 30% 20%, #FFC469 0%, #ED8B00 45%, #B56C00 100%);
  color: #fff;
  padding: 2rem;
}
.motomaps-ebook-cover-wordmark { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; text-transform: lowercase; margin-bottom: 1.5rem; }
.motomaps-ebook-cover-wordmark span { opacity: 0.75; }
.motomaps-ebook-cover-issue { font-size: 1.6rem; font-weight: 800; }
.motomaps-ebook-cover-sub { font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; opacity: 0.85; margin-top: 0.5rem; }

.motomaps-ebook-sommario { padding: 2rem 1.75rem; }
.motomaps-ebook-sommario h2 { margin: 0 0 1.25rem; font-size: 1.3rem; }
.motomaps-ebook-sommario-list { display: flex; flex-direction: column; }
.motomaps-ebook-sommario-item {
  display: flex; align-items: center; gap: 0.75rem;
  background: none; border: none; border-bottom: 1px solid var(--mm-border);
  padding: 0.85rem 0.25rem; text-align: left; cursor: pointer; font-family: inherit;
}
.motomaps-ebook-sommario-item:hover { background: var(--mm-bg-soft); }
.motomaps-ebook-sommario-tag { flex: none; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.5px; color: var(--mm-brand); }
.motomaps-ebook-sommario-title { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--mm-text); }
.motomaps-ebook-sommario-page { flex: none; font-size: 0.8rem; color: var(--mm-text-muted); }

/* Pagina articolo: base condivisa, poi una variante per categoria. */
.motomaps-ebook-cover-photo { height: 44%; flex: none; background-size: cover; background-position: center; background-color: var(--mm-bg-soft); }
.motomaps-ebook-page-body { padding: 1.5rem 1.5rem 2rem; flex: 1; display: flex; flex-direction: column; }
.motomaps-ebook-tag {
  align-self: flex-start; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.5px;
  padding: 0.3rem 0.6rem; border-radius: 999px; margin-bottom: 0.6rem; color: #fff;
}
.motomaps-ebook-page-body h2 { margin: 0 0 0.6rem; font-size: 1.25rem; line-height: 1.3; }
.motomaps-ebook-excerpt { font-size: 0.9rem; line-height: 1.55; color: var(--mm-text-muted); margin: 0.75rem 0 1.25rem; }
.motomaps-ebook-stats { display: flex; gap: 0.6rem; margin-bottom: 0.4rem; }
.motomaps-ebook-stats span { font-size: 0.78rem; font-weight: 700; color: var(--mm-text); background: var(--mm-bg-soft); border-radius: 999px; padding: 0.25rem 0.65rem; }
.motomaps-ebook-location-label { font-size: 0.82rem; color: var(--mm-text-muted); margin: 0 0 0.4rem; }
.motomaps-ebook-map-wrap { margin: 0.6rem 0 1rem; }
.motomaps-ebook-mini-map { height: 160px; border-radius: 10px; overflow: hidden; border: 1px solid var(--mm-border); }

/* Itinerari: foto grande in cima, etichetta arancione. */
.motomaps-ebook-page-itinerari .motomaps-ebook-tag { background: var(--mm-brand); }
/* Destinazioni: foto ancora piu' protagonista. */
.motomaps-ebook-page-destinazioni .motomaps-ebook-cover-photo { height: 54%; }
.motomaps-ebook-page-destinazioni .motomaps-ebook-tag { background: #2E9E6C; }
/* Articoli: piu' editoriale, foto piu' piccola. */
.motomaps-ebook-page-articoli .motomaps-ebook-cover-photo { height: 30%; }
.motomaps-ebook-page-articoli .motomaps-ebook-tag { background: #4B5563; }
.motomaps-ebook-page-articoli .motomaps-ebook-page-body { column-count: 1; }

.motomaps-ebook-nav {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-top: 1.25rem;
}
.motomaps-ebook-arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--mm-border);
  background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--mm-text);
}
.motomaps-ebook-arrow:hover { border-color: var(--mm-brand); color: var(--mm-brand); }
.motomaps-ebook-dots { display: flex; gap: 0.4rem; }
.motomaps-ebook-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mm-border); cursor: pointer; }
.motomaps-ebook-dot.is-active { background: var(--mm-brand); width: 20px; border-radius: 4px; }

.motomaps-ebook-archive-link { display: block; text-align: center; margin-top: 1rem; font-size: 0.85rem; font-weight: 700; color: var(--mm-brand); }
.motomaps-ebook-empty { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; gap: 1rem; align-items: center; }

@media (max-width: 700px) {
  .motomaps-ebook-frame { height: 82vh; border-radius: 0; box-shadow: none; }
}

/* ---- Numeri arretrati (griglia copertine) ---- */

.motomaps-ebook-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.motomaps-ebook-archive-card { display: flex; flex-direction: column; gap: 0.5rem; }
.motomaps-ebook-archive-cover {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #FFC469 0%, #ED8B00 45%, #B56C00 100%);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; text-align: center; padding: 1rem;
  box-shadow: 0 10px 24px rgba(20, 15, 5, 0.14);
}
.motomaps-ebook-archive-wordmark { font-size: 1.2rem; font-weight: 800; text-transform: lowercase; }
.motomaps-ebook-archive-wordmark span { opacity: 0.75; }
.motomaps-ebook-archive-label { font-size: 0.85rem; font-weight: 700; }
.motomaps-ebook-archive-count { font-size: 0.78rem; color: var(--mm-text-muted); text-align: center; }

/* =========================================================
   Aggiornamento community (v2.10.0)
   Mi piace, commenti con risposte, schede bacheca/profilo,
   elenchi persone, messaggi privati, avvisi a comparsa.
   ========================================================= */

/* ---- Avvisi a comparsa (al posto di alert() del browser) ---- */

.motomaps-toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 999999; /* sopra la barra admin di WordPress (99999) */
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}

.motomaps-toast {
  background: #1c1c1c;
  color: #fff;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
}

.motomaps-toast.is-in { opacity: 1; transform: translateY(0); }
.motomaps-toast.is-error { background: #a32b1c; }

@media (prefers-reduced-motion: reduce) {
  .motomaps-toast { transition: none; }
}

/* ---- Mi piace ---- */

.motomaps-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--mm-border);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mm-text-muted);
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.motomaps-like-btn:hover { color: var(--mm-brand); border-color: var(--mm-brand); }
.motomaps-like-btn.is-liked { color: #d5442f; border-color: #d5442f; background: rgba(213, 68, 47, 0.08); }
.motomaps-like-btn:disabled { opacity: 0.6; cursor: default; }
.motomaps-like-icon { display: inline-flex; }
.motomaps-like-count { font-variant-numeric: tabular-nums; }

.motomaps-like-slot { display: inline-flex; }

@media (prefers-reduced-motion: reduce) {
  .motomaps-like-btn { transition: none; }
}

/* ---- Commenti (componente condiviso) ---- */

.motomaps-comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.motomaps-comment {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
}

.motomaps-comment.is-reply {
  margin-left: 34px;
  padding-left: 12px;
  border-left: 2px solid var(--mm-border);
}

.motomaps-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-bg-soft);
  flex-shrink: 0;
}

.motomaps-comment-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--mm-brand);
  font-size: 0.95rem;
}

.motomaps-comment.is-reply .motomaps-comment-avatar { width: 30px; height: 30px; }
.motomaps-comment.is-reply { grid-template-columns: 30px 1fr; }

.motomaps-comment-main { min-width: 0; }

.motomaps-comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.motomaps-comment-author {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--mm-text);
  text-decoration: none;
}

a.motomaps-comment-author:hover { color: var(--mm-brand); }

.motomaps-comment-date { font-size: 0.78rem; color: var(--mm-text-muted); }

.motomaps-comment-body {
  font-size: 0.94rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.motomaps-comment-body p { margin: 0 0 6px; }
.motomaps-comment-body p:last-child { margin-bottom: 0; }

.motomaps-comment-tools { display: flex; gap: 12px; margin-top: 4px; }

.motomaps-comment-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mm-text-muted);
}

.motomaps-comment-link:hover { color: var(--mm-brand); }
.motomaps-comment-link.is-danger:hover { color: #b3261e; }
.motomaps-comment-replybox { margin-top: 8px; }

/* ---- Schede (bacheca, profilo, messaggi) ---- */

.motomaps-feed-tabs,
.motomaps-profile-tabs,
.motomaps-msg-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--mm-border);
  margin-bottom: 16px;
}

.motomaps-feed-tab,
.motomaps-profile-tab,
.motomaps-msg-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--mm-text-muted);
  margin-bottom: -1px;
}

.motomaps-feed-tab:hover,
.motomaps-profile-tab:hover,
.motomaps-msg-tab:hover { color: var(--mm-text); }

.motomaps-feed-tab.is-active,
.motomaps-profile-tab.is-active,
.motomaps-msg-tab.is-active {
  color: var(--mm-brand);
  border-bottom-color: var(--mm-brand);
}

/* ---- Autore in bacheca: moto e regione ---- */

.motomaps-author-bits {
  font-size: 0.78rem;
  color: var(--mm-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Profilo pubblico: etichette e numeri ---- */

.motomaps-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin: 8px 0 4px;
}

.motomaps-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.83rem;
  font-weight: 500;
}

.motomaps-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--mm-border);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
  width: 100%;
}

.motomaps-profile-stats div {
  background: var(--mm-bg);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.motomaps-profile-stats strong {
  font-size: 1rem;
  color: var(--mm-brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.motomaps-profile-stats span { font-size: 0.74rem; color: var(--mm-text-muted); line-height: 1.25; }

@media (max-width: 560px) {
  .motomaps-profile-stats { grid-template-columns: repeat(2, 1fr); }
}

.motomaps-follow-count-btn {
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border-radius: 5px;
}

.motomaps-follow-count-btn:hover { color: var(--mm-brand); }
.motomaps-follow-count-btn.is-open { color: var(--mm-brand); background: var(--mm-bg-soft); }

.motomaps-profile-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

/* ---- Elenco persone (follower / seguiti) ---- */

.motomaps-people-panel {
  width: 100%;
  max-width: 420px;
  margin: 6px auto 10px;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  background: var(--mm-bg-soft);
  padding: 6px;
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
}

.motomaps-person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--mm-text) !important;
}

.motomaps-person-row:hover { background: var(--mm-bg); }

.motomaps-person-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-bg);
  flex-shrink: 0;
}

.motomaps-person-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--mm-brand);
}

.motomaps-person-name {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  min-width: 0;
}

.motomaps-person-name .motomaps-hint { font-size: 0.76rem; font-weight: 400; margin: 0; }

/* ---- Profilo pubblico: itinerari con copertina ---- */

.motomaps-profile-itineraries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}

.motomaps-profile-itinerary {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--mm-bg);
  text-decoration: none !important;
  color: var(--mm-text) !important;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.motomaps-profile-itinerary:hover { border-color: var(--mm-brand); transform: translateY(-2px); }

.motomaps-profile-itinerary-cover {
  display: block;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-bg-soft);
}

.motomaps-profile-itinerary-cover.is-empty {
  background-image: linear-gradient(135deg, var(--mm-bg-soft), var(--mm-border));
}

.motomaps-profile-itinerary-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 12px;
}

.motomaps-profile-itinerary-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.motomaps-profile-itinerary-meta { font-size: 0.78rem; color: var(--mm-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .motomaps-profile-itinerary { transition: none; }
  .motomaps-profile-itinerary:hover { transform: none; }
}

/* ---- Reazioni sul dettaglio itinerario ---- */

.motomaps-itinerario-reactions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

/* ---- Profili utenti: filtri ---- */

.motomaps-authors-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.motomaps-authors-filters input[type="search"] { flex: 1 1 240px; min-width: 0; }
.motomaps-authors-filters select { flex: 0 1 200px; }

.motomaps-authors-count {
  font-size: 0.82rem;
  color: var(--mm-text-muted);
  white-space: nowrap;
}

.motomaps-author-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}

.motomaps-author-card-badges span {
  font-size: 0.76rem;
  color: var(--mm-text-muted);
  background: var(--mm-bg-soft);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---- Messaggi privati ---- */

.motomaps-messages {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 20px;
  align-items: start;
}

.motomaps-messages-side { min-width: 0; }

.motomaps-msg-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 62vh;
  overflow-y: auto;
}

.motomaps-msg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--mm-text);
}

.motomaps-msg-row:hover { background: var(--mm-bg-soft); }
.motomaps-msg-row.is-active { background: var(--mm-bg-soft); box-shadow: inset 2px 0 0 var(--mm-brand); }

.motomaps-msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--mm-bg-soft);
  flex-shrink: 0;
}

.motomaps-msg-avatar.is-small { width: 30px; height: 30px; }

.motomaps-msg-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--mm-brand);
}

.motomaps-msg-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.motomaps-msg-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.motomaps-msg-row-name { font-weight: 600; font-size: 0.9rem; }
.motomaps-msg-row-time { font-size: 0.73rem; color: var(--mm-text-muted); white-space: nowrap; }

.motomaps-msg-row-snippet {
  font-size: 0.82rem;
  color: var(--mm-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.motomaps-msg-badge {
  background: var(--mm-brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.motomaps-messages-main {
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  background: var(--mm-bg);
  min-height: 320px;
  padding: 14px 16px;
}

.motomaps-thread { display: flex; flex-direction: column; gap: 12px; height: 100%; }

.motomaps-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--mm-border);
}

.motomaps-thread-person {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  text-decoration: none !important;
  color: var(--mm-text) !important;
}

.motomaps-thread-person:hover { color: var(--mm-brand) !important; }
.motomaps-thread-request-note { margin: 0; }

.motomaps-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 2px;
}

.motomaps-bubble {
  align-self: flex-start;
  max-width: 78%;
  background: var(--mm-bg-soft);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.motomaps-bubble.is-mine {
  align-self: flex-end;
  background: var(--mm-brand);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.motomaps-bubble-text { font-size: 0.92rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.motomaps-bubble-time { font-size: 0.7rem; opacity: 0.7; align-self: flex-end; }

.motomaps-thread-form { display: flex; gap: 9px; align-items: flex-end; }
.motomaps-thread-form textarea { flex: 1; resize: vertical; }

@media (max-width: 780px) {
  .motomaps-messages { grid-template-columns: 1fr; }
  .motomaps-msg-list { max-height: 40vh; }
  .motomaps-bubble { max-width: 88%; }
}

/* ---- Messaggi: elimina conversazione, seleziona e cancella ---- */

.motomaps-msg-row {
  position: relative;
}

.motomaps-msg-row-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--mm-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.motomaps-msg-row:hover .motomaps-msg-row-delete,
.motomaps-msg-row:focus-within .motomaps-msg-row-delete {
  display: inline-flex;
}

.motomaps-msg-row-delete:hover {
  background: rgba(179, 38, 30, 0.1);
  color: #b3261e;
}

@media (max-width: 780px) {
  /* Su telefono non c'e' hover: il pulsante resta sempre visibile. */
  .motomaps-msg-row-delete { display: inline-flex; }
}

.motomaps-thread-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.motomaps-thread-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--mm-border);
}

.motomaps-thread-selection-bar span {
  font-size: 0.85rem;
  color: var(--mm-text-muted);
  margin-right: auto;
}

/* Modalita' selezione: le bolle diventano cliccabili per scegliere quali
   eliminare, con un cerchietto vuoto/pieno al posto dell'orario. */
.motomaps-thread-messages.is-selecting .motomaps-bubble {
  cursor: pointer;
  padding-left: 34px;
  position: relative;
  user-select: none;
}

.motomaps-bubble-check {
  display: none;
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--mm-border);
  background: var(--mm-bg);
}

.motomaps-thread-messages.is-selecting .motomaps-bubble-check {
  display: block;
}

.motomaps-bubble.is-selected .motomaps-bubble-check {
  background: var(--mm-brand);
  border-color: var(--mm-brand);
}

.motomaps-bubble.is-selected {
  outline: 2px solid var(--mm-brand);
  outline-offset: 2px;
}

.motomaps-thread-messages.is-selecting .motomaps-bubble.is-mine {
  /* Sul lato destro la bolla e' allineata a destra: il pallino di selezione
     resta comunque a sinistra della bolla, non del contenitore, altrimenti
     finirebbe lontano dal testo. */
  padding-left: 34px;
  padding-right: 13px;
}

/* ---- Segnalazioni: form nella conversazione, schede in redazione ---- */

.motomaps-thread-report-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin: 4px 0 10px;
  background: var(--mm-bg-soft);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
}

.motomaps-thread-report-form textarea {
  resize: vertical;
}

.motomaps-report-card {
  border: 1px solid #f0c6ad;
  background: #fff6ef;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.motomaps-report-head {
  margin: 0;
  font-size: 0.92rem;
}

.motomaps-report-reason {
  margin: 0;
  font-style: italic;
  color: var(--mm-text-muted);
}

.motomaps-report-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--mm-brand);
  font-weight: 600;
}

.motomaps-report-msg {
  font-size: 0.85rem;
  margin: 6px 0 0;
  padding: 6px 9px;
  background: var(--mm-bg);
  border-radius: 6px;
}

/* =========================================================
   Correzioni SOLO smartphone (audit 2026-08-27)
   Notifiche, Crea contenuto, nome nella lista messaggi
   sporgevano fuori dallo schermo su telefono - qui sotto i
   768px di tablet/desktop, che restano invariati.
   ========================================================= */

@media (max-width: 600px) {
  /* Da "ancorato al pulsante" (che su schermi stretti puo' trovarsi
     lontano dal bordo destro vero) a "ancorato allo schermo stesso":
     margini fissi da entrambi i lati, mai piu' fuori dai bordi
     qualunque sia la posizione del pulsante che lo apre. */
  .motomaps-notif-panel,
  .motomaps-create-panel {
    position: fixed;
    top: 96px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}

/* Il nome nella lista messaggi non aveva un modo di accorciarsi: con un
   nome lungo in uno spazio stretto spingeva l'intera riga fuori dal
   bordo destro dello schermo (trovato sui telefoni piu' piccoli, ma
   corretto qui in generale - un nome che si accorcia con i puntini non
   cambia nulla dove lo spazio c'e' gia'). */
.motomaps-msg-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
