:root {
  --paper: #f7f7f5;
  --paper-out: #f7f7f5;
  --block-line: rgba(0, 0, 0, 0.06);
  --section-line: rgba(0, 0, 0, 0.1);
  --hover: rgba(0, 0, 0, 0.05);
  --post-bg: #ffffff;
  --post-border: rgba(0, 0, 0, 0.08);
  --post-fg: #1a1a1a;
  --post-muted: #737373;
  --ink: #111111;
  --fg: #111111;
  --fg-muted: #737373;
  --line: rgba(0, 0, 0, 0.12);
  --login-bg: #050505;
  --search-h: 44px;
  --topbar-pad: 16px;
  --block: 200px;
  --pad: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --font-post: "Outfit", system-ui, sans-serif;
  --radius-pill: 999px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper-out);
  color: var(--post-fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Login resta scuro (logo chiaro) */
.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--login-bg);
  z-index: 50;
  padding: 24px;
}

.login-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.login-logo {
  height: 100px;
  width: auto;
  display: block;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #8a8a86;
}

.compose-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-muted);
}

.login-form input,
.compose-form input,
.compose-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.login-form input:focus,
.compose-form input:focus,
.compose-form textarea:focus,
.search-input:focus {
  border-color: #111;
}

.login-form button,
.btn-primary {
  border: 0;
  border-radius: var(--radius-pill);
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
}

.login-error {
  margin: 0;
  color: #fb7185;
  font-size: 13px;
}

.map-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

/* My Wall: stesso giallo ovunque — tutto lo schermo e' area attiva */
.map-shell[data-wall-mode='mine'] {
  --paper: #fffdf5;
  --paper-out: #fffdf5;
}

.topbar {
  position: absolute;
  top: 0;
  left: 40px;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: var(--topbar-pad);
  padding-top: max(var(--topbar-pad), env(safe-area-inset-top));
  pointer-events: none;
}

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

/* Placeholder nella griglia topbar: il logo vero e' sibling della mappa (vedi .brand). */
.brand-spacer {
  width: 55px;
  height: 100px;
  flex-shrink: 0;
  pointer-events: none;
}

/*
 * Sagoma via mask SVG; colore nero/bianco da data-tone (JS campiona sotto).
 */
.brand {
  position: absolute;
  top: max(var(--topbar-pad), env(safe-area-inset-top));
  left: calc(40px + var(--topbar-pad));
  z-index: 21;
  display: block;
  line-height: 0;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
}

.brand-mark {
  height: 100px;
  width: 55px;
  display: block;
  pointer-events: none;
  user-select: none;
  background-color: #111;
  -webkit-mask-image: url('/img/logo-ww.svg?v=20260722f');
  mask-image: url('/img/logo-ww.svg?v=20260722f');
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  transition: background-color 0.12s ease;
}

/* Sotto scuro → wordmark bianco */
.brand[data-tone='dark'] .brand-mark {
  background-color: #fff;
}

.search-wrap {
  position: relative;
  justify-self: center;
  width: min(560px, 100%);
}

.search-input {
  width: 100%;
  height: var(--search-h);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  color: var(--post-fg);
  padding: 0 22px;
  font: inherit;
  font-size: 16px;
  outline: none;
  box-shadow: var(--shadow);
}

.search-input::placeholder {
  color: #8a8a86;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--post-fg);
  font: inherit;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.search-hit.is-empty {
  display: block;
  cursor: default;
}

.search-hit-thumb {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: block;
}

.search-hit-thumb.is-fallback {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  background: #f0f0ee;
}

.search-hit-thumb[src*='logo-ww'],
.search-hit-thumb[src*='poster_wanderwally'] {
  object-fit: cover;
  background: #fff;
}

.search-hit-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-hit-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-hit:hover,
.search-hit:focus {
  background: rgba(0, 0, 0, 0.05);
}

.search-hit small {
  display: block;
  color: var(--post-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-toggle {
  --toggle-w: 72px;
  --toggle-h: 40px;
  --toggle-pad: 3px;
  --toggle-knob: calc(var(--toggle-h) - var(--toggle-pad) * 2);
  position: relative;
  width: var(--toggle-w);
  height: var(--toggle-h);
  border: 0;
  border-radius: var(--radius-pill);
  background: #12b7a6;
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.22s ease;
}

.wall-toggle[data-mode='mine'] {
  background: #ef4d63;
}

.wall-toggle-knob {
  position: absolute;
  top: var(--toggle-pad);
  left: var(--toggle-pad);
  width: var(--toggle-knob);
  height: var(--toggle-knob);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.wall-toggle[data-mode='mine'] .wall-toggle-knob {
  transform: translateX(calc(var(--toggle-w) - var(--toggle-pad) * 2 - var(--toggle-knob)));
}

.wall-toggle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  font-size: 20px;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.18s ease;
}

.wall-toggle-icon-world {
  color: #12b7a6;
  opacity: 1;
}

.wall-toggle-icon-mine {
  color: #ef4d63;
  opacity: 0;
}

.wall-toggle[data-mode='mine'] .wall-toggle-icon-world {
  opacity: 0;
}

.wall-toggle[data-mode='mine'] .wall-toggle-icon-mine {
  opacity: 1;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  pointer-events: none;
}

/* Logo brand come avatar: intero, non croppato */
.avatar-photo[src*='logo-ww'] {
  object-fit: contain;
  background: #fff;
}

.detail-avatar.has-photo:has(.avatar-photo[src*='logo-ww']),
.post-avatar.has-photo:has(.avatar-photo[src*='logo-ww']) {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.avatar.has-photo,
.post-avatar.has-photo,
.detail-avatar.has-photo,
.poster-card-avatar.has-photo {
  color: transparent;
  font-size: 0;
}

.avatar.is-guest {
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  color: #1f1f1f;
  box-shadow: none;
}

.avatar.is-guest svg {
  display: block;
  width: 22px;
  height: 22px;
}

.login-screen.is-panel {
  background: transparent;
  z-index: 45;
  padding: 24px;
  place-items: center;
}

.login-screen.is-panel .login-card {
  width: min(360px, 100%);
  box-shadow: var(--shadow);
}

.share-btn,
.fav-spot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent !important;
  padding: 0;
  cursor: pointer;
  color: #111;
  border-radius: 0;
  box-shadow: none;
  opacity: 0.85;
}

.share-btn:hover,
.fav-spot:hover {
  opacity: 1;
}

.fav-spot.is-on {
  opacity: 1;
}

.post-block.is-text .share-btn,
.post-block.is-text .fav-spot {
  color: #111;
}

.post-block.is-visual .share-btn,
.post-block.is-visual .fav-spot {
  color: #111;
}

.post-block.is-visual .post-top[data-tone='dark'] .share-btn,
.post-block.is-visual .post-top[data-tone='dark'] .fav-spot {
  color: #fff;
}

.share-btn .share-icon,
.fav-spot .spot-icon {
  font-size: 16px;
  opacity: 1;
  line-height: 1;
  filter: none;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.fav-spot.is-on .spot-icon {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24 !important;
}

/* Preferito: stesso colore del bordo; is-on = riempito (FILL) */
.post-block.is-visual .post-top[data-tone='dark'] .fav-spot,
.post-block.is-visual .post-top[data-tone='dark'] .fav-spot .spot-icon {
  color: #fff;
}
.post-block.is-visual .post-top[data-tone='dark'] .fav-spot.is-on,
.post-block.is-visual .post-top[data-tone='dark'] .fav-spot.is-on .spot-icon {
  color: #fff;
}

.post-block.is-visual .post-top[data-tone='light'] .fav-spot,
.post-block.is-visual .post-top[data-tone='light'] .fav-spot .spot-icon,
.post-block.is-text .post-top .fav-spot,
.post-block.is-text .post-top .fav-spot .spot-icon {
  color: #111;
}
.post-block.is-visual .post-top[data-tone='light'] .fav-spot.is-on,
.post-block.is-visual .post-top[data-tone='light'] .fav-spot.is-on .spot-icon,
.post-block.is-text .post-top .fav-spot.is-on,
.post-block.is-text .post-top .fav-spot.is-on .spot-icon {
  color: #111;
}

/* Like (cuoricino): stessa logica dell'ancora, solo World Wall, a sinistra dell'ancora */
.fav-heart {
  display: inline-grid;
  place-items: center;
  width: auto;
  height: 18px;
  border: 0;
  background: transparent !important;
  padding: 0;
  cursor: pointer;
  color: #111;
  border-radius: 0;
  box-shadow: none;
  opacity: 0.85;
  gap: 3px;
  grid-auto-flow: column;
}

.fav-heart:hover {
  opacity: 1;
}

.fav-heart.is-on {
  opacity: 1;
}

.fav-heart .heart-icon {
  font-size: 16px;
  opacity: 1;
  line-height: 1;
  filter: none;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.fav-heart.is-on .heart-icon {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24 !important;
}

.fav-count {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  font-family: var(--font);
}

.post-block.is-text .fav-heart {
  color: #111;
}

.post-block.is-visual .fav-heart {
  color: #111;
}

.post-block.is-visual .post-top[data-tone='dark'] .fav-heart,
.post-block.is-visual .post-top[data-tone='dark'] .fav-heart .heart-icon {
  color: #fff;
}

.post-block.is-visual .post-top[data-tone='light'] .fav-heart,
.post-block.is-visual .post-top[data-tone='light'] .fav-heart .heart-icon,
.post-block.is-text .post-top .fav-heart,
.post-block.is-text .post-top .fav-heart .heart-icon {
  color: #111;
}

.post-type-badge {
  position: absolute;
  z-index: 4;
  left: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #fff;
}

.private-badge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.private-badge .material-symbols-outlined {
  font-size: 15px;
  line-height: 1;
}

.post-block.is-text .private-badge {
  color: #111;
}

.post-block.is-visual .private-badge {
  color: #fff;
}

.post-block.is-visual .post-top[data-tone='light'] .private-badge {
  color: #111;
}

.post-type-badge .material-symbols-outlined,
.post-type-badge .type-icon-svg {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: block;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.post-type-badge[data-tone='dark'] {
  color: #fff;
}

.post-type-badge[data-tone='light'] {
  color: #111;
}

.post-type-badge[data-tone='light'] .material-symbols-outlined,
.post-type-badge[data-tone='light'] .type-icon-svg {
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5));
}

.edge-rail {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: max(14px, env(safe-area-inset-top));
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  backdrop-filter: none;
  pointer-events: none;
  z-index: 2;
}

.rail-tab {
  pointer-events: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #1f1f1f;
  display: grid;
  place-items: center;
  cursor: inherit;
  padding: 0;
  box-shadow: none;
}

.rail-tab:hover,
.rail-tab:active,
.rail-tab:focus {
  background: transparent !important;
  outline: none;
}

/* Desktop: icona sidebar; mobile (sotto) scambia con chevron */
.rail-tab .rail-icon-desktop {
  display: block;
}

.rail-tab .rail-icon-open,
.rail-tab .rail-icon-close {
  display: none;
}

.map-shell.is-wall-switching {
  pointer-events: none;
}

.topbar {
  left: 40px;
  right: 0;
}

.sheet.sheet-rail {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: min(480px, 58vw);
  max-height: none;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  z-index: 45;
  box-shadow: none;
  display: flex;
  flex-direction: row;
  background: #fff;
  transform: translateX(calc(-100% + 40px));
  /* transition solo dopo .rail-anim (niente chiusura animata al load) */
  transition: none;
  pointer-events: none;
}

.sheet.sheet-rail .sheet-body {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow: auto;
  padding: 24px 22px 36px;
  gap: 22px;
  pointer-events: auto;
  opacity: 0;
  transition: none;
}

.app.rail-anim .sheet.sheet-rail {
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.app.rail-anim .sheet.sheet-rail .sheet-body {
  transition: opacity 0.2s ease;
}

.sheet.sheet-rail .edge-rail {
  pointer-events: auto;
  cursor: pointer;
}

.sheet.sheet-rail .rail-tab {
  pointer-events: none;
}

.app.rail-open .sheet.sheet-rail {
  transform: translateX(0);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
}

.app.rail-open .sheet.sheet-rail .sheet-body {
  opacity: 1;
}

.sheet.sheet-rail .rail-handle {
  display: none;
}

.poster-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.poster-card-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0;
  min-height: 88px;
  cursor: pointer;
  align-items: stretch;
}

.poster-card-media {
  width: 88px;
  min-height: 88px;
  align-self: stretch;
  overflow: hidden;
  background: #f3f3f1;
}

.poster-card-main {
  display: none;
}

.poster-thumb {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 88px;
  overflow: hidden;
  background: #f3f3f1;
  display: grid;
  place-items: center;
  position: relative;
}

.poster-thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.poster-thumb-badge,
.poster-thumb-text {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.poster-thumb-text {
  font-size: 22px;
  color: #111;
  text-transform: none;
  letter-spacing: 0;
}

.poster-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  cursor: pointer;
  justify-content: center;
}

.poster-card-title {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
}

.poster-when {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #888;
}

.poster-snip {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
  white-space: pre-wrap;
  word-break: break-word;
}

.poster-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.poster-card-meta small {
  color: #888;
  font-size: 11px;
}

.btn-link {
  border: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.poster-expand {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.poster-expand.is-hidden {
  display: none;
}

.poster-full {
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #222;
}

.poster-expand-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f3f1;
  margin-bottom: 8px;
}

.poster-actions {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.poster-row {
  display: none;
}

.btn-tiny {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  color: #111;
}

.btn-danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  margin-top: 8px;
  width: 100%;
}

.rail-edit {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-edit.is-hidden {
  display: none;
}

.rail-guest h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

/* Tavolo: grigio chiarissimo, solo reticolo (niente puntini) */
.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-color: var(--paper-out);
  z-index: 1;
}

.map-viewport.is-blinking {
  transition: filter 45ms ease, opacity 45ms ease;
}

.map-viewport.is-blink-dark {
  filter: brightness(0);
  opacity: 0.12;
}

.map-viewport.is-panning {
  cursor: grabbing;
}

.map-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.map-board {
  position: absolute;
  background-color: var(--paper);
  box-shadow: none;
}

.map-block-grid,
.map-section-grid {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.map-block-grid {
  z-index: 1;
  background-image:
    linear-gradient(var(--block-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--block-line) 1px, transparent 1px);
  background-size: var(--block) var(--block);
}

.map-section-grid {
  background-image:
    linear-gradient(var(--section-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--section-line) 1px, transparent 1px);
  background-size: 20000px 20000px;
}

/* Crea / trascina: reticolo su tutta la board (segue la camera). */
.map-viewport.is-placing .map-block-grid {
  opacity: 1;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.16) 1px, transparent 1px);
}

.map-hover {
  position: absolute;
  width: var(--block);
  height: var(--block);
  background: transparent;
  border: 1px solid #f5e6a3;
  box-shadow: none;
  pointer-events: none;
  z-index: 2;
  display: none;
}

.map-viewport.is-placing .map-hover:not(.is-hidden) {
  display: block;
}

.map-hover.is-hidden {
  display: none !important;
}

.map-pick {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  pointer-events: none;
}

.map-posts {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  -webkit-user-select: none;
  user-select: none;
}

.map-posts img,
.map-posts a,
.post-block,
.post-block * {
  -webkit-user-drag: none;
  user-select: none;
}

.post-block {
  position: absolute;
  width: var(--block);
  height: var(--block);
  border: 1px solid var(--post-border);
  background: var(--post-bg);
  color: var(--post-fg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
}

/* My Wall: pressione prolungata "solleva" il poster prima di poterlo spostare */
.post-block.is-lifted {
  transform: scale(1.05);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  z-index: 5;
  cursor: grabbing;
}

.post-block.is-moving-source {
  opacity: 0;
  pointer-events: none;
}

#map-move-ghost.is-move-ghost,
.post-block.is-move-ghost {
  opacity: 0.72;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  transition: left 0.08s linear, top 0.08s linear;
}

.post-block.is-text {
  padding: 26px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.post-block .post-title {
  margin: 0;
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
  color: #111;
}

.post-block .post-body {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  font-family: var(--font);
  font-size: 7px;
  font-weight: 400;
  color: #444;
  line-height: 1.3;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-wrap;
}

.post-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 14px;
  padding-top: 0;
  border-top: 0;
}

.post-when {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font);
  font-size: 6px;
  font-weight: 400;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-block.is-visual {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.post-block.is-visual .post-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.post-block.is-visual .post-media .media-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

.post-block.is-visual.is-link .post-media {
  background: #eceae6;
}

.post-block.is-visual .post-media .media-ig-cover {
  background: linear-gradient(145deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%);
}

.poster-thumb.media-ig-cover {
  background: linear-gradient(145deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%);
}

.poster-thumb.media-ig-cover .media-ig-fallback .ig-mark {
  font-size: 22px;
  color: #fff;
}

.post-block.is-visual .post-media .media-ig-cover > img.media-img {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.media-ig-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 8px;
  pointer-events: none;
}

.media-ig-fallback .ig-mark {
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
  opacity: 0.95;
}

.media-ig-fallback .ig-mark svg {
  display: block;
}

.link-card.is-instagram {
  border-color: rgba(221, 42, 123, 0.18);
}

.link-card-media-ig {
  min-height: 160px;
  background: linear-gradient(145deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%);
  display: grid;
  place-items: center;
}

.link-card-media-ig .media-ig-fallback {
  font-size: 14px;
}

.link-card-media-ig .media-ig-fallback .ig-mark {
  font-size: 36px;
}

.post-block.is-visual.is-link .post-media .media-img,
.post-block.is-visual.is-link .post-media .media-img-cover,
.post-block.is-visual.is-link .post-media .media-link-cover img,
.post-block.is-visual .post-media .media-link-cover .media-img {
  object-fit: cover !important;
}

.post-block.is-visual .post-media .media-player-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #111;
  overflow: hidden;
}

.post-block.is-visual .post-media .media-player-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.post-block.is-visual .post-media .media-badge {
  width: min(100%, 140px);
  height: min(100%, 88px);
  display: grid;
  place-items: center;
  color: #555;
  background: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 8px;
}

.post-top {
  position: absolute;
  left: 4px;
  right: auto;
  top: 4px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding: 0;
  width: calc(100% - 8px);
  box-sizing: border-box;
  pointer-events: none;
}

.post-block.is-text .post-top {
  position: absolute;
  left: 4px;
  top: 4px;
  width: calc(100% - 8px);
  padding: 0;
  background: none;
  justify-content: space-between;
}

.post-block.is-visual .post-top {
  background: none;
  left: 4px;
  top: 4px;
  right: auto;
  width: calc(100% - 8px);
  box-sizing: border-box;
}

.post-block.is-visual .post-top[data-tone='dark'] .share-btn,
.post-block.is-visual .post-top[data-tone='dark'] .share-icon {
  color: #fff;
}

.post-block.is-visual .post-top[data-tone='light'] .share-btn,
.post-block.is-visual .post-top[data-tone='light'] .share-icon {
  color: #111;
}

.post-block.is-text .post-top[data-tone='light'] .share-btn,
.post-block.is-text .post-top[data-tone='light'] .share-icon {
  color: #111;
}

.post-meta-left {
  display: none;
}

.post-author {
  display: none;
}

.post-block.is-visual .post-author,
.post-block.is-visual .post-when {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.post-top-left,
.post-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  pointer-events: auto;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 30px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.map-pick-cell {
  position: absolute;
  width: var(--block);
  height: var(--block);
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid #f5e6a3;
}

.map-pick-cell.is-move-target {
  border-color: #7dd3fc;
  background: rgba(125, 211, 252, 0.12);
}

.map-coords {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}

.map-coord-label {
  position: absolute;
  width: auto;
  height: auto;
  box-sizing: border-box;
  display: inline-block;
  padding: 4px 6px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.28);
  border: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.icon-btn .spot-icon {
  font-size: 18px;
  opacity: 0.45;
}

.post-menu-wrap {
  position: relative;
}

.menu-dots {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

.post-block.is-visual .menu-dots {
  background: transparent;
  color: #fff;
  filter: none;
}

.post-block.is-text .menu-dots {
  color: #111;
  filter: none;
}

.post-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 148px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  padding: 4px;
  z-index: 80;
}

.post-menu.open {
  display: block;
}

.post-menu.is-fixed {
  position: fixed;
  margin-top: 0;
  z-index: 60;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
  color: #111;
  cursor: pointer;
}

.menu-item:hover {
  background: #f3f3f1;
}

.menu-item .spot-icon {
  flex: 0 0 auto;
  opacity: 0.4;
}

.menu-item.is-on .spot-icon,
.icon-btn.is-on .spot-icon {
  opacity: 1;
  color: #0a7a4b;
}

.menu-item .fav-count {
  margin-left: auto;
  color: #888;
  font-size: 10px;
}

.menu-info {
  padding: 8px 10px 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: #666;
}

.menu-info strong {
  color: #111;
  font-size: 11px;
  font-weight: 600;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: none;
  overflow: visible;
}

.poster-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
}

.poster-card-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 7px;
  font-weight: 600;
  color: #fff;
  background: #111;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.poster-card-type {
  left: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  color: #fff;
  z-index: 2;
}

.poster-card-type .material-symbols-outlined,
.poster-card-type .type-icon-svg {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.detail-media-wrap {
  position: relative;
  margin: 0 0 12px;
}

.detail-media-wrap .detail-media {
  margin: 0;
}

.detail-when-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 18px;
}

.detail-when-row .detail-when {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.post-type-badge.detail-type-badge,
.detail-type-badge {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: #111 !important;
  background: transparent !important;
  border-radius: 0;
  filter: none !important;
  pointer-events: none;
  z-index: auto;
}

.post-type-badge.detail-type-badge .material-symbols-outlined,
.post-type-badge.detail-type-badge .type-icon-svg,
.detail-type-badge .material-symbols-outlined,
.detail-type-badge .type-icon-svg {
  filter: none !important;
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: #111 !important;
}

.detail-type-badge .type-icon-svg path {
  fill: currentColor;
}

.poster-card-author-name {
  font-size: 12px;
  color: #666;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #111;
}

.icon-btn .spot-icon {
  opacity: 0.4;
}

.post-block.is-text {
  padding: 26px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-block.is-text .post-copy {
  flex: 1;
}

.post-overlay {
  display: none;
}

.post-foot {
  display: none;
}

.post-block.is-visual .post-when {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.post-block.is-visual .post-avatar {
  width: 16px;
  height: 16px;
  font-size: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.post-media {
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f1;
}

.post-block.is-text .post-media {
  flex: 0 0 36px;
  max-height: 36px;
}

.post-media .media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.post-block.is-visual .post-media .media-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center;
}

.post-media .media-badge {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}

.post-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.post-more {
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 500;
  color: #111;
}

.post-more.is-hidden {
  display: none;
}

.post-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  padding-top: 0;
  border-top: 0;
}

.post-when {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font);
  font-size: 7px;
  font-weight: 400;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.like-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 500;
  color: #333;
  line-height: 1;
}

.like-btn .like-icon {
  width: 10px;
  height: 10px;
  display: block;
  flex-shrink: 0;
  color: #111;
  opacity: 0.35;
}

.like-btn.is-liked .like-icon {
  opacity: 1;
}

.like-btn.is-liked {
  color: #111;
}

.like-btn.is-liked .like-icon {
  color: #111;
}

.like-btn.is-liked .like-icon path {
  fill: #111;
}

.media-badge-spotify {
  background: #1db954 !important;
  color: #fff !important;
}

.media-badge-sc {
  background: #ff5500 !important;
  color: #fff !important;
}

.media-badge-video {
  background: #222 !important;
  color: #eee !important;
}

.media-badge-audio {
  background: #333 !important;
  color: #eee !important;
}

.sheet.sheet-detail {
  /* piu grande: vedi contenuto intero */
}

@media (min-width: 768px) {
  .sheet.sheet-detail {
    top: 72px;
    right: 16px;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 88px);
  }
}

.detail-media {
  width: 100%;
}

.detail-media .media-img-full {
  width: 100%;
  height: auto;
  max-height: min(72vh, 820px);
  object-fit: contain;
  object-position: center;
  background: #111;
  border-radius: 12px;
}

.detail-media .media-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.detail-media .media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-media .media-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}

.detail-body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: #222;
  white-space: pre-wrap;
  overflow: auto;
  max-height: none;
}

.text-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  word-break: break-word;
}

.text-link-external {
  color: #111;
}

.text-link-internal {
  color: #111;
}

.post-block .post-avatar {
  position: static;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font);
  font-size: 6px;
  font-weight: 600;
  color: #fff;
  background: #111;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.35;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-head .avatar {
  cursor: pointer;
}

.detail-author {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.detail-title {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
}

.detail-body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: #222;
  white-space: pre-wrap;
  overflow: visible;
  max-height: none;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-actions .like-btn {
  font-size: 13px;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

.detail-actions .like-btn .like-icon {
  width: 14px;
  height: 14px;
}

.share-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.share-label {
  font-size: 11px;
  color: var(--fg-muted);
}

.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-row code {
  flex: 1;
  font-size: 12px;
  background: #f3f3f1;
  padding: 8px 10px;
  border-radius: 8px;
  word-break: break-all;
}

.share-input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 11px;
  background: #fafafa;
  color: #111;
}

.btn-tiny {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.detail-media {
  width: 100%;
  min-height: 0;
}

.detail-media .media-img {
  width: 100%;
  height: auto;
  max-height: min(72vh, 820px);
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: #111;
}

.detail-media .media-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.detail-media .media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-media .media-video {
  width: 100%;
  max-height: 240px;
  border-radius: 8px;
  background: #111;
}

.detail-media .media-audio {
  width: 100%;
}

.detail-media .media-link {
  color: #111;
  font-size: 13px;
}

.zoom-hint {
  position: absolute;
  left: 60px;
  bottom: 20px;
  z-index: 15;
  font-size: 12px;
  color: #6b6b66;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
  border-radius: 8px;
}

.place-fab {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  padding: 0;
}

.place-fab:hover {
  background: #000;
}

.place-fab.is-on {
  background: #111;
  color: #fff;
}

.place-fab .fab-icon {
  display: block;
}

.place-fab .fab-icon.is-hidden {
  display: none !important;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  z-index: 25;
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 48;
}

.sheet {
  position: fixed;
  z-index: 40;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
  margin: 10px auto 0;
}

.sheet-body {
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-body h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111;
}

.muted {
  color: var(--fg-muted);
  margin: 0;
  font-size: 13px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.profile-head h2 {
  font-size: 18px;
}

.rail-handle {
  position: absolute;
  top: 50%;
  right: -30px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: none;
  place-items: center;
  z-index: 2;
  color: #111;
}

.rail-handle .material-symbols-outlined {
  font-size: 18px;
}

.profile-section-title {
  margin: 4px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
}

.section-head-row .profile-section-title {
  margin: 0;
}

.sort-select-wrap {
  flex: 0 0 auto;
}

.sort-select {
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.account-panel .detail-nav {
  margin-bottom: 12px;
}

.profile-head.is-hidden {
  display: none;
}

.profile-posters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: none;
  overflow: visible;
}

.profile-posters .search-hit {
  border-radius: 10px;
}

.profile-posters .search-hit small {
  display: block;
  color: #888;
  font-size: 11px;
  margin-top: 2px;
}

.post-avatar {
  cursor: pointer;
}

.btn-ghost {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: transparent;
  color: #111;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.compose-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-pick {
  border: 0;
  margin: 0;
  padding: 0;
}

.type-pick legend {
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 8px;
  padding: 0;
}

.type-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  background: #f3f3f1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  user-select: none;
}

.type-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-chip:has(input:checked) {
  background: #111;
  color: #fff;
  border-color: #111;
}

.compose-form label {
  color: var(--fg-muted);
}

.compose-form label em {
  font-style: normal;
  color: #999;
  font-weight: 400;
}

.compose-private-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px 0;
}

.compose-private-toggle input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: #111;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.compose-preview {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: #f7f7f5;
  min-height: 72px;
}

.link-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.link-card-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  object-position: center;
  background: #f3f3f1;
}

.link-card.is-instagram .link-card-img {
  max-height: min(52vh, 480px);
  object-fit: cover;
  background: #111;
}

.link-card-media {
  width: 100%;
  background: transparent;
  line-height: 0;
}

.link-card-img-fallback {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
}

.link-card-title {
  font-size: 14px;
  line-height: 1.3;
  color: #111;
}

.link-card-host {
  font-size: 12px;
  color: #888;
}

.link-card-desc {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
}

.link-card-open {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-block.is-visual .post-media .media-link-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
}

.post-block.is-visual .post-media .media-link-cover .media-img,
.post-block.is-visual .post-media .media-link-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.detail-media .link-card {
  border-radius: 12px;
}

.compose-preview .media-player-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 220px;
  background: #111;
}

.compose-preview .media-player-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


.post-block.is-visual .post-media .media-spotify-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #121212;
  text-decoration: none;
  overflow: hidden;
}

.post-block.is-visual .post-media .media-spotify-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-block.is-visual .post-media .media-spotify-cover .media-spotify-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #1db954;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.compose-preview .media-spotify-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 220px;
  background: #121212;
  overflow: hidden;
}

.compose-preview .media-spotify-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.compose-browse-label {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
}

.rail-auth,
.rail-detail,
.rail-user {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-resend-row {
  margin: 12px 0 0;
  font-size: 13px;
}

.auth-resend-row .btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
}

.auth-verify-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.auth-verify-panel.is-hidden,
.compose-form.is-hidden {
  display: none !important;
}

.auth-google-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.auth-google-wrap.is-hidden {
  display: none !important;
}

.auth-or {
  margin: 0;
  text-align: center;
  font-size: 13px;
}

.btn-google {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.btn-google:hover {
  background: #f7f7f5;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.is-on {
  color: #111;
  border-bottom-color: #111;
}

.auth-panel h2 {
  margin: 8px 0 0;
}

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

.auth-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.register-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8e8e4 center / cover no-repeat;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  color: #888;
  flex: 0 0 auto;
  overflow: hidden;
}

.register-avatar-preview.has-photo,
.register-avatar-preview:has(.avatar-photo) {
  color: transparent;
  background-size: cover;
}

.register-avatar-preview .avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-when {
  margin: 0;
  font-size: 12px;
  color: #888;
}

.detail-when.is-hidden {
  display: none;
}

.detail-nav {
  margin-bottom: 1rem;
}

.rail-back {
  font-size: 13px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}

.detail-head-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-meta-row #detail-meta {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.detail-owner-menu {
  position: relative;
  flex: 0 0 auto;
}

.detail-dots {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.detail-dots:hover {
  background: rgba(0, 0, 0, 0.06);
}

.detail-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 132px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 4px;
  z-index: 5;
}

.detail-menu .menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: #111;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-menu .menu-item .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.7;
}

.detail-menu .menu-item.is-on .material-symbols-outlined,
.detail-menu .menu-item.is-on .spot-icon {
  opacity: 1;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.detail-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.detail-menu .menu-item:hover {
  background: #f3f3f1;
}

.detail-menu .menu-item.is-danger {
  color: #b91c1c;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.confirm-modal:not(.hidden) {
  pointer-events: auto;
}

.confirm-modal.hidden {
  display: none;
}

.confirm-modal-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(17, 17, 17, 0.42);
  cursor: pointer;
}

.confirm-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: confirm-in 160ms ease-out;
}

@keyframes confirm-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-modal-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.confirm-modal-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #666;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn-confirm-danger {
  border: 0;
  border-radius: var(--radius-pill);
  background: #b91c1c;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

.btn-confirm-danger:hover {
  background: #991b1b;
}

.btn-confirm-danger:disabled,
.confirm-modal-actions .btn-ghost:disabled {
  opacity: 0.55;
  cursor: default;
}

.detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #111;
  padding: 0;
}

.detail-icon-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

.icon-action {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.55;
}

.icon-action:hover,
.icon-action.is-on {
  opacity: 1;
}

.detail-icon-actions .fav-spot.is-on,
.detail-icon-actions .fav-spot.is-on .spot-icon {
  color: #111;
  opacity: 1;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24 !important;
}

.icon-action .material-symbols-outlined {
  font-size: 18px;
}

.detail-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #222;
  white-space: pre-wrap;
  padding: 1rem 4px 8px;
}

.detail-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 12px;
  margin-top: 3rem;
  margin-right: 12px;
}

.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #b0b0b0;
  opacity: 1;
}

.detail-stat:hover,
.detail-stat.is-on {
  color: #b0b0b0;
  opacity: 1;
}

.detail-stat .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.detail-stat-count {
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 0.75em;
  color: #b0b0b0;
}

.detail-media {
  width: 100%;
  min-height: 0;
}

.detail-media:has(.link-card) {
  min-height: 0;
}

.detail-media.is-hidden {
  display: none !important;
  min-height: 0;
}

.detail-media .media-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.detail-media .media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-media .media-img-full,
.detail-media .media-img {
  width: 100%;
  height: auto;
  max-height: min(72vh, 820px);
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: #111;
}

.detail-media .spotify-player {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #121212;
  min-height: 152px;
}

.detail-media .spotify-player iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 152px;
}

.detail-media .media-player-card {
  position: relative;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.detail-media .media-player-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.spotify-player .field-hint {
  padding: 8px 10px 10px;
  margin: 0;
  color: #aaa;
  background: #121212;
  font-size: 11px;
}

.detail-more-wrap {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poster-card-main {
  display: none;
}

.detail-media .media-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.detail-media .media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-media .media-img-full,
.detail-media .media-img {
  width: 100%;
  height: auto;
  max-height: min(72vh, 820px);
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: #111;
}

.spotify-player {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #121212;
}

.spotify-player iframe {
  display: block;
  width: 100%;
  border: 0;
}

.spotify-player .field-hint {
  padding: 8px 10px 10px;
  margin: 0;
  color: #aaa;
  background: #121212;
}

.detail-more-wrap {
  margin-top: 1rem;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.rail-back {
  align-self: flex-start;
}

.compose-browse-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.compose-browse-row .field-hint {
  margin: 0;
}

.compose-preview img,
.compose-preview .media-img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #111;
}

.compose-preview .media-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
}

.compose-preview .media-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.compose-preview .media-embed iframe {
  display: block;
  width: 100%;
  border: 0;
}

.compose-preview .media-link {
  display: block;
  padding: 12px;
  font-size: 13px;
  color: #111;
}

.sheet:not(.sheet-rail) {
  top: 72px;
  right: 56px;
  width: min(560px, calc(100vw - 72px));
  max-height: calc(100vh - 96px);
  border-radius: 20px;
  overflow: auto;
  z-index: 50;
}

@media (min-width: 768px) {
  .sheet:not(.sheet-rail) {
    top: 72px;
    right: 56px;
    width: min(560px, calc(100vw - 72px));
    max-height: calc(100vh - 96px);
    border-radius: 20px;
    overflow: auto;
  }

  .sheet.sheet-rail {
    left: 0;
    width: min(480px, 58vw);
  }
}

@media (max-width: 767px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand search toggle";
    align-items: normal;
    gap: 10px;
  }

  .brand-spacer {
    grid-area: brand;
  }

  .brand {
    left: var(--topbar-pad);
  }

  .brand-mark {
    height: 100px;
    width: 55px;
  }

  .wall-toggle {
    grid-area: toggle;
    justify-self: end;
    --toggle-w: 56px;
    --toggle-h: 32px;
  }

  .wall-toggle-icon {
    font-size: 25px;
  }

  .search-wrap {
    grid-area: search;
    height: 32px;
    display: flex;
    align-items: center;
    width: 100%;
    justify-self: stretch;
  }

  .search-input {
    height: 32px;
    padding: 0 16px;
    font-size: 14px;
  }

  .sheet:not(.sheet-rail) {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: min(78vh, 560px);
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    width: auto;
  }

  .sheet.sheet-rail {
    left: 0;
    width: min(480px, calc(100vw - 8px));
  }

  .sheet.sheet-rail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: min(85vh, 640px);
    max-height: min(85vh, 640px);
    flex-direction: column-reverse;
    transform: translateY(calc(100% - 44px));
    border-radius: 16px 16px 0 0;
  }

  .app.rail-open .sheet.sheet-rail {
    transform: translateY(0);
  }

  .sheet.sheet-rail.is-dragging {
    transition: none !important;
  }

  .sheet.sheet-rail .edge-rail {
    flex: 0 0 44px;
    width: 100%;
    border-left: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    justify-content: center;
    padding-top: 10px;
    background: #fff;
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
  }

  .sheet.sheet-rail .edge-rail:active {
    cursor: grabbing;
  }

  .sheet.sheet-rail .rail-tab {
    width: 40px;
    height: 32px;
  }

  .rail-tab .rail-icon-desktop {
    display: none;
  }

  .rail-tab .rail-icon-open {
    display: block;
  }

  .rail-tab .rail-icon-close {
    display: none;
  }

  .app.rail-open .rail-tab .rail-icon-open {
    display: none;
  }

  .app.rail-open .rail-tab .rail-icon-close {
    display: block;
  }

  .map-shell {
    padding-left: 0;
  }

  .topbar {
    left: 0;
  }

  .sheet:not(.sheet-rail) .sheet-handle {
    display: block;
  }

  .place-fab {
    width: 68px;
    height: 68px;
    /* sopra la peek della rail chiusa (~44px) + margine */
    bottom: calc(44px + 18px + env(safe-area-inset-bottom, 0px));
    right: 18px;
  }

  .place-fab .fab-icon {
    width: 30px;
    height: 30px;
  }

  .toast {
    bottom: calc(44px + 96px + env(safe-area-inset-bottom, 0px));
  }
}

/* World Wall: poster origine (0,0) — paint istantaneo via CSS, niente flash img */
.post-block.is-origin {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 3;
}

.post-block.is-origin .origin-media {
  position: absolute;
  inset: 0;
  background: #fff url('/img/poster_wanderwally.jpg') center / cover no-repeat;
  pointer-events: none;
}

.origin-face {
  position: absolute;
  inset: 0;
  border: 0;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  pointer-events: none;
}

.origin-face img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

.origin-detail-logo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0;
  overflow: hidden;
}

.origin-detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
