/* Fijados, destacados, encuestas e «Info del mensaje» (public/social.js). */

/* Bandeja «+»: Encuesta */
.at-poll { background: color-mix(in srgb, #3f7fd9 16%, transparent); color: #2a63b5; }
[data-theme="oscuro"] .at-poll { color: #8fb8f5; }

/* Marcas junto a la hora */
.meta-mark { display: inline-grid; place-items: center; }
.meta-mark .ico { width: 11px; height: 11px; stroke-width: 2.2; }
.star-mark .ico { fill: currentColor; }

/* Barra de mensajes fijados (bajo el encabezado del chat) */
.pin-bar { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 46px; padding: .35rem 1rem; border: 0; border-bottom: 1px solid var(--line);
  background: var(--glass, var(--surface)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--ink); text-align: left; cursor: pointer; }
.pin-bar[hidden] { display: none; }
.pin-bar:active { background: var(--surface-2); }
.pb-dots { display: flex; flex-direction: column; gap: 3px; align-self: stretch; justify-content: center; }
.pb-dots i { width: 3px; flex: 1; max-height: 12px; min-height: 6px; border-radius: 2px; background: var(--line-2); }
.pb-dots i.on { background: var(--coral); }
.pb-ico { color: var(--coral-text); display: grid; place-items: center; flex: none; }
.pb-ico .ico { width: 18px; height: 18px; }
.pb-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.pb-text strong { font-size: 12px; color: var(--coral-text); font-weight: 650; }
.pb-text span { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avisos del chat que llevan a un mensaje */
button.sys-pill.sys-link { border: 0; cursor: pointer; font: inherit; font-size: 12px; }

/* Chip «Destacados» en la lista */
.starred-chip { gap: .3rem; margin-left: auto; }
.starred-chip .ico { width: 15px; height: 15px; fill: #e7b341; stroke: #c9951f; }

/* Diálogos */
.social-dialog .dialog-body { padding-bottom: 1rem; }
.starred-list { display: grid; }
.starred-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .3rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.starred-item:hover { background: var(--surface-2); }
.si-main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.si-top { display: flex; gap: .5rem; align-items: baseline; justify-content: space-between; }
.si-top strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-top small { color: var(--muted); font-size: 11px; flex: none; }
.si-text { font-size: var(--fs-md); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.si-star .ico { width: 16px; height: 16px; fill: #e7b341; stroke: #c9951f; }
.starred-empty { display: grid; justify-items: center; gap: .6rem; padding: 2rem 1rem; text-align: center; color: var(--muted); }
.se-ico .ico { width: 40px; height: 40px; fill: color-mix(in srgb, #e7b341 30%, transparent); stroke: #c9951f; }

/* Crear encuesta */
.poll-in-opts { display: grid; gap: .45rem; }
.poll-in-row { display: flex; gap: .3rem; align-items: center; }
.poll-in-row input { flex: 1; min-width: 0; }
.poll-in-x { width: 34px; height: 34px; color: var(--muted); }
.poll-in-x .ico { width: 16px; height: 16px; }
.poll-in-multi { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: var(--fs-md); }

/* Encuesta dentro del globo */
.bubble.has-poll { min-width: min(270px, 72vw); }
.poll-card { display: grid; gap: .55rem; padding: .15rem .1rem .1rem; max-width: 320px; }
.poll-q { font-weight: 700; font-size: var(--fs-md); line-height: 1.35; overflow-wrap: anywhere; }
.poll-sub { display: flex; align-items: center; gap: .3rem; font-size: 12px; opacity: .72; margin-top: -.3rem; }
.poll-sub .ico { width: 13px; height: 13px; }
.poll-opts { display: grid; gap: .45rem; }
.poll-opt { display: flex; align-items: flex-start; gap: .55rem; width: 100%; padding: .15rem 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.po-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid currentColor; opacity: .55; display: grid; place-items: center; }
.po-check.sq { border-radius: 6px; }
.poll-opt.mine .po-check { opacity: 1; background: var(--coral); border-color: var(--coral); color: #fff; }
.msg.mine .poll-opt.mine .po-check { background: #fff; border-color: #fff; color: var(--coral); }
.po-check .ico { width: 13px; height: 13px; stroke-width: 3; }
.po-main { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.po-top { display: flex; align-items: center; gap: .4rem; }
.po-text { flex: 1; min-width: 0; font-size: var(--fs-md); line-height: 1.3; overflow-wrap: anywhere; }
.po-voters { display: flex; flex: none; }
.po-voters .avatar.tiny { width: 18px; height: 18px; font-size: 9px; margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }
.msg.mine .po-voters .avatar.tiny { box-shadow: 0 0 0 1.5px var(--mine); }
.po-n { flex: none; font-size: 12px; font-weight: 650; opacity: .8; min-width: 1ch; text-align: right; font-variant-numeric: tabular-nums; }
.po-bar { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, currentColor 14%, transparent); overflow: hidden; }
.po-bar i { display: block; height: 100%; border-radius: 3px; background: var(--coral); transition: width .35s var(--ease-out, ease); }
.msg.mine .po-bar i { background: currentColor; }
.poll-opt.lead .po-text { font-weight: 650; }
.poll-foot { display: flex; flex-wrap: wrap; gap: .2rem .9rem; justify-content: space-between; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); padding-top: .45rem; }
.poll-link { border: 0; background: none; padding: .15rem 0; color: var(--coral-text); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.msg.mine .poll-link { color: inherit; }
.votes-q { font-weight: 700; margin: 0 0 .6rem; }
.votes-opt { border-top: 1px solid var(--line); padding: .6rem 0 .3rem; }
.vo-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.vo-head small { color: var(--muted); flex: none; }

/* Info del mensaje */
.info-preview { display: grid; gap: .25rem; padding: .7rem .9rem; margin-bottom: .8rem; border-radius: var(--r-md, 14px); background: var(--mine); color: var(--mine-ink); justify-self: end; max-width: 85%; margin-left: auto; }
.info-preview span { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.info-preview small { font-size: 11px; opacity: .8; justify-self: end; }
.info-sec { border-top: 1px solid var(--line); padding: .6rem 0 .2rem; }
.info-sec-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .2rem; }
.info-sec-head strong { flex: 1; }
.info-sec-head small { color: var(--muted); }
.info-sec .ico, .info-line .ico { width: 20px; height: 20px; color: var(--muted); }
.info-sec.read .info-sec-head .ico, .info-line.read:not(.off) .ico { color: var(--coral); }
.info-line { display: flex; align-items: center; gap: .6rem; padding: .75rem .2rem; border-top: 1px solid var(--line); }
.info-line strong { flex: 1; }
.info-line small { color: var(--ink-2); }
.info-line.off small { color: var(--muted); }
.info-row { cursor: default; }
.info-hint { margin-top: .8rem; }
/* La hora va en su propia línea debajo de la encuesta (no encima de los enlaces). */
.bubble.has-poll > .meta { position: static; justify-content: flex-end; margin: .15rem 0 0; }

/* ===== Llamadas de grupo (public/group-call.js) ===== */
.gcall-bar { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem .45rem 1rem; background: color-mix(in srgb, #23a867 12%, var(--bg)); border-bottom: 1px solid var(--line); }
.gcall-bar[hidden] { display: none; }
.gcb-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #23a867; color: #fff; flex: none; }
.gcb-ico .ico { width: 17px; height: 17px; }
.gcb-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.gcb-text strong { font-size: var(--fs-sm); }
.gcb-text small { font-size: 12px; color: var(--muted); }
.gcb-join { background: #23a867; flex: none; }
.gc-title { margin-left: .35rem; font-weight: 650; font-size: var(--fs-sm); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gc-time { margin-left: auto; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; font-weight: 600; }
.gc-grid { display: none; position: relative; z-index: 2; flex: 1; width: 100%; min-height: 0; margin: 10px 0; gap: 8px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.call-screen.gcall[data-state="active"] .gc-grid, .call-screen.gcall[data-state="outgoing"] .gc-grid { display: grid; }
.call-screen.gcall[data-state="active"] .call-who { display: none; }
.call-screen.gcall[data-state="outgoing"] .call-who { margin-top: 3vh; }
.call-screen.gcall[data-state="outgoing"] .gc-grid { flex: 0 0 auto; height: 26vh; }
.gc-grid[data-n="3"], .gc-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.gc-grid[data-n="5"], .gc-grid[data-n="6"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
.gc-grid[data-n="3"] .gc-tile:first-child { grid-column: 1 / -1; }
.gc-grid[data-n="5"] .gc-tile:first-child { grid-column: 1 / -1; }
.gc-tile { position: relative; overflow: hidden; border-radius: 20px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); display: grid; place-items: center; min-height: 0; }
.gc-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t-2); }
.gc-tile video.mirror { transform: scaleX(-1); }
.gc-tile audio { display: none; }
.gc-tile.cam video { opacity: 1; }
.gc-tile.cam .gc-av { visibility: hidden; }
.gc-av { width: min(84px, 22vw); height: min(84px, 22vw); font-size: 28px; font-weight: 700; color: #fff; background: linear-gradient(145deg, var(--rose), var(--wine)); box-shadow: 0 0 0 4px rgba(255, 255, 255, .1); }
.gc-tile.connecting .gc-av { animation: pulse 1.4s infinite; }
.gc-label { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, .42); color: #fff; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-label .ico { width: 13px; height: 13px; flex: none; }
.call-screen.gcall .call-subs { margin-top: 0; }
