/* =========================================================================
   COMPARTIR — el botón de cada noticia y la ventana que abre.

   En el móvil la ventana sube desde abajo, como la hoja de compartir del
   sistema; en el PC es un cuadro centrado. Va por encima de todo menos de
   la pantalla de carga.
   ========================================================================= */

/* --- el botón, junto a la fuente de cada noticia ----------------------- */
.meta-noticia .btn-compartir, .btn-compartir {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border-radius: 999px; flex: 0 0 26px;
  border: 1px solid transparent; background: none; cursor: pointer;
  color: var(--texto2, #9aa6bd); line-height: 1; font-size: .7rem;
  transition: color .16s, background .16s, border-color .16s, transform .16s;
  -webkit-tap-highlight-color: transparent;
}
.btn-compartir svg { width: 15px; height: 15px; display: block; }
.meta-noticia .btn-compartir:hover, .btn-compartir:focus-visible {
  color: #fff; background: rgba(59, 130, 246, .28);
  border-color: var(--acento, #3b82f6); outline: none;
}
.btn-compartir:active { transform: scale(.92); }

/* cuántos lo están comentando en La Sala (solo si hay alguien) */
.n-coment {
  display: inline-flex; align-items: center; gap: 3px; font-size: .64rem;
  font-weight: 700; color: #9fc0f5; white-space: nowrap;
}
.n-coment[hidden] { display: none; }

/* dentro del lector, con palabra */
.btn-compartir.btn-compartir-lector {
  width: auto; height: auto; flex: none; gap: 7px; margin: 12px 0 0;
  padding: 8px 16px 8px 13px; font-size: .84rem; font-weight: 700;
  color: var(--texto, #eef1f8); border-color: var(--linea, #2a303b);
  background: rgba(255, 255, 255, .04);
}
.btn-compartir.btn-compartir-lector:hover { border-color: var(--acento, #3b82f6); }

/* --- la ventana ---------------------------------------------------------- */
html.cp-abierto { overflow: hidden; }
.cp-fondo {
  position: fixed; inset: 0; z-index: 2147482000;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(4, 6, 12, 0); transition: background .2s;
}
.cp-fondo[hidden] { display: none; }
.cp-fondo.visible { background: rgba(4, 6, 12, .66); }
.cp-caja {
  width: min(430px, 100%); max-height: min(640px, calc(100dvh - 36px));
  overflow-y: auto; overscroll-behavior: contain;
  background: #151922; color: #eef1f8;
  border: 1px solid rgba(148, 163, 199, .18); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  padding: 8px 16px 16px;
  transform: translateY(14px) scale(.98); opacity: 0;
  transition: transform .2s cubic-bezier(.2, .9, .3, 1), opacity .2s;
  font-family: var(--f-texto, "Manrope", system-ui, sans-serif);
}
.cp-fondo.visible .cp-caja { transform: none; opacity: 1; }
.cp-asa { display: none; }

.cp-cab {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
}
#cp-titulo { flex: 1; font-size: 1.02rem; }
.cp-atras, .cp-cerrar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  border: 1px solid rgba(148, 163, 199, .2); background: rgba(255, 255, 255, .04);
  color: #b9c2d6; cursor: pointer; font: inherit; font-size: 1rem; line-height: 1;
}
.cp-atras { font-size: 1.35rem; padding-bottom: 3px; }
.cp-atras[hidden] { display: none; }
.cp-atras:hover, .cp-cerrar:hover { color: #fff; border-color: #3b82f6; }

.cp-noticia {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(59, 130, 246, .08); border: 1px solid rgba(59, 130, 246, .22);
}
.cp-ico-n { font-size: 1.1rem; line-height: 1.3; }
.cp-noticia div { min-width: 0; }
.cp-tit {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; font-size: .88rem; line-height: 1.38;
}
.cp-de { display: block; margin-top: 3px; font-size: .72rem; color: #9aa6bd; }

/* las opciones */
.cp-op {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 7px;
  padding: 11px 12px; border-radius: 14px; text-align: left; cursor: pointer;
  border: 1px solid rgba(148, 163, 199, .14); background: rgba(255, 255, 255, .03);
  color: inherit; font: inherit; transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.cp-op:hover, .cp-op:focus-visible {
  background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .5); outline: none;
}
.cp-op:active { transform: scale(.99); }
.cp-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(255, 255, 255, .06);
}
.cp-txt { display: flex; flex-direction: column; min-width: 0; }
.cp-txt b { font-size: .9rem; }
.cp-txt small { font-size: .74rem; color: #9aa6bd; margin-top: 1px; }
.cp-op.cp-hecho small { color: #4ade80; font-weight: 700; }

.cp-url, .cp-buscar, .cp-campo input, .cp-texto {
  display: block; width: 100%; margin: 4px 0 10px; padding: 11px 12px;
  border-radius: 12px; border: 1px solid rgba(148, 163, 199, .24);
  background: #0f131b; color: #eef1f8; font: inherit;
  font-size: 16px;                 /* menos, y el iPhone amplía la página */
}
.cp-url[hidden], .cp-buscar[hidden] { display: none; }
.cp-url:focus, .cp-buscar:focus, .cp-campo input:focus, .cp-texto:focus {
  border-color: #3b82f6; outline: none;
}
.cp-texto { resize: vertical; min-height: 64px; line-height: 1.45; }
.cp-campo { display: block; font-size: .76rem; color: #9aa6bd; }

.cp-nota { font-size: .8rem; color: #b9c2d6; margin: 2px 0 10px; line-height: 1.45; }
.cp-nota b { color: #fff; }
.cp-etq {
  display: block; margin: 2px 0 6px; font-size: .66rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: #9aa6bd;
}
.cp-vacio { font-size: .8rem; color: #9aa6bd; padding: 6px 2px; }

.cp-persona {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px;
  border: none; border-radius: 10px; background: none; color: inherit;
  font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
}
.cp-persona:hover, .cp-persona:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.cp-cara {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: linear-gradient(135deg, #3d8bff, #37e6ff); color: #fff;
}
.cp-gente[hidden], .cp-mensaje[hidden], .cp-para[hidden] { display: none; }
.cp-para {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 8px 10px; border-radius: 12px; background: rgba(59, 130, 246, .12);
  font-size: .88rem;
}
.cp-para span { flex: 1; }
.cp-quitar-para {
  border: none; background: none; color: #b9c2d6; cursor: pointer; font-size: 1rem;
}

.cp-boton {
  display: block; width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  font: inherit; font-weight: 700; font-size: .92rem; text-align: center;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(59, 130, 246, .3);
}
.cp-boton:disabled { opacity: .55; cursor: default; }
.cp-cambiar { margin-top: 12px; text-align: center; font-size: .78rem; color: #9aa6bd; }
.cp-enlace {
  border: none; background: none; padding: 0; color: #60a5fa; font: inherit;
  text-decoration: underline; cursor: pointer;
}
.cp-listo { text-align: center; padding: 6px 0 2px; }
.cp-ok { font-size: 1rem; font-weight: 700; color: #4ade80; margin: 4px 0 14px; }

.cp-aviso { margin: 8px 0 0; font-size: .8rem; min-height: 0; }
.cp-aviso.ok { color: #9fc0f5; }
.cp-aviso.mal { color: #ff8a8a; }

/* móvil: hoja que sube desde abajo */
@media (max-width: 640px) {
  .cp-fondo { align-items: flex-end; padding: 0; }
  .cp-caja {
    width: 100%; max-height: 88dvh; border-radius: 22px 22px 0 0;
    border-bottom: none; padding: 6px 14px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .cp-asa {
    display: block; width: 40px; height: 4px; margin: 4px auto 2px;
    border-radius: 999px; background: rgba(148, 163, 199, .35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cp-fondo, .cp-caja { transition: none; }
}

/* --- aviso de noticia de otro día ---------------------------------------- */
.cp-toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 2147481000;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: calc(100vw - 24px); padding: 11px 12px 11px 16px;
  background: #151922; color: #eef1f8; border: 1px solid rgba(148, 163, 199, .22);
  border-radius: 14px; box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  font-size: .86rem;
}
.cp-toast a { color: #60a5fa; font-weight: 700; text-decoration: none; }
.cp-toast button {
  border: none; background: none; color: #9aa6bd; cursor: pointer; font-size: 1rem;
}

/* --- globito de privados sin leer en el icono de La Sala ------------------ */
#abrir-sala .sala-globito {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: #e6484d; color: #fff;
  font-size: .66rem; font-style: normal; font-weight: 800; line-height: 20px;
  text-align: center; box-shadow: 0 0 0 2px #0f1115;
}
