/* ═══════════════════════════════════════════════════════════
  MURAL COLECTIVO NEXT v3.12.1 — Estilos Cyberpunk Minimalista
   ═══════════════════════════════════════════════════════════ */

#mural-colectivo-root {
  /* Paleta dark unificada */
  --mc-bg: #050505;
  --mc-paper: #2E2E2E;
  --mc-border: #2A2A2E;
  --mc-ink: #E0E0E0;
  --mc-primary: #C4161C;
  --mc-accent: #E9204F;
  --mc-accent-light: #E7C54B;
  --mc-warning: #E7C54B;
  --mc-success: #E9204F;
  --mc-shadow-color: #3C3C3F;
  --mc-primary-shadow: #A11217;
  --mc-accent-shadow: #9D8015;
  --mc-muted: #9A9A9A;
  --mc-smoke: #3C3C3F;
  --mc-hand-font: "Comic Sans MS", "Bradley Hand", cursive;
  --mc-radius: 4px;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--mc-border);
  background: var(--mc-bg);
  color: var(--mc-ink);
}

#mural-colectivo-root:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

#mural-colectivo-root:fullscreen #mural-stage-wrap {
  border-radius: 0;
}

/* ── TOOLBAR ─────────────────────────────────────────────── */
#mural-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--mc-paper);
  border-bottom: 1px solid var(--mc-border);
  gap: 10px;
  position: relative;
  z-index: 10;
}

.mural-tb-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.mural-tb-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex: 1;
  min-width: 320px;
}

.mural-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.mural-toolbar-row-main {
  justify-content: flex-end;
  padding: 4px;
  border: 1px solid var(--mc-border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--mc-bg) 64%, transparent);
}

.mural-toolbar-row-filters {
  padding: 7px;
  border: 1px solid var(--mc-border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--mc-bg) 70%, transparent);
}

#mural-filters-wrap.is-collapsed {
  display: none;
}

.mural-tb-title {
  font-size: 14px;
  color: var(--mc-primary);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mural-tb-sub {
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.6;
}

.mural-btn {
  font-family: inherit;
  font-size: 10px;
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid var(--mc-border);
  background: var(--mc-paper);
  color: var(--mc-ink);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  font-weight: 500;
}

.mural-btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mural-btn-icon-only {
  width: 27px;
  height: 27px;
  padding: 0;
  justify-content: center;
}

.mural-btn-icon-only .mural-btn-glyph {
  width: 15px;
  height: 15px;
}

.mural-btn-icon-only .mural-btn-glyph svg {
  width: 15px;
  height: 15px;
}

.mural-btn-toggle {
  position: relative;
}

.mural-btn-glyph {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.mural-btn-glyph svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mural-btn.is-active {
  border-color: color-mix(in srgb, var(--mc-accent) 62%, var(--mc-border));
  background: color-mix(in srgb, var(--mc-bg) 64%, var(--mc-paper));
  box-shadow:
    inset 0 1px 2px color-mix(in srgb, #000 30%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--mc-accent) 25%, transparent);
  transform: translateY(1px);
}

.mural-btn:hover {
  background: var(--mc-border);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-primary) 30%, transparent);
}

.mural-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none !important;
}

.mural-btn-primary {
  background: var(--mc-primary) !important;
  border-color: var(--mc-primary) !important;
  color: var(--mc-ink) !important;
  font-weight: 600;
}

.mural-btn-primary:hover {
  box-shadow: 0 0 16px var(--mc-primary-shadow) !important;
  transform: translateY(-1px);
}

.mural-btn-accent {
  background: var(--mc-accent) !important;
  border-color: var(--mc-accent) !important;
  color: var(--mc-ink) !important;
  font-weight: 600;
}

.mural-btn-accent:hover {
  box-shadow: 0 0 16px var(--mc-accent-shadow) !important;
  transform: translateY(-1px);
}

.mural-filter-input {
  font-family: inherit;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid var(--mc-border);
  background: var(--mc-bg);
  color: var(--mc-ink);
  min-width: 170px;
  height: 31px;
  flex: 1 1 170px;
}

.mural-filter-input:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-primary-shadow) 28%, transparent);
}

.mural-filter-input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ── Canvas overlay controls ────────────────────────────────── */

/* Zoom bar: centrado abajo dentro del lienzo */
.mural-canvas-zoom-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2px;
  background: color-mix(in srgb, var(--mc-paper) 92%, transparent);
  border: 1px solid var(--mc-border);
  border-radius: 6px;
  padding: 3px 4px;
  backdrop-filter: blur(8px);
  box-shadow:
    0 4px 16px color-mix(in srgb, #000 40%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mc-border) 60%, transparent);
  pointer-events: auto;
  user-select: none;
}

.mural-zoom-btn {
  background: none;
  border: none;
  color: var(--mc-ink);
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.mural-zoom-btn svg {
  display: block;
}

.mural-zoom-btn:hover {
  background: color-mix(in srgb, var(--mc-primary) 18%, transparent);
  color: var(--mc-primary);
}

.mural-zoom-btn:focus-visible {
  outline: 2px solid var(--mc-primary);
  outline-offset: 1px;
}

.mural-zoom-reset {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: .03em;
  width: auto;
  padding: 0 8px;
}

#mural-zoom-label {
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.75;
  min-width: 38px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: .04em;
}

/* Readonly button: abajo a la izquierda */
.mural-canvas-readonly-btn {
  position: absolute;
  bottom: 18px;
  left: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--mc-border);
  background: color-mix(in srgb, var(--mc-paper) 92%, transparent);
  backdrop-filter: blur(8px);
  color: var(--mc-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  user-select: none;
  box-shadow: 0 4px 16px color-mix(in srgb, #000 40%, transparent);
}

.mural-canvas-readonly-label {
  white-space: nowrap;
}

.mural-canvas-readonly-btn:hover {
  border-color: var(--mc-primary);
  color: var(--mc-ink);
}

.mural-canvas-readonly-btn.is-active {
  border-color: var(--mc-accent-light);
  color: var(--mc-accent-light);
  background: color-mix(in srgb, var(--mc-accent-light) 10%, var(--mc-paper));
  box-shadow:
    0 4px 16px color-mix(in srgb, #000 40%, transparent),
    0 0 12px color-mix(in srgb, var(--mc-accent-light) 25%, transparent);
}

/* Canvas action buttons: abajo a la derecha */
.mural-canvas-actions {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
}

.mural-canvas-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 4px 18px color-mix(in srgb, #000 50%, transparent),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
}

.mural-canvas-action-foto {
  background: var(--mc-primary);
  color: var(--mc-ink);
}

.mural-canvas-action-foto:hover {
  background: color-mix(in srgb, var(--mc-primary) 85%, #fff);
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--mc-primary) 55%, transparent),
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
}

.mural-canvas-action-firma {
  background: color-mix(in srgb, var(--mc-paper) 95%, transparent);
  border: 1px solid var(--mc-border);
  color: var(--mc-accent);
  backdrop-filter: blur(8px);
  box-shadow:
    0 4px 18px color-mix(in srgb, #000 50%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mc-accent) 30%, transparent) inset;
}

.mural-canvas-action-firma:hover {
  border-color: var(--mc-accent);
  color: var(--mc-ink);
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--mc-accent) 35%, transparent),
    0 0 0 1px var(--mc-accent) inset;
}

.mural-canvas-action-btn:focus-visible {
  outline: 2px solid var(--mc-accent-light);
  outline-offset: 2px;
}

/* ── STAGE ───────────────────────────────────────────────── */
#mural-stage-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  background-color: var(--mc-bg);
  background-image: none;
  background-size: auto;
  user-select: none;
}

#mural-stage-wrap.dragging {
  cursor: grabbing;
}

#mural-stage-wrap.dragging-item {
  cursor: default;
}

#mural-stage-wrap.has-bg-image {
  background-image: none;
}

#mural-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(0px, 0px) scale(1);
  transform-origin: 0 0;
  background-color: color-mix(in srgb, var(--mc-bg) 88%, #000 12%);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--mc-border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--mc-border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--mc-shadow-color) 45%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--mc-shadow-color) 45%, transparent) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px, 14px 14px, 14px 14px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  image-rendering: auto;
}

#mural-stage-wrap.has-bg-image #mural-stage {
  background-image: none;
  background-color: transparent;
}

#mural-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--mc-accent-light);
  font-style: italic;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

.mural-corner-hint {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.4;
  pointer-events: none;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════
   POLAROID — componente refactorizado
   Arquitectura limpia: .pol-scene > .pol-flipper > .pol-face
   ══════════════════════════════════════════════════════════════ */

/* ── Wrapper posicionado en el stage ────────────────────────── */
.mural-foto-card {
  position: absolute;
  cursor: pointer;
  /* Sin perspective aquí — la escena 3D la maneja .pol-scene */
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* ── Estados de arrastre / edición ──────────────────────────── */
.mural-item-draggable {
  cursor: default !important;
}

.mural-edit-mode .mural-item-draggable {
  cursor: grab !important;
}

.mural-edit-mode .mural-item-draggable:active {
  cursor: grabbing !important;
}

.mural-readonly-mode .mural-foto-card,
.mural-readonly-mode .mural-firma-card {
  pointer-events: none !important;
}

.mural-readonly-mode #mural-stage {
  pointer-events: none;
}

.mural-canvas-readonly-btn.is-active .mural-ro-pan-on {
  display: none;
}

.mural-canvas-readonly-btn:not(.is-active) .mural-ro-pan-off {
  display: none;
}

.mural-item-being-dragged {
  filter: none;
}

.mural-item-being-dragged .pol-scene {
  animation: muralDragZoom 110ms cubic-bezier(.22, .76, .27, 1) forwards;
  transform-origin: center center;
}

.mural-item-being-dragged .pol-flipper {
  transition: box-shadow 120ms ease, filter 120ms ease;
  filter: saturate(1.04);
  box-shadow:
    0 10px 24px color-mix(in srgb, #000 38%, transparent),
    0 18px 42px color-mix(in srgb, #000 34%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mc-accent-light) 56%, transparent),
    0 0 22px color-mix(in srgb, var(--mc-accent-light) 32%, transparent);
}

.mural-foto-card.mural-item-drop-settle .pol-scene {
  animation: polDropSettleScene 190ms cubic-bezier(.22, .78, .32, 1);
}

.mural-foto-card.mural-item-drop-settle .pol-flipper {
  animation: polDropSettleShadow 190ms cubic-bezier(.22, .78, .32, 1);
}

.mural-firma-card.mural-item-drop-settle {
  animation: firmaDropSettle 190ms cubic-bezier(.22, .78, .32, 1);
}

@keyframes muralDragZoom {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.05);
  }
}

@keyframes polDropSettleScene {
  0% {
    transform: scale(1.05);
    filter: brightness(1.06);
  }

  45% {
    transform: scale(0.992);
    filter: brightness(1.01);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes polDropSettleShadow {
  0% {
    box-shadow:
      0 10px 24px color-mix(in srgb, #000 38%, transparent),
      0 18px 42px color-mix(in srgb, #000 34%, transparent),
      0 0 0 1px color-mix(in srgb, var(--mc-accent-light) 56%, transparent),
      0 0 22px color-mix(in srgb, var(--mc-accent-light) 32%, transparent);
  }

  100% {
    box-shadow:
      0 6px 18px color-mix(in srgb, #000 36%, transparent),
      0 16px 34px color-mix(in srgb, #000 32%, transparent),
      0 0 0 1px color-mix(in srgb, var(--mc-accent-light) 48%, transparent),
      0 0 16px color-mix(in srgb, var(--mc-accent-light) 26%, transparent);
  }
}

@keyframes firmaDropSettle {
  0% {
    filter: brightness(1.06) drop-shadow(0 0 12px color-mix(in srgb, var(--mc-accent-light) 30%, transparent));
  }

  100% {
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mural-item-drop-settle {
    animation: none;
  }
}

/* ── Badge "Top 5 / Featured" ───────────────────────────────── */
.mural-item-badge {
  position: absolute;
  top: -8px;
  left: 8px;
  z-index: 30;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--mc-border);
  background: color-mix(in srgb, var(--mc-bg) 80%, transparent);
  color: var(--mc-muted);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.mural-item-badge.featured {
  background: color-mix(in srgb, var(--mc-accent-light) 18%, transparent);
  border-color: var(--mc-accent-light);
  color: var(--mc-accent-light);
}

/* ── Tooltip de autor ───────────────────────────────────────── */
.mural-author-pop {
  position: absolute;
  left: 50%;
  top: -62px;
  transform: translateX(-50%) translateY(4px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mc-paper);
  border: 1px solid var(--mc-border);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 150px;
  max-width: 220px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--mc-shadow-color) 65%, transparent);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.mural-foto-card:hover .mural-author-pop,
.mural-firma-card:hover .mural-author-pop {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mural-author-pop img,
.pol-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--mc-border);
  flex-shrink: 0;
}

.pol-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mc-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.mural-author-pop-text strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--mc-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.mural-author-pop-text span {
  display: block;
  font-size: 9px;
  color: var(--mc-muted);
  margin-top: 1px;
}

/* ══ ESCENA 3D ══════════════════════════════════════════════════
   .pol-scene da la profundidad pero NO transforma.
   .pol-flipper es el único elemento que rota.
   ══════════════════════════════════════════════════════════════ */
.pol-scene {
  position: relative;
  perspective: 1320px;
  perspective-origin: 50% 42%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* Chincheta — siempre visible, fuera del flip */
.pol-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--mc-primary);
  border: 2px solid color-mix(in srgb, var(--mc-paper) 70%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--mc-primary) 50%, transparent),
    0 2px 8px color-mix(in srgb, var(--mc-primary) 60%, transparent),
    inset 0 1px 2px rgba(255, 255, 255, .25);
  z-index: 25;
  pointer-events: none;
}

/* El flipper ocupa toda la escena y rota */
.pol-flipper {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: center center;
  transition:
    transform 720ms cubic-bezier(.16, .86, .26, .99),
    box-shadow 240ms ease;
  border-radius: 6px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--mc-border) 76%, transparent);
  background: linear-gradient(170deg,
      color-mix(in srgb, var(--mc-paper) 95%, #fff 5%) 0%,
      color-mix(in srgb, var(--mc-paper) 88%, var(--mc-bg) 12%) 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.14) inset,
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
}

.mural-foto-card:hover .pol-flipper {
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.30),
    0 16px 36px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.12) inset,
    0 0 22px color-mix(in srgb, var(--mc-primary) 26%, transparent);
}

.mural-foto-card.is-flipped .pol-flipper {
  transform: rotateY(180deg);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.26),
    0 24px 56px rgba(0, 0, 0, 0.20),
    0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

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

/* ── Sombra paralela (no se voltea) ─────────────────────────── */
.pol-shadow {
  display: none !important;
}

.mural-foto-card:hover .pol-shadow {
  display: none !important;
}

/* ── Caras ───────────────────────────────────────────────────── */
.pol-face {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  overflow: hidden;
}

/* FRENTE */
.pol-front {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  transform: translateZ(1px);
  pointer-events: auto;
  z-index: 2;
}

.mural-foto-card.is-flipped .pol-front {
  pointer-events: none;
}

.pol-photo-wrap {
  flex: 0 0 auto;
  line-height: 0;
  padding: 10px 10px 0;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--mc-paper) 98%, #fff 2%) 0%,
      color-mix(in srgb, var(--mc-paper) 92%, var(--mc-bg) 8%) 100%);
}

.pol-photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.22);
  border-radius: 3px;
}

/* Franja blanca estilo Polaroid */
.pol-strip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px 7px 5px;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--mc-paper) 97%, #fff 3%) 0%,
      color-mix(in srgb, var(--mc-paper) 90%, var(--mc-bg) 10%) 100%);
  border-top: 1px solid color-mix(in srgb, var(--mc-border) 52%, transparent);
}

.pol-strip-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--mc-ink);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.pol-strip-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
}

.pol-strip-author {
  font-size: 8px;
  font-weight: 600;
  color: var(--mc-accent);
  white-space: nowrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.pol-strip-date {
  font-size: 7px;
  color: color-mix(in srgb, var(--mc-muted) 88%, var(--mc-ink) 12%);
  font-family: 'Courier New', monospace;
  letter-spacing: .02em;
  white-space: nowrap;
}

.pol-strip-type {
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mc-border) 80%, transparent);
  color: color-mix(in srgb, var(--mc-muted) 80%, var(--mc-ink) 20%);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Tags — ocultos en la tarjeta (solo para búsqueda) */
.pol-strip-tags {
  display: none;
}

.pol-strip-tags span {
  font-size: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mc-border) 80%, transparent);
  background: color-mix(in srgb, var(--mc-bg) 42%, transparent);
  color: color-mix(in srgb, var(--mc-muted) 85%, var(--mc-ink) 15%);
  letter-spacing: .03em;
  line-height: 1.35;
}

/* Miembros */
.pol-strip-members-section {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.pol-strip-members-label {
  font-size: 7px;
  font-weight: 700;
  color: var(--mc-ink);
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}

.pol-strip-members {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
}

.pol-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.pol-member-chip img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--mc-paper);
  box-shadow: 0 0 4px color-mix(in srgb, var(--mc-primary) 40%, transparent);
}

.pol-member-name {
  font-size: 6px;
  color: var(--mc-muted);
  text-align: left;
  max-width: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.1;
}

.pol-members-more {
  font-size: 7px;
  color: var(--mc-muted);
  font-weight: 700;
}

/* Acciones: like + flip */
.pol-strip-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
  padding-top: 2px;
  border-top: 1px dashed color-mix(in srgb, var(--mc-border) 58%, transparent);
  gap: 6px;
}

/* Botón like */
.pol-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--mc-bg) 48%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc-border) 72%, transparent);
  border-radius: 999px;
  cursor: pointer;
  color: var(--mc-muted);
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  transition: color .15s ease, transform .12s ease, border-color .15s ease, background .15s ease;
}


.pol-like-btn:hover {
  color: var(--mc-primary);
  border-color: color-mix(in srgb, var(--mc-primary) 55%, var(--mc-border));
  background: color-mix(in srgb, var(--mc-primary) 14%, transparent);
  transform: scale(1.05);
}

.pol-like-btn.liked {
  color: var(--mc-accent);
}

.pol-like-btn.liked:hover {
  color: var(--mc-primary);
}

.pol-like-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: fill .15s ease;
}

.pol-like-btn.liked .pol-like-icon {
  fill: var(--mc-accent);
  stroke: var(--mc-accent);
}

.pol-like-count {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  min-width: 10px;
}

/* Botón flip (frente → reverso) */
.pol-flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 7px;
  background: none;
  border: 1px solid var(--mc-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--mc-muted);
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .04em;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1;
}

.pol-flip-btn svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.pol-flip-btn:hover {
  color: var(--mc-ink);
  border-color: var(--mc-primary);
  background: color-mix(in srgb, var(--mc-primary) 10%, transparent);
}

/* REVERSO */
.pol-back {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  padding: 14px 14px 14px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  transform: rotateY(180deg) translateZ(1px);
  pointer-events: none;
  /* Papel envejecido, con textura sutil, ajustado a paleta configurable */
  background: linear-gradient(160deg,
      color-mix(in srgb, var(--mc-paper) 88%, #fff 12%) 0%,
      color-mix(in srgb, var(--mc-paper) 84%, var(--mc-bg) 16%) 55%,
      color-mix(in srgb, var(--mc-paper) 76%, var(--mc-bg) 24%) 100%);
  color: var(--mc-ink);
  z-index: 1;
}

.mural-foto-card.is-flipped .pol-back {
  pointer-events: auto;
  z-index: 3;
}

.mural-foto-card.is-flipped .pol-front {
  pointer-events: none;
}

/* Líneas de fondo estilo libreta */
.pol-back::before {
  content: '';
  position: absolute;
  inset: 38px 14px 48px;
  background-image: repeating-linear-gradient(to bottom,
      transparent,
      transparent 23px,
      color-mix(in srgb, var(--mc-border) 42%, transparent) 23px,
      color-mix(in srgb, var(--mc-border) 42%, transparent) 24px);
  pointer-events: none;
}

.pol-back-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.pol-back-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: color-mix(in srgb, var(--mc-ink) 62%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

.pol-back-rule {
  flex: 1;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--mc-border) 74%, transparent);
  margin: 0;
}

/* Texto manuscrito */
.pol-back-body {
  flex: 1;
  min-height: 0;
  font-family: var(--mc-hand-font);
  font-size: 14px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--mc-ink) 88%, #000 12%);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  letter-spacing: .015em;
  position: relative;
  /* encima del ::before */
  z-index: 1;
  text-shadow: 0 1px 0 color-mix(in srgb, #fff 30%, transparent);
}

.pol-back-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.pol-back-author {
  font-size: 9px;
  font-weight: 600;
  color: color-mix(in srgb, var(--mc-ink) 70%, transparent);
  letter-spacing: .03em;
  font-style: italic;
}

/* Botón "Volver" en el reverso */
.pol-flip-to-front {
  /* hereda .pol-flip-btn */
  color: color-mix(in srgb, var(--mc-ink) 70%, transparent);
  border-color: color-mix(in srgb, var(--mc-border) 74%, transparent);
}

.pol-flip-to-front:hover {
  color: var(--mc-ink);
  border-color: var(--mc-primary);
  background: color-mix(in srgb, var(--mc-primary) 10%, transparent);
}

/* ── Hover glow sobre el card completo ──────────────────────── */
.mural-foto-card:hover {
  z-index: 200 !important;
}

/* ── FIRMAS ──────────────────────────────────────────────── */
.mural-firma-card {
  position: absolute;
  cursor: default;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px var(--mc-shadow-color));
}

.mural-firma-card.mural-item-draggable {
  pointer-events: auto;
}

.mural-firma-canvas-img {
  display: block;
  filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--mc-primary) 60%, transparent));
  opacity: 0.95;
}

.mural-firma-texto {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--mc-accent-light);
  text-align: center;
  margin-top: 4px;
  max-width: 160px;
  text-shadow: 0 2px 4px var(--mc-shadow-color);
  line-height: 1.3;
}

.mural-firma-menciones {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 4px;
  flex-wrap: wrap;
}

.mural-firma-menciones img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--mc-accent);
  box-shadow: 0 0 6px var(--mc-accent-shadow);
}

/* ── FOOTER ──────────────────────────────────────────────── */
#mural-footer {
  padding: 10px 18px;
  background: var(--mc-paper);
  border-top: 1px solid var(--mc-border);
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.7;
  font-weight: 500;
  letter-spacing: .03em;
}

/* ── MODALES ─────────────────────────────────────────────── */
.mural-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.mural-modal {
  background: var(--mc-paper);
  border: 1px solid var(--mc-border);
  border-radius: 6px;
  padding: 24px;
  width: 400px;
  max-width: 100%;
  position: relative;
  box-shadow:
    0 16px 48px color-mix(in srgb, var(--mc-shadow-color) 60%, transparent),
    0 0 1px var(--mc-accent);
  font-family: inherit;
  max-height: 90vh;
  overflow-y: auto;
}

.mural-modal-sign {
  width: min(860px, 100%);
}

.mural-modal-wide {
  width: min(980px, 96vw);
}

.mural-modal h3 {
  font-size: 16px;
  color: var(--mc-primary);
  margin-bottom: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mural-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--mc-ink);
  opacity: 0.5;
  line-height: 1;
  transition: all 0.2s ease;
}

.mural-modal-close:hover {
  opacity: 1;
  color: var(--mc-primary);
  transform: rotate(90deg);
}

.mural-label {
  display: block;
  font-size: 12px;
  color: var(--mc-ink);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  opacity: 0.9;
}

.mural-opt {
  font-size: 10px;
  color: var(--mc-accent);
  font-style: italic;
  font-weight: 500;
}

.mural-input {
  width: 100%;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  background: var(--mc-bg);
  color: var(--mc-ink);
  resize: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.mural-input:hover {
  border-color: var(--mc-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-accent-shadow) 26%, transparent);
}

.mural-input:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-primary-shadow) 38%, transparent);
}

.mural-modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.mural-modal-btns .mural-btn {
  color: var(--mc-ink);
  border-color: var(--mc-border);
  background: var(--mc-bg);
}

.mural-modal-btns .mural-btn:hover {
  background: var(--mc-border);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-primary-shadow) 24%, transparent);
}

/* Drop zone */
.mural-drop-zone {
  border: 2px dashed var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
  background: var(--mc-bg);
}

.mural-drop-zone:hover,
.mural-drop-zone.dragover {
  border-color: var(--mc-primary);
  background: color-mix(in srgb, var(--mc-primary) 8%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-primary) 20%, transparent);
}

.mural-drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.mural-drop-zone p {
  font-size: 13px;
  color: var(--mc-ink);
  margin: 0 0 4px;
  font-weight: 600;
}

.mural-drop-zone span {
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.6;
}

/* ── LISTA DE FOTOS ──────────────────────────────────────── */
#mural-fotos-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(62vh, calc(100vh - 290px));
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.mural-upload-guide {
  border: 1px solid var(--mc-border);
  background: color-mix(in srgb, var(--mc-bg) 85%, transparent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
}

.mural-upload-guide strong {
  color: var(--mc-accent-light);
  display: block;
  margin-bottom: 4px;
}

.mural-upload-guide ul {
  margin: 0;
  padding-left: 18px;
  opacity: 0.9;
}

.mural-upload-progress {
  margin-top: 10px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border: 1px solid var(--mc-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--mc-bg) 80%, transparent);
}

.mural-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--mc-ink);
}

.mural-upload-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--mc-border);
  background: color-mix(in srgb, var(--mc-bg) 70%, #000);
  overflow: hidden;
}

.mural-upload-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mc-primary), var(--mc-accent-light));
  transition: width 0.25s ease;
}

.mural-foto-item {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  background: var(--mc-bg);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 12px;
  align-items: start;
  position: relative;
  transition: all 0.2s ease;
}

.mural-foto-item:hover {
  border-color: var(--mc-primary);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-primary) 20%, transparent);
}

/* X de quitar */
.mural-foto-item-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mc-primary);
  border: 2px solid var(--mc-paper);
  color: var(--mc-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--mc-primary);
  transition: all 0.2s ease;
  padding: 0;
}

.mural-foto-item-remove:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px var(--mc-primary);
}

/* Preview */
.mural-foto-item-preview {
  width: 98px;
  height: 84px;
  border-radius: 2px;
  border: 1px solid var(--mc-border);
  display: block;
}

.mural-foto-item-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.mural-foto-item-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mural-foto-item:focus-within,
.mural-foto-item:focus-visible {
  border-color: var(--mc-accent-light);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mc-accent-light) 55%, transparent), 0 0 16px color-mix(in srgb, var(--mc-accent-light) 22%, transparent);
}

.mural-foto-item-fields textarea {
  min-height: 72px;
}

.mural-foto-item-fields input,
.mural-foto-item-fields textarea,
.mural-foto-item-fields select {
  width: 100%;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  background: var(--mc-bg);
  color: var(--mc-ink);
  resize: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.mural-foto-item-fields input:hover,
.mural-foto-item-fields textarea:hover,
.mural-foto-item-fields select:hover {
  border-color: var(--mc-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-accent-shadow) 26%, transparent);
}

.mural-foto-item-fields input:focus,
.mural-foto-item-fields textarea:focus,
.mural-foto-item-fields select:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc-primary-shadow) 34%, transparent);
}

/* Selector de color de marco */
.mural-color-marco-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.8;
}

.mural-color-marco-wrap input[type="color"] {
  width: 36px;
  height: 28px;
  border: 1px solid var(--mc-border);
  border-radius: 3px;
  padding: 2px;
  cursor: pointer;
  background: var(--mc-bg);
}

/* Tag/mención input */
.mural-tag-wrap {
  position: relative;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  background: var(--mc-bg);
  padding: 8px 10px;
  min-height: 40px;
  transition: all 0.2s ease;
}

.mural-tag-wrap:focus-within {
  border-color: var(--mc-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc-primary-shadow) 34%, transparent);
}

.mural-tags-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.mural-tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--mc-primary);
  color: var(--mc-ink);
  border-radius: 20px;
  padding: 3px 10px 3px 4px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-primary-shadow) 44%, transparent);
}

.mural-tag-chip img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.mural-tag-chip button {
  background: none;
  border: none;
  color: color-mix(in srgb, var(--mc-ink) 80%, transparent);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.mural-tag-chip button:hover {
  color: var(--mc-ink);
}

.mural-tag-input {
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  color: var(--mc-ink);
  padding: 0;
}

.mural-tag-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--mc-paper);
  border: 1px solid var(--mc-border);
  border-top: none;
  border-radius: 0 0 var(--mc-radius) var(--mc-radius);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 10;
  max-height: 160px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-primary) 20%, transparent);
}

.mural-tag-dropdown.open {
  display: block;
}

.mural-tag-dropdown li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mc-ink);
  transition: all 0.15s ease;
}

.mural-tag-dropdown li:hover {
  background: color-mix(in srgb, var(--mc-primary) 10%, transparent);
  color: var(--mc-primary);
}

.mural-tag-dropdown li img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Sig canvas */
#mural-sig-canvas {
  display: block;
  width: 100%;
  height: clamp(180px, 36vh, 280px);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  background: var(--mc-bg);
  cursor: crosshair;
  touch-action: none;
}

.mural-signature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mural-btn-ghost {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--mc-accent-light);
  cursor: pointer;
  padding: 4px 0;
  display: block;
  font-family: inherit;
  margin-top: 8px;
  transition: all 0.15s ease;
}

.mural-btn-ghost-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--mc-border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--mc-bg) 72%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
}

.mural-btn-ghost:hover {
  color: var(--mc-primary);
}

/* Mensaje de estado */
.mural-msg {
  margin-top: 12px;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--mc-radius);
  text-align: center;
  font-weight: 500;
}

.mural-msg.ok {
  background: color-mix(in srgb, var(--mc-success) 20%, transparent);
  color: var(--mc-success);
  border: 1px solid var(--mc-success);
}

.mural-msg.err {
  background: color-mix(in srgb, var(--mc-warning) 20%, transparent);
  color: var(--mc-warning);
  border: 1px solid var(--mc-warning);
}

.mural-msg.loading {
  background: color-mix(in srgb, var(--mc-primary) 15%, transparent);
  color: var(--mc-primary);
  border: 1px solid var(--mc-primary);
  animation: pulse 1.5s infinite;
}

.mural-modal-overlay.is-busy {
  cursor: progress;
}

.mural-modal-overlay.is-busy .mural-modal {
  pointer-events: none;
}

.mural-modal-overlay.is-busy .mural-modal>* {
  visibility: hidden;
}

.mural-busy-indicator {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
  background: color-mix(in srgb, var(--mc-bg) 86%, transparent);
  border-radius: inherit;
}

.mural-modal-overlay.is-busy .mural-busy-indicator {
  display: flex;
  visibility: visible;
}

.mural-busy-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--mc-ink) 35%, transparent);
  border-top-color: var(--mc-accent-light);
  animation: mural-spin .7s linear infinite;
}

.mural-busy-text {
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--mc-ink);
  opacity: .9;
}

.mural-btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 7px;
  border: 2px solid color-mix(in srgb, var(--mc-ink) 40%, transparent);
  border-top-color: var(--mc-ink);
  border-radius: 50%;
  vertical-align: -2px;
  animation: mural-spin .75s linear infinite;
}

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

/* ── AVISO DE REGISTRO (visitantes) ──────────────────────── */
.mural-registro-aviso {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.mural-registro-aviso-texto {
  font-size: 10px;
  color: var(--mc-ink);
  opacity: 0.7;
  text-align: center;
  line-height: 1.4;
}

.mural-registro-aviso a {
  color: var(--mc-accent);
  text-decoration: underline;
  font-weight: 600;
  transition: all 0.2s ease;
}

.mural-registro-aviso a:hover {
  color: var(--mc-primary);
  text-shadow: 0 0 6px var(--mc-accent);
}

/* ── LIGHTBOX FOTO ────────────────────────────────────────── */
#mural-lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  perspective: 1600px;
}

#mural-lb-box {
  background: var(--mc-paper);
  border: 1px solid var(--mc-border);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  width: fit-content;
  max-width: 92vw;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 720ms cubic-bezier(.16, .86, .26, .99);
  box-shadow: 0 0 32px color-mix(in srgb, var(--mc-primary) 30%, transparent);
}

#mural-lb-flip {
  position: relative;
  transform-style: preserve-3d;
}

#mural-lb-box.is-flipped {
  transform: rotateY(180deg);
}

.mural-lb-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mural-lb-face-front {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  transform: translateZ(1px);
}

.mural-lb-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(1px);
  background: linear-gradient(165deg,
      color-mix(in srgb, #fff 90%, var(--mc-paper) 10%),
      color-mix(in srgb, #f2f2f2 92%, var(--mc-paper) 8%));
  color: #2b2b2b;
  border-radius: 4px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--mc-hand-font);
  z-index: 1;
  pointer-events: none;
}

#mural-lb-box.is-flipped .mural-lb-face-front {
  pointer-events: none;
}

#mural-lb-box.is-flipped .mural-lb-face-back {
  z-index: 3;
  pointer-events: auto;
}

#mural-lb-box img {
  display: block;
  width: var(--mural-lb-image-width, auto);
  max-width: 80vw;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--mc-border);
}

#mural-lb-info {
  padding: 14px 8px 22px;
  font-family: inherit;
  position: relative;
  width: var(--mural-lb-image-width, auto);
  max-width: 80vw;
  box-sizing: border-box;
}

#mural-lb-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--mc-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  overflow-wrap: anywhere;
}

#mural-lb-descripcion {
  font-size: 15px;
  color: #1e1e1e;
  opacity: 1;
  font-style: normal;
  margin-bottom: 8px;
  max-width: 70ch;
  line-height: 1.5;
  font-family: var(--mc-hand-font);
}

#mural-lb-actions {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

#mural-lb-flip-front,
#mural-lb-flip-back {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  color: var(--mc-primary) !important;
  font-family: inherit !important;
  font-size: 10px !important;
}

#mural-lb-flip-back {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 9;
}

#mural-lb-reverso-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .62;
}

#mural-lb-likes {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  position: static;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.25;
  color: var(--mc-ink);
}

#mural-lb-likes:hover {
  color: var(--mc-primary);
}

#mural-lb-likes.liked {
  color: var(--mc-accent);
}

#mural-lb-miembros {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 8px;
}

#mural-lb-tags {
  display: none;
}

#mural-lb-tags span {
  font-size: 10px;
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mc-border) 78%, transparent);
  color: color-mix(in srgb, var(--mc-ink) 78%, transparent);
  background: color-mix(in srgb, var(--mc-bg) 26%, transparent);
}

#mural-lb-miembros img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--mc-accent-light);
  box-shadow: 0 0 6px var(--mc-accent-light);
}

#mural-lb-miembros span {
  font-size: 12px;
  color: var(--mc-ink);
  opacity: 0.8;
  font-weight: 500;
  overflow-wrap: anywhere;
}

#mural-lb-meta {
  font-size: 11px;
  color: var(--mc-ink);
  opacity: 0.72;
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .03em;
  overflow-wrap: anywhere;
}

#mural-lb-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mc-primary);
  border: 1px solid color-mix(in srgb, var(--mc-border) 75%, transparent);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mc-ink);
  z-index: 12;
  box-shadow: 0 6px 16px color-mix(in srgb, #000 45%, transparent);
  transition: all 0.2s ease;
}

#mural-lb-close:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--mc-primary);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  #mural-toolbar {
    padding: 10px;
  }

  .mural-tb-right {
    min-width: 0;
    width: 100%;
  }

  .mural-toolbar-row-main {
    justify-content: flex-end;
  }

  .mural-toolbar-row-filters {
    padding: 6px;
  }

  .mural-filter-input {
    min-width: 100%;
    flex-basis: 100%;
  }

  .mural-tb-title {
    font-size: 13px;
  }

  .mural-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .mural-modal {
    padding: 16px;
    width: 100%;
  }

  .mural-modal-wide {
    width: 100%;
  }

  .mural-foto-item {
    grid-template-columns: 90px 1fr;
  }

  .mural-foto-item-preview {
    width: 90px;
    height: 76px;
  }

  .mural-zoom-group {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   MEJORAS v4.0 — Modal de fotos accesible + Botón IA
   ══════════════════════════════════════════════════════════════ */

/* Foto item: layout responsive mejorado */
.mural-foto-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--mc-bg);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 14px 44px 14px 14px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mural-foto-item:focus-within {
  border-color: var(--mc-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc-primary) 18%, transparent);
}

.mural-foto-item-preview-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  background: color-mix(in srgb, var(--mc-bg) 80%, #000 20%);
  border-radius: 2px;
  overflow: hidden;
  max-height: 180px;
}

.mural-foto-item-preview {
  width: auto;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

/* Remove button: ícono SVG limpio */
.mural-foto-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mc-primary);
  border: 2px solid var(--mc-paper);
  color: var(--mc-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--mc-primary);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  z-index: 5;
}

.mural-foto-item-remove svg {
  width: 12px;
  height: 12px;
}

.mural-foto-item-remove:hover {
  transform: scale(1.2);
  box-shadow: 0 0 18px var(--mc-primary);
}

/* Campos con etiquetas */
.mural-foto-item-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.mural-foto-item-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mural-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mural-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mc-ink);
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mural-field-row-inline {
  display: grid;
  grid-template-columns: minmax(130px, max-content) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.mural-field-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.mural-field-badge-wrap select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  background: var(--mc-bg);
  color: var(--mc-ink);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.mural-field-badge-wrap select:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mc-primary-shadow) 30%, transparent);
}

/* Heredar estilos de input/textarea para los campos con label */
.mural-foto-item-fields input[type="text"],
.mural-foto-item-fields textarea {
  width: 100%;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  background: var(--mc-bg);
  color: var(--mc-ink);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mural-foto-item-fields input[type="text"]:focus,
.mural-foto-item-fields textarea:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc-primary-shadow) 30%, transparent);
}

/* Color input dentro del campo inline */
.mural-color-marco-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.mural-color-marco-wrap input[type="color"] {
  width: 36px;
  height: 30px;
  border: 1px solid var(--mc-border);
  border-radius: 3px;
  padding: 2px;
  cursor: pointer;
  background: var(--mc-bg);
}

/* Botón IA */
.mural-btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--mc-accent-light) 50%, var(--mc-border));
  background: color-mix(in srgb, var(--mc-accent-light) 8%, var(--mc-bg));
  color: var(--mc-accent-light);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .03em;
  transition: all 0.2s ease;
  white-space: nowrap;
  align-self: stretch;
  justify-content: center;
}

.mural-prompt-actions {
  flex-wrap: wrap;
}

.mural-btn-ai:hover {
  background: color-mix(in srgb, var(--mc-accent-light) 16%, var(--mc-bg));
  border-color: var(--mc-accent-light);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc-accent-shadow) 40%, transparent);
}

.mural-btn-ai:focus-visible {
  outline: 2px solid var(--mc-accent-light);
  outline-offset: 2px;
}

/* Modal del prompt de IA */
.mural-prompt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mural-prompt-modal {
  background: var(--mc-paper);
  border: 1px solid var(--mc-border);
  border-radius: 8px;
  padding: 22px 24px;
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 16px 48px color-mix(in srgb, var(--mc-shadow-color) 70%, transparent),
    0 0 1px var(--mc-accent-light);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mural-prompt-modal h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--mc-accent-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}

.mural-prompt-hint {
  font-size: 12px;
  color: var(--mc-ink);
  opacity: 0.7;
  line-height: 1.5;
  margin: 0;
}

.mural-prompt-media {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--mc-border);
  border-radius: 6px;
  padding: 8px;
  background: color-mix(in srgb, var(--mc-bg) 85%, transparent);
}

.mural-prompt-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 220px;
  margin: 0 auto;
  border-radius: 4px;
  border: 1px solid var(--mc-border);
}

.mural-prompt-media-help {
  margin: 0;
  font-size: 11px;
  color: var(--mc-muted);
  text-align: center;
}

.mural-prompt-textarea {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  padding: 10px 12px;
  background: var(--mc-bg);
  color: var(--mc-ink);
  resize: vertical;
  box-sizing: border-box;
  min-height: 120px;
  transition: border-color 0.2s ease;
}

.mural-prompt-textarea[readonly] {
  opacity: 0.85;
  cursor: default;
  min-height: 160px;
}

.mural-json-input {
  min-height: 100px;
  font-size: 12px;
  opacity: 1;
  cursor: text;
}

.mural-prompt-textarea:focus {
  outline: none;
  border-color: var(--mc-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc-primary-shadow) 30%, transparent);
}

.mural-prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mural-prompt-apply-row {
  justify-content: flex-end;
}

.mural-prompt-copy-ok {
  font-size: 12px;
  color: var(--mc-success);
  font-weight: 600;
  min-height: 18px;
}

.mural-prompt-divider {
  border: none;
  border-top: 1px solid var(--mc-border);
  margin: 0;
}

.mural-prompt-apply-msg {
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
  margin: 0;
}

/* Focus visible mejoras globales */
.mural-foto-item-fields input:focus-visible,
.mural-foto-item-fields textarea:focus-visible,
.mural-foto-item-fields select:focus-visible {
  outline: 2px solid var(--mc-primary);
  outline-offset: 1px;
}

/* Responsive para el modal de fotos en mobile */
@media (max-width: 600px) {
  .mural-foto-item {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .mural-foto-item-preview-wrap {
    width: 100%;
  }

  .mural-foto-item-preview {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
  }

  .mural-foto-item-remove {
    top: 6px;
    right: 6px;
  }

  .mural-foto-item-fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mural-foto-item-preview-wrap {
    max-height: 140px;
  }

  .mural-field-row-inline {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mural-color-marco-wrap,
  .mural-field-badge-wrap {
    width: 100%;
  }

  .mural-prompt-modal {
    padding: 16px;
  }

  .mural-prompt-textarea[readonly] {
    min-height: 120px;
  }
}

/* Responsive: ocultar label en readonly btn en mobile */
@media (max-width: 600px) {
  .mural-canvas-readonly-label {
    display: none;
  }

  .mural-canvas-readonly-btn {
    padding: 8px;
  }

  .mural-canvas-zoom-bar {
    bottom: 14px;
  }

  .mural-canvas-actions {
    bottom: 12px;
    right: 10px;
  }

  .mural-canvas-action-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .mural-canvas-action-btn span {
    display: none;
  }
}

/* Final override: asegurar que cada item de subida use ancho completo sin cortes */
.mural-modal-wide {
  width: min(1180px, 96vw);
}

#mural-fotos-lista {
  max-height: min(70vh, calc(100vh - 250px));
}

.mural-foto-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.mural-foto-item-preview-wrap {
  width: 112px;
  max-width: 112px;
  max-height: 220px;
  margin: 0;
  justify-content: center;
}

.mural-foto-item-preview {
  width: 112px;
  height: 96px;
  max-width: 112px;
  max-height: 220px;
  object-fit: cover;
}

.mural-foto-item-fields {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.mural-foto-item-col-left,
.mural-foto-item-col-right {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .mural-foto-item {
    grid-template-columns: 1fr;
  }

  .mural-foto-item-preview-wrap {
    width: 100%;
    max-width: 100%;
    max-height: 180px;
  }

  .mural-foto-item-preview {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
  }

  .mural-foto-item-fields {
    grid-template-columns: 1fr;
  }
}