/* ============================================================
   COMUNIDAD DEL CABALLO DE SANLÚCAR
   Red social estilo Instagram. Se apoya en las variables de
   app.css (crema / tinta / coral) y convive con portal.css.
   ============================================================ */

.cm-body {
  background: var(--cream);
  font-family: var(--f-ui);
  color: var(--ink);
  margin: 0;
  padding-bottom: 92px;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Cabecera ---------- */
.cm-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  background: rgba(255,255,255,.93);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--cream-2);
  padding-top: max(10px, env(safe-area-inset-top));
}
.cm-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.cm-brand img { height: 32px; width: auto; display: block; }
.cm-brand span {
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 700;
  color: var(--ink); letter-spacing: -.01em;
}
.cm-head-r { display: flex; align-items: center; gap: 8px; }
.cm-ico {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background .15s;
}
.cm-ico:hover { background: var(--cream-2); }

.cm-main { max-width: 960px; margin: 0 auto; padding: 18px 14px 28px; }

/* ---------- Navegación inferior ---------- */
.cm-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--cream-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.cm-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 8px; color: var(--ink-3); text-decoration: none;
  font-size: .68rem; font-weight: 600; transition: color .15s;
}
.cm-nav a.on { color: var(--coral); }
.cm-nav a:active { background: var(--cream-2); }

/* ---------- Avatares ---------- */
.cm-ava {
  border-radius: 50%; object-fit: cover; display: inline-flex;
  flex-shrink: 0; border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--cream-3);
}
.cm-ava-ph {
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  color: #fff; font-weight: 700; font-family: var(--f-display);
}
.cm-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--sky); color: #fff; margin-left: 5px; vertical-align: middle;
}

/* ---------- Tarjetas genéricas ---------- */
.cm-card {
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 18px; padding: 26px; max-width: 680px; margin: 0 auto 20px;
  box-shadow: 0 1px 3px rgba(36,26,40,.04);
}
.cm-card-sm { max-width: 440px; }
.cm-card h1 { font-family: var(--f-display); font-size: 1.5rem; margin: 0 0 6px; }
.cm-card > .muted { margin: 0 0 20px; }
.cm-login-logo { height: 66px; display: block; margin: 0 auto 16px; }
.cm-card-sm h1, .cm-card-sm > .muted, .cm-done { text-align: center; }

.cm-done-ico { color: var(--ok); margin: 0 0 8px; }
.cm-done p { color: var(--ink-2); line-height: 1.6; }
.cm-done-cta { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Formularios ---------- */
.cm-form { display: block; }
.cm-form .field { margin-bottom: 15px; }
.cm-form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .cm-form-2 { grid-template-columns: 1fr; } }
.cm-check {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--cream); border: 1px solid var(--cream-2);
  border-radius: 12px; padding: 13px 15px; margin: 6px 0 20px;
  font-size: .86rem; line-height: 1.55; color: var(--ink-2); cursor: pointer;
}
.cm-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--coral); flex-shrink: 0; }

/* ---------- Caja de la norma ---------- */
.cm-rule-box {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--coral-wash); border: 1px solid #f6d6cf;
  border-radius: 14px; padding: 15px 17px; margin: 0 0 22px;
  color: var(--coral-dark);
}
.cm-rule-box strong { display: block; font-size: .95rem; margin-bottom: 3px; }
.cm-rule-box p { margin: 0; font-size: .85rem; line-height: 1.55; color: var(--ink-2); }
.cm-rule-main { background: var(--gold-wash); border-color: #efdcb4; color: #8a6514; }

/* ---------- Portada de invitado ---------- */
.cm-hero { text-align: center; padding: 30px 10px 26px; }
.cm-hero h1 {
  font-family: var(--f-display); font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 12px; line-height: 1.15;
}
.cm-hero > p { max-width: 580px; margin: 0 auto; color: var(--ink-2); line-height: 1.65; }
.cm-hero-cta { display: flex; gap: 11px; justify-content: center; margin: 24px 0 18px; flex-wrap: wrap; }
.cm-rule-banner {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--coral-wash); color: var(--coral-dark);
  border-radius: 999px; padding: 9px 18px; font-size: .87rem; margin: 0;
}
.cm-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 460px; margin: 6px auto 30px; text-align: center;
}
.cm-stats-row div {
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 14px; padding: 14px 8px;
}
.cm-stats-row strong { display: block; font-family: var(--f-display); font-size: 1.5rem; }
.cm-stats-row span { font-size: .74rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

.cm-howto { max-width: 620px; margin: 34px auto 0; }
.cm-howto h2 { font-family: var(--f-display); font-size: 1.3rem; margin: 0 0 14px; }
.cm-howto ol { padding-left: 20px; color: var(--ink-2); line-height: 1.75; }
.cm-howto li { margin-bottom: 9px; }
.cm-locked {
  text-align: center; color: var(--ink-3); font-size: .87rem;
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px;
}

/* ---------- Secciones ---------- */
.cm-sec { max-width: 920px; margin: 0 auto 26px; }
.cm-sec h1 {
  font-family: var(--f-display); font-size: 1.5rem; margin: 0 0 16px;
  display: flex; align-items: center; gap: 9px;
}
.cm-sec h2 {
  font-family: var(--f-display); font-size: 1.15rem; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Rejilla estilo Instagram ---------- */
.cm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 740px) { .cm-grid { gap: 7px; } }
.cm-cell {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: 6px; background: var(--cream-2); display: block;
}
.cm-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.cm-cell:hover img { transform: scale(1.05); }
.cm-cell-ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 5px; background: rgba(36,26,40,.52); color: #fff; font-weight: 700; font-size: .85rem;
  opacity: 0; transition: opacity .2s;
}
.cm-cell:hover .cm-cell-ov { opacity: 1; }
.cm-cell-hidden {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--danger);
  color: #fff; font-size: .62rem; text-align: center; padding: 3px; font-weight: 700;
}

/* ---------- Muro ---------- */
.cm-feed-wrap { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 24px; align-items: start; }
@media (max-width: 880px) { .cm-feed-wrap { grid-template-columns: 1fr; } .cm-side { display: none; } }
.cm-feed { max-width: 560px; width: 100%; margin: 0 auto; }

.cm-compose { margin-bottom: 16px; }
.cm-compose-in {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: var(--paper); border: 1px solid var(--cream-2); border-radius: 999px;
  padding: 9px 16px 9px 9px; color: var(--ink-3); transition: border-color .15s;
}
.cm-compose-in:hover { border-color: var(--coral-light); }
.cm-compose-in span { flex: 1; font-size: .9rem; }
.cm-compose-in svg { color: var(--coral); }

.cm-post {
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 16px; overflow: hidden; margin-bottom: 18px;
}
.cm-post-h { display: flex; align-items: center; gap: 11px; padding: 12px 14px; }
.cm-post-who { flex: 1; min-width: 0; line-height: 1.3; }
.cm-post-who a { text-decoration: none; color: var(--ink); }
.cm-post-who strong { font-size: .92rem; }
.cm-post-who span { display: block; font-size: .75rem; color: var(--ink-3); }
.cm-post-x {
  border: 0; background: none; color: var(--ink-4); cursor: pointer;
  padding: 6px; border-radius: 8px; display: inline-flex;
}
.cm-post-x:hover { background: var(--cream-2); color: var(--coral); }

.cm-post-img { display: block; background: var(--cream-3); }
.cm-post-img img { width: 100%; display: block; max-height: 640px; object-fit: cover; }

.cm-post-acts { display: flex; align-items: center; gap: 16px; padding: 11px 14px 4px; }
.cm-like-f { display: inline-flex; margin: 0; }
.cm-act {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; cursor: pointer; padding: 0;
  color: var(--ink-2); font-size: .85rem; font-weight: 600; text-decoration: none;
}
.cm-act:hover { color: var(--coral); }
.cm-act.on { color: var(--coral); }
.cm-act.on svg { fill: var(--coral); }
.cm-horse {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; color: var(--ink-3); background: var(--cream);
  padding: 4px 10px; border-radius: 999px;
}
.cm-post-cap { padding: 6px 14px 0; margin: 0; font-size: .89rem; line-height: 1.55; color: var(--ink-2); }
.cm-post-cap a { font-weight: 700; color: var(--ink); text-decoration: none; }
.cm-post-tags { padding: 4px 14px 14px; margin: 0; font-size: .8rem; color: var(--sky); }
.cm-post-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78rem; color: var(--ink-3); margin: 6px 0 12px; }
.cm-post-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Barra lateral ---------- */
.cm-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.cm-side-card {
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 14px; padding: 15px;
}
.cm-side-card h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); margin: 0 0 10px; display: flex; align-items: center; gap: 7px;
}
.cm-side-card p { margin: 0 0 9px; color: var(--ink-2); line-height: 1.5; }
.cm-side-me { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-bottom: 12px; }
.cm-side-me strong { display: block; font-size: .92rem; color: var(--ink); }
.cm-side-me span { font-size: .78rem; color: var(--ink-3); }
.cm-sug { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; }
.cm-sug strong { display: block; font-size: .85rem; color: var(--ink); }
.cm-sug span { font-size: .74rem; color: var(--ink-3); }
.cm-side-club { background: var(--cream); }

/* ---------- Perfil ---------- */
.cm-profile {
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 18px; overflow: hidden; margin-bottom: 22px;
}
.cm-cover {
  height: 170px; background: linear-gradient(130deg, var(--ink), var(--coral-dark));
  background-size: cover; background-position: center;
}
.cm-profile-in { padding: 0 22px 22px; }
.cm-profile-top { display: flex; align-items: flex-end; gap: 22px; margin-top: -54px; }
.cm-profile-top .cm-ava { border-width: 4px; box-shadow: 0 2px 10px rgba(36,26,40,.14); }
.cm-profile-stats { display: flex; gap: 26px; padding-bottom: 8px; flex-wrap: wrap; }
.cm-profile-stats div { text-align: center; }
.cm-profile-stats strong { display: block; font-family: var(--f-display); font-size: 1.3rem; }
.cm-profile-stats span { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.cm-profile-id { margin-top: 16px; }
.cm-profile-id h1 { font-family: var(--f-display); font-size: 1.5rem; margin: 0; }
.cm-handle { color: var(--ink-3); font-size: .88rem; margin: 2px 0 10px; }
.cm-bio { color: var(--ink-2); line-height: 1.6; margin: 0 0 11px; max-width: 540px; }
.cm-profile-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .8rem; color: var(--ink-3); margin: 0; }
.cm-profile-meta span, .cm-profile-meta a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); text-decoration: none; }
.cm-profile-meta a:hover { color: var(--coral); }
.cm-profile-acts { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.cm-profile-acts form { margin: 0; }
@media (max-width: 560px) {
  .cm-profile-in { padding: 0 16px 18px; }
  .cm-profile-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cm-profile-stats { gap: 20px; }
}

/* ---------- Detalle de foto ---------- */
.cm-detail {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  background: var(--paper); border: 1px solid var(--cream-2);
  border-radius: 18px; overflow: hidden; max-width: 920px; margin: 0 auto;
}
@media (max-width: 820px) { .cm-detail { grid-template-columns: 1fr; } }
.cm-detail-img { background: #1a1320; display: flex; align-items: center; }
.cm-detail-img img { width: 100%; max-height: 74vh; object-fit: contain; display: block; }
.cm-detail-side { padding: 4px 18px 18px; display: flex; flex-direction: column; }
.cm-detail-cap { font-size: .92rem; line-height: 1.6; color: var(--ink-2); margin: 4px 0 8px; }
.cm-comments { flex: 1; overflow-y: auto; max-height: 300px; margin: 12px 0; border-top: 1px solid var(--cream-2); padding-top: 12px; }
.cm-comment { display: flex; gap: 10px; margin-bottom: 13px; }
.cm-comment p { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--ink-2); }
.cm-comment a { text-decoration: none; color: var(--ink); }
.cm-comment span { font-size: .72rem; color: var(--ink-4); }
.cm-comment-f { display: flex; gap: 8px; align-items: center; }
.cm-comment-f .input { flex: 1; }

/* ---------- Subir foto ---------- */
.cm-drop {
  display: block; position: relative; border: 2px dashed var(--cream-3);
  border-radius: 16px; background: var(--cream); cursor: pointer;
  margin-bottom: 18px; overflow: hidden; transition: border-color .15s, background .15s;
}
.cm-drop:hover { border-color: var(--coral-light); background: var(--coral-wash); }
.cm-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cm-drop-in {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 42px 18px; color: var(--ink-3); text-align: center;
}
.cm-drop-in strong { font-size: .98rem; color: var(--ink); }
.cm-drop-in small { font-size: .78rem; }
.cm-drop-in svg { color: var(--coral); }
.cm-drop img { width: 100%; max-height: 380px; object-fit: contain; display: block; background: #1a1320; }

/* ---------- Directorio de jinetes ---------- */
.cm-search { display: flex; gap: 8px; margin-bottom: 18px; max-width: 460px; }
.cm-search .input { flex: 1; }
.cm-riders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 13px; }
.cm-rider {
  background: var(--paper); border: 1px solid var(--cream-2); border-radius: 15px;
  padding: 18px 12px; text-align: center; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .15s, border-color .15s;
}
.cm-rider:hover { transform: translateY(-2px); border-color: var(--coral-light); }
.cm-rider strong { font-size: .9rem; margin-top: 9px; }
.cm-rider span { font-size: .76rem; color: var(--ink-3); }
.cm-rider small { font-size: .73rem; color: var(--ink-4); }
.cm-rider em { font-size: .72rem; color: var(--coral); font-style: normal; font-weight: 700; margin-top: 5px; }

/* ---------- Normas ---------- */
.cm-rules { list-style: none; padding: 0; margin: 20px 0 0; counter-reset: rule; }
.cm-rule {
  counter-increment: rule; position: relative; padding: 16px 16px 16px 54px;
  border: 1px solid var(--cream-2); border-radius: 14px; margin-bottom: 12px;
  background: var(--cream);
}
.cm-rule::before {
  content: counter(rule); position: absolute; left: 16px; top: 16px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
}
.cm-rule.sev-3::before { background: var(--warn); }
.cm-rule.sev-4::before { background: var(--danger); }
.cm-rule h2 { font-family: var(--f-display); font-size: 1.05rem; margin: 0 0 6px; }
.cm-rule p { margin: 0 0 8px; font-size: .87rem; line-height: 1.6; color: var(--ink-2); }
.cm-rule-cons {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3); background: var(--paper);
  border: 1px solid var(--cream-3); border-radius: 999px; padding: 3px 10px;
}

/* ---------- Ajustes ---------- */
.cm-set-ava { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.cm-set-ava > div { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-report-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 16px; }

/* ---------- Vacío ---------- */
.cm-empty {
  text-align: center; padding: 48px 18px; background: var(--paper);
  border: 1px solid var(--cream-2); border-radius: 16px;
}
.cm-empty svg { color: var(--ink-4); }
.cm-empty h2 { font-family: var(--f-display); font-size: 1.2rem; margin: 10px 0 5px; }
.cm-empty p { margin: 0 0 12px; }

/* ---------- Pie ---------- */
.cm-foot {
  text-align: center; padding: 30px 16px 20px; color: var(--ink-4); font-size: .8rem;
  border-top: 1px solid var(--cream-2); margin-top: 32px;
}
.cm-foot p { margin: 3px 0; }
.cm-foot a { color: var(--ink-3); text-decoration: none; }
.cm-foot a:hover { color: var(--coral); }

/* ---------- Botones de comunidad en el header público ---------- */
.btn-community {
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
}
.btn-community:hover { background: var(--coral); border-color: var(--coral); color: #fff; }

/* ============================================================
   CUOTA DEL PERFIL
   ============================================================ */
.cm-cuota {
  background: var(--cream); border: 1px solid var(--cream-2);
  border-radius: 14px; padding: 14px 16px; margin: 0 0 20px;
}
.cm-cuota-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.cm-cuota-top strong { font-size: .98rem; }
.cm-cuota-top span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.cm-cuota-track {
  height: 7px; border-radius: 999px; background: var(--cream-3); overflow: hidden;
}
.cm-cuota-fill { height: 100%; background: var(--sage); transition: width .3s ease; }
.cm-cuota.warn .cm-cuota-fill { background: var(--warn); }
.cm-cuota.full .cm-cuota-fill { background: var(--danger); }
.cm-cuota.warn { border-color: #efdcb4; background: var(--warn-wash); }
.cm-cuota.full { border-color: #f0cdc7; background: var(--danger-wash); }
.cm-cuota-msg {
  margin: 9px 0 0; font-size: .8rem; line-height: 1.55; color: var(--ink-2);
}
.cm-cuota-msg a { color: var(--coral); font-weight: 600; white-space: nowrap; }

/* ============================================================
   EDITOR DE ENCUADRE (estilo Instagram)
   ============================================================ */
.cm-drop-in.compact { padding: 18px; }
.cm-drop-hint { color: var(--coral); font-weight: 600; }

.cm-ratios { display: flex; gap: 8px; margin: 18px 0 12px; flex-wrap: wrap; }
.cm-ratio {
  flex: 1; min-width: 72px; border: 1px solid var(--cream-3); background: #fff;
  border-radius: 12px; padding: 10px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 600; color: var(--ink-3); transition: all .15s;
}
.cm-ratio:hover { border-color: var(--coral-light); }
.cm-ratio.on { border-color: var(--coral); background: var(--coral-wash); color: var(--coral-dark); }
.cm-ratio-box { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: .75; }
.cm-ratio-box.r-cuadrado   { width: 22px; height: 22px; }
.cm-ratio-box.r-vertical   { width: 18px; height: 22px; }
.cm-ratio-box.r-horizontal { width: 26px; height: 14px; }
.cm-ratio-box.r-original   { width: 24px; height: 18px; border-style: dashed; }

.cm-stage { margin-bottom: 12px; }
.cm-frame {
  position: relative; overflow: hidden; border-radius: 12px;
  background: #1a1320; cursor: grab; touch-action: none; user-select: none;
}
.cm-frame:active { cursor: grabbing; }
.cm-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform-origin: center; pointer-events: none;
}
.cm-frame.r-original img { object-fit: contain; }
.cm-stage-help {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: .75rem; color: var(--ink-3); margin: 9px 0 6px;
}
#cmZoom { width: 100%; accent-color: var(--coral); }

.cm-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.cm-thumb {
  position: relative; flex: none; width: 62px; height: 62px; padding: 0;
  border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  background: var(--cream-2); cursor: pointer;
}
.cm-thumb.on { border-color: var(--coral); }
.cm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-thumb-first {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(36,26,40,.78);
  color: #fff; font-size: .55rem; text-align: center; padding: 2px; font-weight: 700;
}

/* ============================================================
   CARRUSEL
   ============================================================ */
.cm-carousel { position: relative; }
.cm-carousel-n {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(36,26,40,.72); color: #fff; border-radius: 999px;
  padding: 4px 9px; font-size: .72rem; font-weight: 700;
}

.cm-slider { position: relative; overflow: hidden; }
.cm-slides { display: flex; transition: transform .3s cubic-bezier(.2,.8,.3,1); }
.cm-slide { position: relative; flex: 0 0 100%; display: flex; align-items: center; justify-content: center; }
.cm-slide img { width: 100%; max-height: 74vh; object-fit: contain; display: block; }
.cm-slide-del { position: absolute; top: 10px; right: 10px; margin: 0; }
.cm-slide-del button {
  border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 9px;
  background: rgba(36,26,40,.74); color: #fff; display: grid; place-items: center;
}
.cm-slide-del button:hover { background: var(--danger); }
.cm-slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.88); color: var(--ink);
  display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.2);
}
.cm-slide-nav:hover { background: #fff; }
.cm-slide-nav.prev { left: 10px; }
.cm-slide-nav.prev svg { transform: rotate(180deg); }
.cm-slide-nav.next { right: 10px; }
.cm-dots {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
  display: flex; gap: 6px; justify-content: center;
}
.cm-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5);
  transition: background .2s, transform .2s;
}
.cm-dots span.on { background: #fff; transform: scale(1.25); }

/* ============================================================
   GESTIONAR MIS FOTOS
   ============================================================ */
.cm-manage-bar {
  position: sticky; top: 58px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--paper); border: 1px solid var(--cream-2); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px;
}
.cm-manage-bar button:disabled { opacity: .45; cursor: not-allowed; }

.cm-manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cm-manage-cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--cream-2); cursor: pointer; display: block;
}
.cm-manage-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.cm-manage-cell input { position: absolute; opacity: 0; pointer-events: none; }
.cm-manage-tick {
  position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.85); color: transparent; border: 2px solid #fff;
  display: grid; place-items: center; transition: all .15s;
}
.cm-manage-cell input:checked ~ .cm-manage-tick { background: var(--danger); color: #fff; }
.cm-manage-cell input:checked ~ img { transform: scale(.92); }
.cm-manage-cell:has(input:checked) { outline: 3px solid var(--danger); outline-offset: -3px; }
.cm-manage-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 14px 7px 5px; font-size: .64rem; color: #fff;
  background: linear-gradient(transparent, rgba(36,26,40,.75));
}
.cm-multi { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.cm-manage-hidden {
  position: absolute; top: 6px; right: 6px; background: var(--danger); color: #fff;
  font-size: .58rem; font-weight: 700; padding: 2px 6px; border-radius: 999px;
}
.cm-manage-cell.off img { filter: grayscale(1) opacity(.5); }
