/* Grupos, GIFs, «Mis stickers», mensajes temporales y ubicación (usa los tokens de app.css). */

/* ---- nuevo grupo / info del grupo ---- */
.new-group-row { display: flex; align-items: center; gap: .85rem; width: 100%; border: 0; background: var(--surface-2); color: var(--ink); border-radius: var(--r-md); padding: .75rem .9rem; margin-bottom: 1rem; text-align: left; }
.new-group-row:hover { background: var(--surface-3); }
.ng-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--plum-soft); color: var(--plum-text); flex: none; }
.ng-text { display: grid; gap: .1rem; } .ng-text small { color: var(--muted); font-size: var(--fs-sm); }
.group-glyph { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.avatar:has(> .group-glyph) { background: var(--plum-soft); color: var(--plum-text); }
.group-dialog .dialog-body { max-height: min(70vh, 640px); overflow-y: auto; }
.pick-list { display: grid; gap: .15rem; }
.pick-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .4rem; border-radius: var(--r-sm); border: 0; background: none; color: var(--ink); text-align: left; width: 100%; cursor: pointer; }
.pick-item:hover:not([disabled]) { background: var(--surface-2); }
.pick-item[disabled] { cursor: default; opacity: 1; }
.pick-item .ci-main { flex: 1; min-width: 0; display: grid; }
.pick-item input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--coral); flex: none; }
.add-av { background: var(--coral-soft); color: var(--coral-text); display: grid; place-items: center; }
.role-badge { font-size: var(--fs-xs); font-weight: 700; color: var(--plum-text); background: var(--plum-soft); padding: .15rem .5rem; border-radius: 999px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.group-head { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.group-head .avatar.big { width: 72px; height: 72px; font-size: 1.6rem; flex: none; }
.gh-main { display: grid; gap: .35rem; flex: 1; min-width: 0; }
.gh-main input { font-size: var(--fs-lg); font-weight: 700; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: .2rem 0; }
.gh-main input:focus { outline: none; border-color: var(--coral); }
.gh-main .btn { justify-self: start; }
.group-gone { text-align: center; color: var(--muted); font-size: var(--fs-sm); margin: .6rem 1rem calc(.8rem + var(--safe-b)); }

/* ---- nombre de quien escribe en grupos ---- */
.sender-name { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.2; margin-bottom: .2rem; color: hsl(var(--sender-h, 330) 55% 42%); }
[data-theme="oscuro"] .sender-name { color: hsl(var(--sender-h, 330) 70% 72%); }
.msg.cont .sender-name { display: none; }
.bubble.media-only .sender-name { margin: 0 0 .3rem .2rem; line-height: 1.2; }

/* ---- avisos del chat ---- */
.msg.sys-row { align-self: center; max-width: 86%; }
.sys-pill { font-size: 12px; color: var(--ink-2); background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: .35rem .85rem; border-radius: 12px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); margin: .35rem 0; line-height: 1.35; }
.sys-pill.sys-ttl { color: var(--plum-text); }

/* ---- mensajes temporales ---- */
.ttl-chip { font-size: 11px; font-weight: 700; color: var(--plum-text); background: var(--plum-soft); border-radius: 999px; padding: .08rem .42rem; margin-left: .35rem; white-space: nowrap; }
.ttl-mark { font-size: 10px; opacity: .8; margin-right: .15rem; }

/* ---- GIFs ---- */
.gif-box { position: relative; display: block; max-width: min(66vw, 240px); border-radius: 16px; overflow: hidden; background: var(--surface-2); line-height: 0; }
.gif-box video, .gif-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-box.gif-sticker { background: transparent; border-radius: 0; max-width: 150px; }
.gif-box.gif-sticker img { object-fit: contain; }
.gif-tag { position: absolute; left: .45rem; top: .45rem; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: rgba(0, 0, 0, .45); padding: .15rem .35rem; border-radius: 6px; line-height: 1; }
.gif-search { width: 100%; grid-column: 1 / -1; border: 1px solid var(--line-2); border-radius: 999px; padding: .55rem .9rem; background: var(--surface-2); color: var(--ink); font-size: var(--fs-md); margin-bottom: .4rem; }
.sticker-grid:has(.gif-search) { display: block; }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .3rem; }
.gif-grid button { border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.gif-grid.stickers button { background: none; padding: .2rem; }
.gif-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-grid.stickers img { object-fit: contain; }
.gif-grid .hint { grid-column: 1 / -1; }
.sticker-add { display: grid !important; place-items: center; align-content: center; gap: .1rem; border: 2px dashed var(--line-2) !important; color: var(--muted); font-size: 1.6rem; font-weight: 300; }
.sticker-add small { font-size: 12px; font-weight: 600; }
.my-sticker { border-radius: 0; }

/* ---- ubicación ---- */
.at-loc { background: color-mix(in srgb, #23a867 16%, transparent); color: #17804c; }
[data-theme="oscuro"] .at-loc { color: #6fdaa4; }
#locationDialog .cm-item small.block { display: block; }
.loc-sub { margin: .6rem 1.2rem .1rem; font-size: var(--fs-sm); }
.loc-status { margin: .3rem 1.2rem; min-height: 1em; }
.loc-card { display: grid; gap: .45rem; line-height: 1.3; max-width: 260px; }
.loc-map { position: relative; display: block; overflow: hidden; border-radius: 14px; background: #e9e4dc; max-width: min(66vw, 260px); }
[data-theme="oscuro"] .loc-map { background: #2b2a2e; }
[data-theme="oscuro"] .loc-tile { filter: brightness(.82) contrast(1.05); }
.loc-tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; pointer-events: none; }
.loc-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -92%); color: var(--coral); width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.loc-pin .ico { width: 34px; height: 34px; fill: var(--coral); stroke: #fff; stroke-width: 1.4; }
.loc-pin.live::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: color-mix(in srgb, var(--coral) 45%, transparent); animation: loc-pulse 1.8s ease-out infinite; }
@keyframes loc-pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.loc-attr { position: absolute; right: 4px; bottom: 3px; font-size: 9px; color: #333; background: rgba(255, 255, 255, .75); padding: 0 .25rem; border-radius: 4px; line-height: 1.4; }
.loc-info { display: grid; gap: .1rem; padding: 0 .15rem; }
.loc-info small { opacity: .8; font-size: 12px; }
.loc-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.loc-actions .btn { min-height: 34px; padding: .35rem .8rem; font-size: 13px; }
.msg.mine .loc-actions .btn { color: var(--mine-ink); background: var(--mine-line); }
.loc-actions .danger { color: var(--danger); }
.bubble.has-location.media-only { background: var(--theirs); box-shadow: 0 0 0 1px var(--theirs-line); padding: .35rem; line-height: 1.3; border-radius: 18px; }
.msg.mine .bubble.has-location.media-only { background: var(--mine); color: var(--mine-ink); }
.bubble.has-location.media-only > .meta { position: static; background: none; color: inherit !important; padding: .1rem .2rem 0; justify-content: flex-end; opacity: .75; }
.bubble.has-location.media-only > .meta .ticks { stroke: currentColor; }

/* Las llamadas son de dos personas: en un grupo no se muestran sus botones. */

/* Con «Ubicación» la bandeja «+» tiene 5 opciones: en pantallas angostas se acomodan sin salirse. */
.attach-tray { max-width: calc(100vw - 1.1rem); flex-wrap: wrap; }
@media (max-width: 420px) { .attach-tray .at-item { width: 64px; font-size: 11.5px; } .attach-tray .at-ico { width: 46px; height: 46px; } }
@media (max-width: 359px) { .attach-tray .at-item { width: 54px; } } /* 320 px: las 5 opciones en una sola fila */

.cm-ico.loc-live { color: var(--coral-text); } /* ubicación en vivo */
