/* --------------------------------------------------------------------------
   Panel de Greb (redactar y generar imágenes)
   -------------------------------------------------------------------------- */
/* La columna derecha del taller y sus modales, portados con el editor. Solo se
   traen las reglas de las clases que los módulos portados usan de verdad:
   traerse la hoja entera metía estilos ajenos al editor. */
:root {
  --greb-amarillo: #F5DF4D;
  --greb-tinta:    #2E2710;
  --greb-muted:    #8A7320;
  --greb-acento:   #B11A5E;
  --greb-mono:     "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cmr-form-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.4rem; }

.cmr-form-msg { font-family: var(--sans); font-size: 0.9rem; font-weight: 500; }

.cmr-form-msg.is-ok { color: #2e6b3e; }

.cmr-form-msg.is-error { color: var(--verde); }

.cmr-btn-google {
  display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 1rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; text-decoration: none;
  padding: 0.8em 1.4em; border: 1.5px solid var(--tinta); border-radius: 3px;
  background: var(--blanco); color: var(--tinta); box-shadow: 4px 4px 0 var(--crema);
  transition: transform .15s, box-shadow .15s;
}

.cmr-btn-google:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--crema); }

.cmr-btn-google .cmr-g {
  display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--verde); color: #fff; font-family: var(--serif); font-weight: 900; font-size: 1rem;
}

.cmr-logout { margin-left: auto; font-weight: 600; color: var(--verde); text-decoration: none; }

.cmr-logout:hover { text-decoration: underline; }

.cmr-editing-banner {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem;
  padding: 0.7rem 1rem; border-left: 4px solid var(--crema); background: rgba(201,168,106,0.12);
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
}

.cmr-live { align-self: start; }

.cmr-live-label {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.7rem; font-weight: 700; color: rgba(26,26,26,0.5); margin: 0 0 0.7rem;
}

.cmr-flip-toggle { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.cmr-flip-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
  border-radius: 12px;
  
}

.cmr-flip-toggle:checked ~ .cmr-flip-inner { transform: rotateY(180deg); }

.cmr-flip-face {
  position: absolute; inset: 0; margin: 0;
  border: 1px solid var(--crema); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #faf7f1 0%, #ece3d3 100%);
  box-shadow: 0 1px 2px rgba(26,26,26,0.06), 0 8px 22px rgba(26,26,26,0.07);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.cmr-flip:hover .cmr-flip-face { box-shadow: 0 2px 4px rgba(26,26,26,0.08), 0 14px 34px rgba(26,26,26,0.13); }

.cmr-flip-front { cursor: pointer; }

.cmr-flip-front img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; border: 0; margin: 0; border-radius: 0; }

.cmr-flip-badge {
  position: absolute; right: 0.55rem; bottom: 0.55rem;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  background: rgba(26,26,26,0.78); color: #fff;
  padding: 0.32em 0.7em; border-radius: 100px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26,26,26,0.25);
}

.cmr-flip-front:hover .cmr-flip-badge { background: var(--verde); }

.cmr-flip-back { transform: rotateY(180deg); background: linear-gradient(180deg, #f6f1e8 0%, #e6dccb 100%); }

.cmr-flip-back model-viewer {
  width: 100%; height: 100%;
  background-color: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--crema);
  cursor: grab;
}

.cmr-flip-back model-viewer:active { cursor: grabbing; }

.cmr-flip-flipback {
  position: absolute; right: 0.55rem; bottom: 0.55rem; cursor: pointer;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  background: rgba(255,255,255,0.85); color: var(--tinta);
  padding: 0.32em 0.7em; border-radius: 100px; border: 1px solid var(--crema);
}

.cmr-flip-flipback:hover { background: #fff; }

.cmr-flip-ar {
  display: flex; align-items: center; gap: 0.7rem; margin: 0.55rem 0 0;
  font-family: var(--sans); font-size: 0.74rem; line-height: 1.35;
  color: rgba(26,26,26,0.66);
}

.cmr-flip-ar img {
  width: 78px; height: 78px; flex: 0 0 auto; margin: 0;
  border: 1px solid var(--crema); border-radius: 6px; background: #fff;
}

.cmr-flip-ar a { color: var(--verde); font-weight: 700; text-decoration: none; white-space: nowrap; }

.cmr-flip-ar a:hover { text-decoration: underline; }

.cmr-rev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; max-height: 320px; overflow-y: auto; }

.cmr-rev-meta { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; flex: 1; }

.cmr-rev-who { font-family: var(--sans); font-weight: 700; font-size: 0.88rem; color: var(--tinta); }

.cmr-rev-when { font-family: var(--sans); font-size: 0.74rem; color: rgba(26,26,26,0.55); }

.cmr-rev-tit { font-family: var(--sans); font-size: 0.82rem; color: rgba(26,26,26,0.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cmr-descargas {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin: 1.6rem 0; padding: 1rem; border: 1px dashed var(--rule-strong, var(--crema));
  border-radius: 12px; background: rgba(201,168,106,0.08);
}

.cmr-descargas img { width: 120px; border-radius: 6px; border: 1px solid var(--crema); margin: 0; }

.cmr-descargas-txt { flex: 1; min-width: 220px; font-family: var(--sans); font-size: 0.9rem; }

.cmr-descargas-txt a {
  display: inline-block; margin-top: 0.5rem; margin-right: 0.6rem; padding: 0.45rem 0.9rem;
  border-radius: 100px; background: var(--verde); color: #fff; font-weight: 700;
  font-size: 0.82rem; text-decoration: none;
}

.cmr-bas-rating {
  flex: none; font-weight: 700; font-size: 0.78rem; padding: 0.25rem 0.55rem; border-radius: 100px;
  background: var(--tinta); color: var(--blanco); letter-spacing: 0.02em;
}

.cmr-portada-grid {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.5rem;
}

.cmr-portada-op {
  position: relative; padding: 0; cursor: pointer; overflow: hidden;
  width: 120px; height: 78px; border-radius: 8px;
  border: 2px solid var(--crema); background: #fffdf8;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cmr-portada-op:hover { border-color: var(--tinta); transform: translateY(-1px); }

.cmr-portada-op img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cmr-portada-op.is-on { border-color: var(--verde); }

.cmr-portada-op.is-on::after {
  content: "✓"; position: absolute; top: 4px; right: 5px;
  width: 19px; height: 19px; border-radius: 50%; background: var(--verde); color: #fff;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
  display: grid; place-items: center;
}

.cmr-portada-auto {
  display: grid; place-content: center; gap: 0.15rem; text-align: center;
  font-family: var(--sans); padding: 0.4rem;
}

.cmr-portada-auto-txt { font-size: 0.82rem; font-weight: 700; }

.cmr-portada-auto-sub { font-size: 0.68rem; color: rgba(26, 26, 26, 0.5); line-height: 1.25; }

.cmr-portada-vacio { font-size: 0.85rem; margin-top: 0.4rem; }
