:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e7e9ee;
  --text: #1f2937;
  --muted: #8a919e;
  --hover: #f1f3f6;
  --accent: #2f7fe0;
  --accent-soft: #e8f1fc;
  --online: #3fb950;
  --busy: #e5534b;
  --away: #e3a008;
  --offline: #b8bec8;
  --danger: #d64545;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(20, 30, 50, .10);
  color-scheme: light;
}
/* Tema oscuro: automático (según el sistema) o forzado desde Apariencia */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]):not([data-theme=glass]) {
    --bg: #111317; --panel: #181b20; --line: #262a31; --text: #e6e8ec; --muted: #8b929d;
    --hover: #20242a; --offline: #4a5059;
    --shadow: 0 8px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
    --bg: #111317; --panel: #181b20; --line: #262a31; --text: #e6e8ec; --muted: #8b929d;
    --hover: #20242a; --offline: #4a5059;
    --shadow: 0 8px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Botones e inputs ---------- */
.btn { padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.link { color: var(--muted); font-size: 12px; }
.link:hover { color: var(--accent); }
input[type=search], .field, .auth-card input, .auth-card select, .modal-card input, .modal-card select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Estados ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--offline); display: inline-block; flex: none; }
.dot.online { background: var(--online); }
.dot.busy, .dot.phone { background: var(--busy); }
.dot.away, .dot.brb, .dot.lunch { background: var(--away); }
.dot.invisible, .dot.offline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--offline); }

/* ---------- Avatar ---------- */
.avatar {
  flex: none; border-radius: 10px; background: var(--accent-soft) center/cover no-repeat;
  display: grid; place-items: center; color: var(--accent); font-weight: 700; position: relative;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--st, var(--offline));
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; border-radius: 8px; }
.avatar.md { width: 40px; height: 40px; font-size: 15px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
.avatar.xl { width: 96px; height: 96px; font-size: 36px; border-radius: 16px; }
.avatar[data-st=online] { --st: var(--online); }
.avatar[data-st=busy], .avatar[data-st=phone] { --st: var(--busy); }
.avatar[data-st=away], .avatar[data-st=brb], .avatar[data-st=lunch] { --st: var(--away); }

/* ---------- Muñequitos (guiño a MSN) ---------- */
.buddy { position: relative; width: 64px; height: 56px; margin: 0 auto 10px; }
.buddy span { position: absolute; bottom: 0; width: 34px; height: 46px; }
.buddy span::before { content: ""; position: absolute; left: 9px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: currentColor; }
.buddy span::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 26px; border-radius: 17px 17px 6px 6px; background: currentColor; }
.buddy .b1 { left: 2px; color: var(--online); z-index: 1; }
.buddy .b2 { right: 2px; color: var(--accent); transform: scale(.88); transform-origin: bottom; }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 12px; text-align: left; }
.auth-card h1 { margin: 0; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth-card > p { margin: 0; text-align: center; }
.auth-card label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.auth-card label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.auth-card label.check input { width: auto; }
.auth-card a { color: var(--accent); text-decoration: none; }
.error { color: var(--danger); font-size: 13px; min-height: 0; margin: 0; }
.error:empty { display: none; }

/* ---------- Layout ---------- */
.app { height: 100dvh; display: grid; grid-template-columns: 320px 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Perfil */
.me { display: flex; gap: 14px; padding: 20px 18px 14px; align-items: flex-start; }
.me-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.me-name { text-align: left; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name:hover { color: var(--accent); }
.status-pick { position: relative; }
.status-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 2px 0; }
.status-btn svg { width: 10px; height: 10px; }
.status-btn:hover { color: var(--text); }
.psm-input { border: 1px solid transparent; border-radius: 7px; padding: 4px 6px; margin-left: -6px; background: transparent; font-size: 13px; width: calc(100% + 6px); outline: none; color: var(--muted); }
.psm-input:hover { border-color: var(--line); }
.psm-input:focus { color: var(--text); background: var(--panel); }
.music { font-size: 12px; color: var(--muted); }
.music::before { content: "♪ "; color: var(--accent); }

/* Menús */
.menu { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); padding: 5px; }
.menu.right { left: auto; right: 0; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.menu button:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.search-row { display: flex; gap: 6px; padding: 0 14px 10px; }
.search-row input { padding: 8px 11px; background: var(--bg); border-color: transparent; }

/* Lista de contactos */
.list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.group-h { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-h svg { width: 10px; height: 10px; transition: transform .15s; }
.group-h.closed svg { transform: rotate(-90deg); }
.contact { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 8px; border-radius: 10px; text-align: left; position: relative; }
.contact:hover { background: var(--hover); }
.contact.active { background: var(--accent-soft); }
.contact .who { min-width: 0; flex: 1; }
.contact .nm { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .ps { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact.off { opacity: .6; }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.request { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0 6px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.request .who { flex: 1; min-width: 0; }
.request button { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; }
.request .ok { background: var(--accent); color: #fff; }
.request .no { color: var(--muted); }
.list-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.side-foot { display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); }

/* Pestañas */
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; overflow-x: auto; flex: none; scrollbar-width: none; }
.tabs:empty { display: none; }
.tab { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 11px; border-radius: 9px 9px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; max-width: 180px; }
.tab span.t { overflow: hidden; text-overflow: ellipsis; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); clip-path: inset(-2px -2px 0 -2px); }
.tab.flash { color: var(--accent); font-weight: 600; animation: blink 1s steps(2) infinite; }
.tab .x { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; opacity: .5; }
.tab .x:hover { background: var(--hover); opacity: 1; }
.tab .x svg { width: 11px; height: 11px; }
@keyframes blink { 50% { opacity: .45; } }

/* Conversación */
.empty { flex: 1; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 24px; }
.empty p { max-width: 260px; margin: 6px auto 0; }
.conv { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--panel); margin: 0 12px 12px; border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); }
.conv.solo { border-radius: var(--radius); margin-top: 12px; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.conv-who { min-width: 0; flex: 1; }
.conv-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.conv-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-actions { position: relative; }
.back { display: none; }

.messages { flex: 1; overflow-y: auto; padding: 18px 20px 8px; }
.day { text-align: center; font-size: 11px; color: var(--muted); margin: 14px 0 8px; letter-spacing: .03em; }
.mgroup { margin: 12px 0 4px; }
.mhead { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.mhead b { font-weight: 600; color: var(--text); }
.mhead.mine b { color: var(--muted); }
.msg { padding: 1px 0 1px 12px; word-wrap: break-word; white-space: pre-wrap; position: relative; }
.msg .tm { position: absolute; right: 0; top: 2px; font-size: 11px; color: var(--muted); opacity: 0; }
.msg:hover .tm { opacity: 1; }
.msg .emo { font-size: 1.25em; line-height: 1; vertical-align: -2px; }
.msg.big { font-size: 34px; line-height: 1.15; }
.msg a { color: var(--accent); }
.sys { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0; }
.sys.nudge { color: var(--busy); font-weight: 600; }
.file { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 3px 0; text-decoration: none; color: var(--text); max-width: 100%; }
.file:hover { border-color: var(--accent); }
.file .fi { width: 32px; height: 32px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.file .fn { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-msg { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; }
.typing { height: 22px; padding: 0 20px; font-size: 12px; color: var(--muted); font-style: italic; }

.composer { border-top: 1px solid var(--line); padding: 8px 12px 12px; }
.tools { display: flex; align-items: center; gap: 2px; position: relative; margin-bottom: 6px; }
.tool { width: 32px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); font-size: 17px; }
.tool:hover, .tool.on { background: var(--hover); color: var(--text); }
.tool.on { color: var(--accent); }
.tool b, .tool i { font-size: 14px; }
.tool.color { cursor: pointer; }
.tool.color input { position: absolute; opacity: 0; width: 0; height: 0; }
.tool.color span { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }
.sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-row textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; }
.emo-panel { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; z-index: 20; }
.emo-panel button { width: 34px; height: 34px; border-radius: 7px; font-size: 20px; }
.emo-panel button:hover { background: var(--hover); }

/* Zumbido */
.shake { animation: shake .55s linear 2; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-7px, 3px); } 20% { transform: translate(6px, -4px); } 30% { transform: translate(-6px, -2px); }
  40% { transform: translate(7px, 4px); } 50% { transform: translate(-4px, 4px); } 60% { transform: translate(5px, -3px); }
  70% { transform: translate(-6px, 2px); } 80% { transform: translate(4px, -4px); } 90% { transform: translate(-3px, 3px); }
}

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 30, .35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; width: 100%; max-width: 380px; display: grid; gap: 14px; max-height: 90dvh; overflow-y: auto; }
.modal-card h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-card label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.modal-card .row { display: flex; gap: 8px; justify-content: flex-end; }
.modal-card .center { display: flex; align-items: center; gap: 14px; }
.check-row { display: flex !important; align-items: center; justify-content: space-between; font-size: 13px !important; color: var(--text) !important; }
.check-row input { width: auto; }

/* Avisos (toast) */
.toasts { position: fixed; right: 16px; bottom: 132px; display: grid; gap: 8px; z-index: 60; }
.toast { display: flex; gap: 11px; align-items: center; width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13px; animation: up .25s ease-out; cursor: pointer; }
.toast .tx { min-width: 0; }
.toast .tx b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .tx span { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .main { display: none; }
  .app.in-conv .side { display: none; }
  .app.in-conv .main { display: flex; }
  .tabs { display: none; }
  .conv, .conv.solo { margin: 0; border: 0; border-radius: 0; }
  .back { display: grid; margin-left: -8px; }
  .messages { padding: 14px 14px 6px; }
  .toasts { left: 12px; right: 12px; top: 12px; bottom: auto; }
  .toast { width: auto; }
}

/* Foto del contacto ampliada */
.avatar.zoomable { cursor: zoom-in; border: 0; padding: 0; }
.avatar.zoomable:hover { filter: brightness(.95); }
.avatar.xxl { width: 220px; height: 220px; font-size: 80px; border-radius: 22px; box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--st, var(--offline)); }
.photo-view { display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 6px; }
.photo-view .avatar { margin-bottom: 10px; }
.pv-name { display: flex; align-items: center; gap: 7px; font-size: 17px; }
.pv-psm { font-size: 13px; color: var(--muted); max-width: 300px; overflow-wrap: anywhere; }

/* Mensajes de voz */
.voice { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border: 1px solid var(--line); border-radius: 22px; margin: 3px 0; max-width: 100%; white-space: normal; }
.vplay { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.vplay svg { width: 15px; height: 15px; fill: currentColor; }
.vplay .ic-pause, .voice.playing .ic-play { display: none; }
.voice.playing .ic-pause { display: block; stroke-width: 2.4; }
.vwave { display: flex; align-items: center; gap: 2px; height: 26px; width: 150px; cursor: pointer; }
.vwave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--offline); }
.vwave i.on { background: var(--accent); }
.vtime { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.rec-bar #recTime { font-variant-numeric: tabular-nums; flex: 1; color: var(--muted); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--busy); animation: blink 1s infinite; }
.rec-label { font-weight: 600; }

/* Fotos predeterminadas */
.presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.preset { aspect-ratio: 1; border-radius: 10px; background: center/cover no-repeat; box-shadow: 0 0 0 1px var(--line); transition: transform .12s; }
.preset:hover { transform: scale(1.06); }
.preset.sel { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
@media (max-width: 420px) { .presets { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Conversaciones de grupo ---------- */
.avatar[data-st=group] { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ff7ab6)); color: #fff; box-shadow: none; }
.avatar[data-st=group] .gicon { width: 62%; height: 62%; stroke: #fff; stroke-width: 1.8; }
.tab-g { display: grid; place-items: center; width: 14px; height: 14px; color: var(--accent); }
.tab-g .gicon { width: 14px; height: 14px; stroke-width: 2; }
.pick-list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; margin: 0 -6px; }
.pick { display: flex !important; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 14px !important; color: var(--text) !important; }
.pick:hover { background: var(--hover); }
.pick input { width: 16px; height: 16px; accent-color: var(--accent); }
.pick .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Guiños ---------- */
.conv { position: relative; }
.wink-layer { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; border-radius: inherit; transition: opacity .4s; }
.wink-layer.fixed { position: fixed; }
.wink-layer.out { opacity: 0; }
.wink-layer.night { background: radial-gradient(ellipse at 50% 30%, rgba(28, 18, 78, .88), rgba(4, 4, 18, .95)); animation: wfade 3.2s both; }
.wink-layer.gloom { background: rgba(70, 90, 120, .28); animation: wfade 3.2s both; }
.wink-layer.disco { animation: disco 3.2s both; }
@keyframes wfade { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes disco {
  0% { background: transparent; } 10% { background: rgba(255, 0, 110, .18); } 25% { background: rgba(58, 134, 255, .18); }
  40% { background: rgba(255, 190, 11, .18); } 55% { background: rgba(131, 56, 236, .18); } 70% { background: rgba(6, 214, 160, .18); } 100% { background: transparent; }
}
.wk { position: absolute; line-height: 1; user-select: none; will-change: transform, opacity; }
.wk.center { transform: translate(-50%, -50%); }
.wk.conf { border-radius: 2px; }
.wk.spark { width: 9px; height: 9px; border-radius: 50%; }
.wk.wtext { font-weight: 800; letter-spacing: .02em; white-space: nowrap; text-shadow: 0 3px 0 rgba(0, 0, 0, .25), 0 0 18px rgba(0, 0, 0, .25); }
.wink-panel { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; grid-template-columns: repeat(6, 76px); gap: 4px; z-index: 20; }
.wink-panel button { display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: 9px; font-size: 11px; color: var(--muted); line-height: 1.15; }
.wink-panel button span { font-size: 28px; }
.wink-panel button:hover { background: var(--hover); color: var(--text); }
.wink-line .wi { font-size: 16px; vertical-align: -2px; }
.wink-line .link { font-size: 12px; color: var(--accent); }
@media (max-width: 760px) { .wink-panel { grid-template-columns: repeat(4, 1fr); left: -4px; right: -4px; } }

/* ---------- Fondos de conversación ---------- */
.messages { background-color: transparent; background-attachment: local; }
.bg-cielo .messages { background-image: linear-gradient(180deg, color-mix(in srgb, #4fa3ff 16%, transparent), color-mix(in srgb, #4fa3ff 3%, transparent)); }
.bg-atardecer .messages { background-image: linear-gradient(160deg, color-mix(in srgb, #ff7a59 16%, transparent), color-mix(in srgb, #ffc371 12%, transparent) 60%, transparent); }
.bg-menta .messages { background-image: linear-gradient(180deg, color-mix(in srgb, #2ec4b6 16%, transparent), color-mix(in srgb, #cbf3f0 10%, transparent)); }
.bg-lavanda .messages { background-image: linear-gradient(200deg, color-mix(in srgb, #9b5de5 16%, transparent), color-mix(in srgb, #f15bb5 8%, transparent)); }
.bg-puntos .messages { background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1.4px, transparent 1.6px); background-size: 18px 18px; }
.bg-cuadricula .messages { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
.bg-corazones .messages { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M14 20c-3-4-9-2-8 3 1 4 8 8 8 8s7-4 8-8c1-5-5-7-8-3z' fill='%23ff5d8f' fill-opacity='.16'/%3E%3Cpath d='M42 46c-2-3-7-1-6 2 1 3 6 6 6 6s5-3 6-6c1-3-4-5-6-2z' fill='%23ff5d8f' fill-opacity='.12'/%3E%3C/svg%3E"); }
.bg-estrellas .messages { background-image: radial-gradient(1.5px 1.5px at 20px 30px, color-mix(in srgb, var(--text) 35%, transparent), transparent), radial-gradient(1px 1px at 90px 70px, color-mix(in srgb, var(--text) 30%, transparent), transparent), radial-gradient(2px 2px at 150px 20px, color-mix(in srgb, var(--accent) 50%, transparent), transparent), radial-gradient(1px 1px at 60px 140px, color-mix(in srgb, var(--text) 30%, transparent), transparent), linear-gradient(180deg, color-mix(in srgb, #3a0ca3 12%, transparent), transparent); background-size: 180px 180px, 180px 180px, 180px 180px, 180px 180px, 100% 100%; }
.bg-custom .messages { background-image: linear-gradient(var(--bg-veil), var(--bg-veil)), var(--bg-img); background-size: cover; background-position: center; }
:root { --bg-veil: rgba(255, 255, 255, .62); }
:root[data-dark] { --bg-veil: rgba(10, 12, 16, .58); }

/* ---------- Apariencia ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--hover); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { padding: 7px 4px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.bgs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bgopt { aspect-ratio: 1.2; border-radius: 10px; border: 1px solid var(--line); background-color: var(--panel); position: relative; overflow: hidden; font-size: 10px; color: var(--muted); display: grid; align-items: end; padding: 4px; text-align: center; }
.bgopt .messages { position: absolute; inset: 0; padding: 0; overflow: hidden; }
.bgopt span { position: relative; }
.bgopt.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.section-t { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

.foot-l { display: flex; gap: 14px; }

/* ---------- Visto y mensajes temporales ---------- */
.receipt { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); margin: 2px 0 0; padding-right: 2px; }
.receipt .ticks { width: 16px; height: 11px; stroke: var(--accent); stroke-width: 1.8; }
.eph-badge { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.msg .tm .eph { font-size: 10px; }

/* ---------- Lista: vista por grupos ---------- */
.view-sw { display: flex; align-items: center; gap: 4px; padding: 2px 8px 4px; font-size: 12px; color: var(--muted); }
.view-sw button { padding: 2px 8px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.view-sw button.on { background: var(--hover); color: var(--text); font-weight: 600; }
.group-h { justify-content: space-between; padding-right: 4px; border-radius: 8px; }
.group-h .gh-t { display: flex; align-items: center; gap: 6px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; flex: 1; text-align: left; min-width: 0; }
.group-h .gh-t svg { width: 10px; height: 10px; transition: transform .15s; flex: none; }
.group-h.closed .gh-t svg { transform: rotate(-90deg); }
.group-h .gh-more { opacity: 0; font-size: 16px; line-height: 1; padding: 0 6px; color: var(--muted); border-radius: 6px; }
.group-h:hover .gh-more, .group-h .gh-more:focus { opacity: 1; }
@media (hover: none) { .group-h .gh-more { opacity: 1; } }
.group-h.drop { background: var(--accent-soft); color: var(--accent); }
.new-cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 8px; margin-top: 6px; border-radius: 10px; color: var(--muted); font-size: 13px; }
.new-cat:hover { background: var(--hover); color: var(--accent); }
.new-cat svg { width: 16px; height: 16px; }

/* ---------- Tinta ---------- */
.modal-card.wide { max-width: 640px; }
.ink-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ink-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.ink-colors, .ink-sizes, .ink-acts { display: flex; gap: 6px; align-items: center; }
.swatch.sm { width: 22px; height: 22px; }
.ink-sizes button, .ink-acts button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.ink-sizes button i { display: block; border-radius: 50%; background: currentColor; }
.ink-sizes button.on, .ink-acts button:hover, .ink-sizes button:hover { background: var(--hover); color: var(--text); }
#inkCanvas { width: 100%; height: 320px; border-radius: 12px; border: 1px solid var(--line); background: #fff; touch-action: none; cursor: crosshair; display: block; }
@media (max-width: 600px) { #inkCanvas { height: 52dvh; } }
.img-msg.ink-msg { background: #fff; max-width: min(300px, 100%); padding: 2px; }

/* ---------- Exportar, cuenta, admin ---------- */
.export-opts { display: grid; gap: 8px; }
.exp { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.exp:hover { border-color: var(--accent); background: var(--accent-soft); }
.exp span { font-size: 12px; color: var(--muted); }
.acc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-btns .btn { font-size: 13px; padding: 7px 12px; }
.danger-btn { color: var(--danger); }
.btn.primary.danger-bg { background: var(--danger); border-color: var(--danger); }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adm-tabs { grid-template-columns: repeat(3, auto); }
.adm-tabs button { padding: 6px 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.stats b { font-size: 20px; font-weight: 700; }
.stats span { font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.adm-new { display: flex; gap: 8px; }
.adm-new input { flex: 1; min-width: 0; }
.adm-list { display: grid; gap: 2px; max-height: 52dvh; overflow-y: auto; margin: 0 -6px; }
.adm-user { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.adm-user:hover { background: var(--hover); }
.au-info { flex: 1; min-width: 0; }
.au-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
.on-txt { color: var(--online); }
.pw-box { display: flex; gap: 8px; align-items: center; }
.pw-box code { flex: 1; font-size: 18px; letter-spacing: .06em; background: var(--hover); padding: 10px 12px; border-radius: 9px; user-select: all; }
.side-foot { gap: 8px; }
.foot-l { gap: 12px; }

/* ---------- App instalable ---------- */
.pwa-card { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.pwa-card .pc-ic { width: 36px; height: 36px; flex: none; border-radius: 9px; overflow: hidden; display: grid; place-items: center; }
.pwa-card .pc-ic img { width: 100%; height: 100%; }
.pwa-card .pc-ic.bell { background: var(--accent); color: #fff; }
.pwa-card .pc-t { flex: 1; min-width: 0; display: grid; font-size: 13px; line-height: 1.3; }
.pwa-card .pc-t span { font-size: 12px; color: var(--muted); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.pc-x { width: 24px; height: 24px; border-radius: 6px; color: var(--muted); font-size: 18px; line-height: 1; flex: none; }
.pc-x:hover { background: var(--hover); }
.ios-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; line-height: 1.45; }
svg.inl { width: 16px; height: 16px; vertical-align: -3px; color: var(--accent); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 70; text-align: center; font-size: 12px; font-weight: 600; padding: 6px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--away); color: #1f2937; }

/* Pantallas con muesca y app instalada: respetar las zonas seguras */
.side { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); }
.side-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
@media (max-width: 760px) {
  .conv-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) { body { overscroll-behavior: none; } }

.splash { position: fixed; inset: 0; z-index: 65; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); color: var(--muted); font-size: 14px; }
.splash img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .75; } }

.push-st { font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.push-st.ok b { color: var(--online); }
.push-st.ko { background: color-mix(in srgb, var(--away) 12%, transparent); }

/* ---------- Pie de la lista con iconos ---------- */
.foot-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 5px 6px; margin: -5px -6px; border-radius: 8px; }
.foot-btn svg { width: 16px; height: 16px; stroke-width: 1.6; flex: none; }
.foot-btn:hover { color: var(--accent); background: var(--hover); }
#logoutBtn:hover { color: var(--danger); }
.side-foot { align-items: center; }
.foot-l { display: flex; gap: 14px; }
@media (max-width: 400px) { .foot-l .foot-btn span { display: none; } .foot-l { gap: 18px; } }

/* ---------- Vista previa de enlaces ---------- */
.lp, .poll, .loc { white-space: normal; color: var(--text); font-weight: 400; font-style: normal; }
.lp:empty { display: none; }
.lp { margin: 6px 0 2px; max-width: 420px; }
.lp.web a { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; background: var(--panel); }
.lp.web a:hover { border-color: var(--accent); }
.lp-img { width: 100%; max-height: 210px; object-fit: cover; display: block; background: var(--hover); }
.lp-txt { display: grid; gap: 3px; padding: 10px 12px 11px; min-width: 0; }
.lp-txt b { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-site { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lp-site img { width: 14px; height: 14px; border-radius: 3px; }
.lp-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp.yt { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.yt-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; background: #000 center/cover no-repeat; }
.yt-play { width: 58px; height: 40px; border-radius: 12px; background: rgba(230, 33, 23, .92); display: grid; place-items: center; transition: transform .15s; }
.yt-thumb:hover .yt-play { transform: scale(1.08); }
.yt-play svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
.yt-box { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Encuestas ---------- */
.poll { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 4px 0; max-width: 380px; background: var(--panel); display: grid; gap: 6px; }
.poll-h { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.poll-h svg { width: 14px; height: 14px; stroke-width: 2; color: var(--accent); }
.poll-q { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.poll-o { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; text-align: left; overflow: hidden; font-size: 14px; }
.poll-o:not(:disabled):hover { border-color: var(--accent); }
.poll-o:disabled { cursor: default; }
.po-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); transition: width .3s; z-index: 0; }
.poll-o > span:not(.po-bar) { position: relative; z-index: 1; }
.po-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; flex: none; }
.poll-o.mine { border-color: var(--accent); }
.poll-o.mine .po-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.po-t { flex: 1; min-width: 0; }
.po-n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.poll-f { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pq-opts { display: grid; gap: 6px; }
.pq-row { display: flex; gap: 6px; align-items: center; }
.pq-row input { flex: 1; }

/* ---------- Ubicación ---------- */
.loc { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-width: 340px; margin: 4px 0; background: var(--panel); }
.loc-map { position: relative; height: 150px; background: var(--hover); }
.loc-map.big { height: 240px; border-radius: 12px; overflow: hidden; }
.loc-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.loc .loc-map iframe { pointer-events: none; }
.loc-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; text-decoration: none; color: inherit; font-size: 13px; }
.loc-f span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.loc-f svg { width: 16px; height: 16px; color: var(--danger); }
.loc-f b { color: var(--accent); font-weight: 600; }
.loc-f:hover b { text-decoration: underline; }

/* ---------- Respuesta automática ---------- */
.auto-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--hover); padding: 1px 6px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.ar-text { resize: vertical; }
.ar-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex !important; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 13px !important; color: var(--text) !important; cursor: pointer; }
.chip input { width: auto; accent-color: var(--accent); }

/* ---------- Menú «Más» ---------- */
.menu.up { top: auto; bottom: 100%; margin-bottom: 8px; }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
#moreTools { left: 120px; }

/* ---------- Calendario compartido ---------- */
.modal-card.xwide { max-width: 920px; }
.cal { display: grid; gap: 14px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-title { display: grid; }
.cal-title h2 { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 0 4px; }
.cal-day { min-height: 72px; border-radius: 9px; border: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; align-items: stretch; text-align: left; overflow: hidden; position: relative; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.other { opacity: .45; }
.cal-day.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cd-n { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cd-n { background: var(--accent); color: #fff; }
.cd-ev { font-size: 10.5px; line-height: 1.25; padding: 1px 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 2.5px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-ev i { font-style: normal; color: var(--muted); }
.cd-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
.cd-dots { display: none; gap: 2px; justify-content: center; margin-top: auto; }
.cd-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-side { display: grid; gap: 10px; align-content: start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 200px; }
.cal-side label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.cal-side input, .cal-side textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); outline: none; }
.cs-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cs-list { display: grid; gap: 6px; }
.cs-ev { display: grid; gap: 1px; text-align: left; padding: 8px 10px; border-radius: 9px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); }
.cs-ev:hover { background: color-mix(in srgb, var(--c) 16%, transparent); }
.cs-t { font-weight: 600; font-size: 14px; }
.cs-m { font-size: 12px; color: var(--muted); }
.cs-n { font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.cs-empty { padding: 8px 2px; }
.ev-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ev-cols { gap: 8px; }
.ev-btns { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .cal-body { grid-template-columns: 1fr; }
  .cal-day { min-height: 46px; }
  .cd-ev, .cd-more { display: none; }
  .cd-dots { display: flex; }
}

/* Pie como barra: icono encima y texto debajo, caben los cuatro */
.side-foot { display: flex; justify-content: space-around; align-items: stretch; padding: 8px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); gap: 2px; }
.side-foot .foot-l { display: contents; }
.foot-btn { flex: 1; flex-direction: column; gap: 3px; margin: 0; padding: 6px 2px; font-size: 11px; white-space: nowrap; border-radius: 10px; }
.foot-btn svg { width: 19px; height: 19px; }
@media (max-width: 400px) { .foot-l .foot-btn span { display: inline; } }

/* ---------- Imagen y descripción del grupo ---------- */
.avatar[data-st=group].has-img { background-color: var(--accent-soft); }
.ge-count { float: right; font-size: 11px; color: var(--muted); }
.photo-view .link { font-size: 13px; color: var(--accent); }

/* ---------- Visor de imágenes ---------- */
.img-msg { cursor: zoom-in; }
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 14, .97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; flex-direction: column; opacity: 0; transition: opacity .18s; color: #fff; }
.viewer.in { opacity: 1; }
.vw-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); flex: none; }
.vw-who { display: grid; min-width: 0; }
.vw-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-who span { font-size: 12px; opacity: .65; }
.vw-acts { display: flex; gap: 6px; }
.vw-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 600; }
.vw-btn:hover { background: rgba(255, 255, 255, .2); }
.vw-btn svg { width: 19px; height: 19px; stroke-width: 1.8; }
.vw-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 56px 40px; overflow: hidden; }
.vw-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; animation: vwIn .2s ease-out; }
.vw-stage img.ink { background: #fff; padding: 8px; }
.vw-stage.zoom { overflow: auto; place-items: start; padding: 0; }
.vw-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
@keyframes vwIn { from { transform: scale(.96); opacity: .4; } }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .1); }
.vw-nav:hover { background: rgba(255, 255, 255, .22); }
.vw-nav svg { width: 22px; height: 22px; stroke-width: 2; }
.vw-nav.prev { left: 10px; } .vw-nav.next { right: 10px; }
.vw-nav[hidden] { display: none; }
.vw-count { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 12px; opacity: .7; }
@media (max-width: 760px) { .vw-stage { padding: 4px 4px 36px; } .vw-nav { display: none; } .vw-btn span { display: none; } }

/* ---------- Marca ---------- */
.brand { letter-spacing: -.02em; }
.brand span { color: var(--accent); }

/* ---------- Acceso: repetir contraseña e invitación ---------- */
.pw-hint { font-size: 12px; min-height: 0; }
.pw-hint.ok { color: var(--online); }
.pw-hint.ko { color: var(--danger); }
.invite-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; line-height: 1.35; text-align: left; }
.invite-banner.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.add-invite { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.add-invite .btn, .inv-share .btn, .inv-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 7px 12px; }
.add-invite svg, .inv-share svg { width: 16px; height: 16px; }
.inv-link { display: flex; gap: 8px; }
.inv-link input { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.inv-share { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Fondo de la cabecera del perfil ---------- */
.me-wrap { position: relative; z-index: 2; }
.me-wrap > *:not(.me-cover-clip) { position: relative; z-index: 1; }
.me-cover-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.me-cover { position: absolute; inset: 0; background: center/cover no-repeat; opacity: 0; transition: opacity .3s; }
.me-wrap.has-cover .me-cover { opacity: 1; }
.me-cover.blur { filter: blur(14px) saturate(1.15); transform: scale(1.12); }
.me-wrap.has-cover { padding-bottom: 8px; }
.me-wrap.has-cover .search-row input { border: 0; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.me-wrap.tone-dark { color: #fff; --muted: rgba(255, 255, 255, .78); --hover: rgba(255, 255, 255, .14); }
.me-wrap.tone-dark .me-name, .me-wrap.tone-dark .status-btn, .me-wrap.tone-dark .psm-input, .me-wrap.tone-dark .icon-btn { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.me-wrap.tone-dark .status-btn, .me-wrap.tone-dark .psm-input { color: rgba(255, 255, 255, .85); }
.me-wrap.tone-dark .psm-input::placeholder { color: rgba(255, 255, 255, .78); }
.me-wrap.tone-dark .search-row input { background: rgba(255, 255, 255, .16); color: #fff; }
.me-wrap.tone-dark .search-row input::placeholder { color: rgba(255, 255, 255, .78); }
.me-wrap.tone-dark .avatar { box-shadow: 0 0 0 2px rgba(0, 0, 0, .15), 0 0 0 3.5px var(--st, var(--offline)); }
.me-wrap.tone-light { color: #1f2937; --muted: rgba(31, 41, 55, .72); --hover: rgba(255, 255, 255, .45); }
.me-wrap.tone-light .me-name, .me-wrap.tone-light .icon-btn { color: #1f2937; }
.me-wrap.tone-light .status-btn, .me-wrap.tone-light .psm-input { color: rgba(31, 41, 55, .78); }
.me-wrap.tone-light .search-row input { background: rgba(255, 255, 255, .55); color: #1f2937; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.me-wrap.tone-light .search-row input::placeholder { color: rgba(31, 41, 55, .6); }
.me-wrap.tone-light .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 0 0 3.5px var(--st, var(--offline)); }
.me-wrap.has-cover .pwa-card { background: rgba(255, 255, 255, .5); color: #1f2937; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.me-wrap.has-cover .pwa-card .pc-t span { color: rgba(31, 41, 55, .7); }
.me-wrap .menu { color: var(--text); }
.covers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cov { aspect-ratio: 1.6; border-radius: 10px; background: center/cover no-repeat var(--hover); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.cov.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.cov.own:not([style*="background-image"]) span { text-align: center; }
.cov.own[style*="background-image"] span { background: rgba(0, 0, 0, .45); color: #fff; padding: 1px 6px; border-radius: 6px; }
.only-you { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 8px; margin-left: 6px; }
.me-wrap > .me { z-index: 3; }
.inv-share a.btn { color: var(--text); }
.inv-share a.btn:hover { border-color: var(--accent); }
#invReset { color: var(--accent); font-size: 12px; }

/* =====================================================================
   ADAPTACIÓN AUTOMÁTICA A MÓVILES Y TABLETS
   ===================================================================== */

/* Avisos: nunca más anchos que la pantalla */
.toast { min-width: 0; max-width: 100%; }
.toasts { max-width: calc(100vw - 24px); }
.btn.sm { white-space: nowrap; }
button, a, label, input, select, textarea { touch-action: manipulation; }

/* --- Pantallas táctiles (móviles y tablets) --- */
@media (pointer: coarse) {
  /* 16px en los campos: evita que el iPhone amplíe la página al tocarlos */
  input:not([type=checkbox]):not([type=radio]):not([type=color]), textarea, select,
  .input-row textarea, .psm-input, .search-row input { font-size: 16px !important; }
  /* Botones con tamaño cómodo para el dedo */
  .tool { width: 40px; height: 40px; font-size: 19px; }
  .tool svg { width: 20px; height: 20px; }
  .icon-btn { width: 40px; height: 40px; }
  .me-name { padding: 4px 0; }
  .status-btn { padding: 6px 0; font-size: 13px; }
  .view-sw button { padding: 7px 12px; font-size: 13px; }
  .group-h { min-height: 38px; }
  .group-h .gh-more { padding: 6px 10px; opacity: 1; }
  .contact { padding: 9px 8px; min-height: 52px; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
  .menu button { padding: 12px 12px; font-size: 15px; }
  .poll-f .link, #pqAdd, .link { padding: 8px 0; display: inline-block; }
  .pc-x { width: 36px; height: 36px; }
  .pq-row .pc-x { width: 40px; height: 40px; }
  .poll-o { padding: 12px 10px; }
  .check-row { min-height: 40px; }
  .check-row input { width: 22px; height: 22px; }
  .swatch.sm { width: 30px; height: 30px; }
  .tab .x { width: 26px; height: 26px; }
  /* Sin ratón no hay «pasar por encima»: la hora de cada mensaje se ve siempre */
  .msg .tm { opacity: .55; position: static; float: right; margin-left: 8px; font-size: 10px; }
  .emo-panel { grid-template-columns: repeat(8, 38px); }
  .emo-panel button { width: 38px; height: 38px; font-size: 22px; }
}

/* --- Móviles (hasta 760px): app a pantalla completa que sigue al teclado --- */
@media (max-width: 760px) {
  .app { height: var(--vvh, 100dvh); }
  /* En iPhone, al abrir el teclado la app se recoloca en la parte visible */
  html.kb-open .app { position: fixed; left: 0; right: 0; top: var(--vvt, 0); }
  .conv-head { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; }
  .conv-name b { font-size: 16px; }
  .messages { padding: 12px 12px 6px; }
  .composer { padding: 6px 8px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .tools { gap: 0; justify-content: space-between; margin-bottom: 4px; }
  .sep { margin: 0 2px; }
  .input-row textarea { padding: 9px 12px; border-radius: 20px; }
  .input-row .btn.primary { border-radius: 20px; padding: 9px 16px; }
  .img-msg { max-width: min(260px, 100%); }
  .lp, .poll, .loc { max-width: 100%; }
  .me { padding: 14px 14px 10px; }
  .search-row { padding: 0 12px 8px; }
  .list { padding: 4px 6px 12px; }
}
/* Muy estrechos (320px): la barra de herramientas cabe sin saltar de línea */
@media (max-width: 360px) {
  .tool { width: 34px; }
  .tools .sep { display: none; }
  .input-row .btn.primary { padding: 9px 12px; }
  .me .avatar.lg { width: 48px; height: 48px; }
}

/* --- Ventanas como hoja que sube desde abajo en móviles --- */
@media (max-width: 600px) {
  .modal { align-items: end; padding: 0; top: var(--vvt, 0); bottom: auto; height: var(--vvh, 100dvh); }
  .modal-card, .modal-card.wide, .modal-card.xwide {
    max-width: 100%; width: 100%; border-radius: 18px 18px 0 0; max-height: 92%; padding: 22px 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom)); animation: sheetUp .22s cubic-bezier(.2, .8, .3, 1);
  }
  .modal-card::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: -10px auto 4px; }
  .modal-card .row { position: sticky; bottom: calc(-1 * max(18px, env(safe-area-inset-bottom))); background: var(--panel); padding: 10px 0 2px; margin-bottom: -2px; z-index: 2; }
  .modal-card .row .btn { flex: 1; justify-content: center; padding: 12px; }
  .cal-head { gap: 8px; }
  .presets { grid-template-columns: repeat(4, 1fr); }
  .covers { grid-template-columns: repeat(4, 1fr); }
  .bgs { grid-template-columns: repeat(4, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .adm-new { flex-direction: column; }
  .inv-share .btn { flex: 1; justify-content: center; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } }

/* --- Tablets (761px – 1100px): lista algo más estrecha para dejar sitio al chat --- */
@media (min-width: 761px) and (max-width: 1100px) {
  .app { grid-template-columns: 290px 1fr; }
  .conv { margin: 0 8px 8px; }
  .conv.solo { margin-top: 8px; }
  .foot-btn { font-size: 10.5px; }
}

/* --- Móvil en horizontal (poca altura): cabeceras compactas --- */
@media (max-height: 500px) and (pointer: coarse) {
  .me { padding: 8px 12px 6px; gap: 10px; }
  .me .avatar.lg { width: 42px; height: 42px; font-size: 18px; }
  .psm-input { display: none; }
  .music { display: none; }
  .search-row { padding-bottom: 6px; }
  .side-foot { padding: 4px 8px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .foot-btn { flex-direction: row; gap: 6px; padding: 6px 4px; }
  .conv-head { padding: 6px 12px; }
  .conv-head .avatar.md { width: 32px; height: 32px; }
  #cPsm { display: none; }
  .tools { margin-bottom: 2px; }
  .tool, .icon-btn { height: 34px; }
  .pwa-card { display: none !important; }
  .modal-card { max-height: 96%; }
}
@media (pointer: coarse) { .group-h .gh-t { align-self: stretch; min-height: 38px; } }
@media (pointer: coarse) { .chip { padding: 8px 14px; } }
@media (max-height: 500px) and (pointer: coarse) { .foot-btn span { display: none; } .foot-btn { justify-content: center; } }
.toast { transition: transform .15s, opacity .15s; touch-action: none; }
@media (max-width: 760px) { .toasts { top: max(10px, env(safe-area-inset-top)); } }

/* Menús flotantes (acciones de contacto, grupos y usuarios del panel de administración):
   siempre por encima de las ventanas y de los avisos */
.menu.float-menu { z-index: 85; }

/* ---------- Notas compartidas ---------- */
#notesBtn, .news-btn { position: relative; }
.notes-dot, .news-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--busy); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.news-dot { background: var(--accent); }
.notes-panel { position: absolute; right: 0; bottom: 0; top: 64px; width: 320px; z-index: 6; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); border-radius: 0 0 var(--radius) 0; box-shadow: -10px 0 30px rgba(20, 30, 50, .06);
  animation: npIn .18s ease-out; }
@keyframes npIn { from { transform: translateX(16px); opacity: 0; } }
.np-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.np-title { flex: 1; min-width: 0; display: grid; }
.np-title b { font-size: 15px; }
.np-body { flex: 1; overflow-y: auto; padding: 12px 16px 16px; display: grid; gap: 18px; align-content: start; overscroll-behavior: contain; }
.np-sec { display: grid; gap: 8px; }
.np-sec-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.np-saved, .np-count { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 11.5px; }
#npText { width: 100%; min-height: 96px; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--away) 7%, var(--panel));
  color: var(--text); font: inherit; line-height: 1.5; outline: none; }
#npText:focus { border-color: var(--accent); }
.np-conflict { display: grid; gap: 4px; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, var(--away) 16%, var(--panel)); }
.np-cf-btns { display: flex; gap: 14px; }
.np-add { display: flex; gap: 6px; align-items: center; }
.np-add input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); outline: none; font: inherit; }
.np-add input:focus { border-color: var(--accent); }
.np-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.np-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 4px; border-radius: 8px; }
.np-item:hover { background: var(--hover); }
.np-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.6px solid var(--offline); display: grid; place-items: center; color: transparent; }
.np-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.np-check:hover { border-color: var(--accent); }
.np-item.done .np-check { background: var(--online); border-color: var(--online); color: #fff; }
.np-t { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: text; padding-top: 1px; }
.np-item.done .np-t { text-decoration: line-through; color: var(--muted); }
.np-edit { flex: 1; min-width: 0; padding: 2px 6px; margin: -2px 0; border: 1px solid var(--accent); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; outline: none; }
.np-del { flex: none; width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; opacity: 0; }
.np-del svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.np-item:hover .np-del, .np-del:focus-visible { opacity: 1; }
.np-del:hover { color: var(--danger); background: var(--hover); }
.np-empty { color: var(--muted); font-size: 12.5px; padding: 4px; }
#npClear { justify-self: start; }
@media (hover: none) { .np-del { opacity: .7; } }
@media (pointer: coarse) {
  .np-check { width: 24px; height: 24px; }
  .np-del { width: 32px; height: 32px; margin: -4px -4px -4px 0; }
  .np-item { padding: 8px 4px; }
  .np-add input, .np-edit, #npText { font-size: 16px; }
}
/* Pantallas anchas: el chat se estrecha para que las notas no tapen los mensajes */
@media (min-width: 1180px) {
  .conv.with-notes > .messages, .conv.with-notes > .typing, .conv.with-notes > .composer { margin-right: 320px; }
}
/* Móviles: las notas ocupan toda la conversación, por debajo de la cabecera */
@media (max-width: 760px) {
  .notes-panel { width: 100%; border-left: 0; border-radius: 0; box-shadow: none; animation-name: npUp; }
  .np-body { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  @keyframes npUp { from { transform: translateY(16px); opacity: 0; } }
}

/* ---------- Enlace en el mensaje personal ---------- */
.psm-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-weight: 500; cursor: pointer; vertical-align: bottom; }
.psm-link svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.psm-link:hover span { text-decoration: underline; }
.contact .ps .psm-link { padding: 0 2px; margin: 0 -2px; border-radius: 4px; }
.contact .ps .psm-link:hover { background: var(--accent-soft); }

/* ---------- Novedades ---------- */
.me-wrap > .news-btn { position: absolute; top: 10px; right: 10px; z-index: 4; }
.news-btn svg { fill: none; }
.news-head { display: flex; align-items: center; gap: 12px; }
.news-head h2 { margin: 0; }
.news-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.news-badge svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.news-list { display: grid; gap: 12px; }
.news-entry { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.news-entry.fresh { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.ne-h { display: flex; align-items: center; gap: 8px; }
.ne-h b { font-size: 15px; }
.ne-new { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--accent); border-radius: 20px; padding: 2px 8px; }
.ne-meta { font-size: 12px; color: var(--muted); margin-top: -4px; }
.ne-items { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.ne-items li { display: flex; gap: 10px; align-items: flex-start; }
.ne-ic { width: 26px; text-align: center; font-size: 17px; line-height: 1.3; flex: none; }
.ne-items b { display: block; font-weight: 600; }
.ne-items span { color: var(--muted); font-size: 13px; }
.ne-body { margin: 0; overflow-wrap: anywhere; }
.news-post { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.news-post summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.news-post[open] { display: grid; gap: 8px; }
.news-post input, .news-post textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); font: inherit; outline: none; resize: vertical; }
.news-post .btn { justify-self: start; }
.np-conflict .link, #npClear { color: var(--accent); }
#notesBtn.on { background: var(--accent-soft); color: var(--accent); }
.np-body, .np-sec { grid-template-columns: minmax(0, 1fr); }
.np-body { overflow-x: hidden; }

/* ---------- Gastos: icono de cabecera ---------- */
#expBtn svg { fill: none; }

/* ---------- Cuenta atrás fijada ---------- */
.cd-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; text-align: left; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, var(--panel)), var(--panel)); color: var(--text); }
.cd-bar:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.cd-bar.done { background: linear-gradient(90deg, color-mix(in srgb, var(--online) 14%, var(--panel)), var(--panel)); }
.cd-emo { font-size: 22px; line-height: 1; flex: none; }
.cd-txt { flex: 1; min-width: 0; display: grid; }
.cd-txt b { font-weight: 600; font-size: 13.5px; }
.cd-when { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.cd-left { display: flex; gap: 6px; flex: none; }
.cd-u { display: grid; justify-items: center; min-width: 34px; padding: 3px 5px; border-radius: 8px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.cd-u b { font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cd-u i { font-style: normal; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cd-done { font-weight: 700; color: var(--online); }
.cd-emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-emojis button { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; box-shadow: 0 0 0 1px var(--line); }
.cd-emojis button.sel { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cd-dt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .cd-u { min-width: 30px; padding: 2px 4px; } .cd-u b { font-size: 13.5px; } .cd-bar { gap: 8px; padding: 7px 12px; } }

/* ---------- Ver vídeos juntos ---------- */
.watch-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 20px; background: #e62117; color: #fff; font-size: 12.5px; font-weight: 600; flex: none; animation: up .25s; }
.watch-pill:hover { filter: brightness(1.08); }
.wp-dot, .wr-live { width: 7px; height: 7px; border-radius: 50%; background: #fff; display: inline-block; animation: blink 1.4s infinite; flex: none; }
.watch-room { border-bottom: 1px solid var(--line); background: #0b0d10; color: #fff; display: grid; }
.wr-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; }
.wr-head .wr-live { background: #ff4d4d; }
.wr-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.watch-room .icon-btn { color: rgba(255, 255, 255, .75); width: 32px; height: 32px; }
.watch-room .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.wr-stage { position: relative; width: min(100%, calc(36vh * 16 / 9)); aspect-ratio: 16 / 9; justify-self: center; background: #000; }
.wr-stage iframe, .wr-stage > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wr-sync { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 30px;
  background: rgba(230, 33, 23, .95); color: #fff; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); z-index: 2; }
.wr-sync svg { width: 18px; height: 18px; fill: #fff; }
.wr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px 8px; }
.wr-foot .muted { color: rgba(255, 255, 255, .6) !important; }
.wr-foot .danger-btn { color: #ff8a80; font-size: 12px; }
.watch-room.min .wr-stage { height: 0; aspect-ratio: auto; overflow: hidden; }
.watch-room.min .wr-foot { display: none; }
.watch-room.min #wrMin svg { transform: rotate(180deg); }
.watch-card { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; max-width: 380px; background: var(--panel); white-space: normal; }
.wc-thumb { aspect-ratio: 16 / 9; border-radius: 8px; background: #000 center/cover; display: grid; place-items: center; cursor: pointer; }
.wc-thumb .yt-play { width: 40px; height: 28px; border-radius: 8px; }
.wc-thumb .yt-play svg { width: 16px; height: 16px; }
.wc-txt { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.wc-txt b { font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wc-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #e62117; display: inline-flex; align-items: center; gap: 6px; }
.wc-k .wr-live { background: #e62117; }
.wc-go { padding: 6px 12px; font-size: 12.5px; }
.wr-current { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--hover); font-size: 13px; }
.yt-together { color: #e62117 !important; font-weight: 600; justify-self: start; margin-top: 2px; }
@media (min-width: 1180px) { .conv.with-notes > .watch-room, .conv.with-notes > .cd-bar { margin-right: 320px; width: auto; } }
@media (max-width: 420px) { .watch-card { grid-template-columns: 96px 1fr; } }
@media (max-width: 760px) { .wr-stage { width: 100%; } .watch-pill .wp-t { display: none; } .watch-pill { padding: 0 10px; } }

/* ---------- Efectos de pantalla ---------- */
.wink-layer.fx { z-index: 39; }
.wink-layer.dusk { background: linear-gradient(180deg, rgba(20, 24, 70, .55), rgba(20, 24, 70, .15)); animation: wfade 3.4s both; }
.fx-replay { font-size: 11px; line-height: 1; padding: 0 3px 0 0; opacity: .75; vertical-align: baseline; }
.fx-replay:hover { opacity: 1; transform: scale(1.2); }

/* ---------- Cumpleaños ---------- */
.bday-banner { display: flex; align-items: center; gap: 10px; margin: 2px 4px 8px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(100deg, color-mix(in srgb, #ff006e 12%, var(--panel)), color-mix(in srgb, #ffbe0b 16%, var(--panel))); font-size: 13px; }
.bb-ic { font-size: 22px; line-height: 1; animation: bbw 2.4s ease-in-out infinite; }
@keyframes bbw { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.08); } }
.bb-t { flex: 1; min-width: 0; }
.bb-go { padding: 6px 12px; font-size: 12.5px; }
.bb-name { color: inherit; font-weight: 700; font-size: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.contact.bday .avatar { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #ff4d8d; }
.bday-cake { font-size: 13px; }
.pv-bday { font-size: 13px; margin-top: 4px; }
.bday-field { display: grid; gap: 6px; }
.bday-field .opt { font-size: 11.5px; }
.bday-sel { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.bday-sel select { width: 100%; }
.qr-open { justify-content: center; gap: 8px; }
.qr-open svg, .add-invite svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- Efectos de voz ---------- */
.vfx-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.vfx-row::-webkit-scrollbar { display: none; }
.vfx-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: none; margin-right: 2px; }
.vfx { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text); background: var(--panel); }
.vfx:hover { border-color: var(--accent); }
.vfx.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vfx span { font-size: 15px; line-height: 1; }
.rec-bar.preview .rec-dot { display: none; }
#recPlay .ic-pause, .rec-bar.playing #recPlay .ic-play { display: none; }
.rec-bar.playing #recPlay .ic-pause { display: block; }
#recPlay { color: var(--accent); }
#recPlay svg { fill: currentColor; stroke: currentColor; }
.vfx-tag { font-size: 14px; line-height: 1; margin-left: -4px; }
@media (pointer: coarse) { .vfx { padding: 8px 13px; } }

/* ---------- Gastos compartidos ---------- */
.exp-head { display: flex; align-items: center; gap: 12px; }
.exp-head .cal-title { flex: 1; }
.exp-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--online) 15%, var(--panel)); color: var(--online); flex: none; }
.exp-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.exp-body { display: grid; gap: 16px; }
.exp-sum { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: stretch; }
.exp-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.exp-card span { font-size: 12px; color: var(--muted); }
.exp-card b { font-size: 20px; font-variant-numeric: tabular-nums; }
.exp-card.pos b, .eb-v.pos { color: var(--online); }
.exp-card.neg b, .eb-v.neg { color: var(--danger); }
.exp-add { align-self: center; }
.exp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.exp-sec { display: grid; gap: 8px; min-width: 0; }
.exp-bal { display: grid; gap: 6px; }
.eb-row { display: grid; grid-template-columns: minmax(70px, 1fr) 1.2fr auto; gap: 10px; align-items: center; font-size: 13px; }
.eb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-bar { position: relative; height: 8px; border-radius: 4px; background: var(--hover); }
.eb-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.eb-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.eb-bar i.pos { left: 50%; background: var(--online); }
.eb-bar i.neg { right: 50%; background: var(--danger); }
.eb-v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 74px; }
.exp-settle { display: grid; gap: 6px; }
.es-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--hover); font-size: 13px; }
.es-row .link { color: var(--accent); white-space: nowrap; }
.es-cf { display: flex; gap: 10px; align-items: center; flex: none; }
.es-cf .btn { padding: 5px 12px; }
.exp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; }
.ei { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border-radius: 10px; }
.ei:hover { background: var(--hover); }
.ei-ic { font-size: 18px; flex: none; }
.ei-t { flex: 1; min-width: 0; display: grid; }
.ei-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-a { font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-form { display: grid; gap: 12px; max-width: 460px; }
.ex-amount { display: flex; align-items: center; gap: 8px; }
.ex-amount input { flex: 1; font-size: 18px; font-variant-numeric: tabular-nums; }
.ex-split { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-each { margin-top: 6px; }
@media (max-width: 720px) {
  .exp-cols { grid-template-columns: 1fr; }
  .exp-sum { grid-template-columns: 1fr 1fr; }
  .exp-add { grid-column: 1 / -1; justify-content: center; padding: 11px; }
  .exp-list { max-height: none; }
}

/* ---------- Código QR ---------- */
.qr-wrap { display: grid; gap: 10px; justify-items: center; text-align: center; }
.qr-wrap h2 { margin: 0; }
.qr-card { display: grid; justify-items: center; gap: 2px; padding: 16px 16px 14px; border-radius: 18px; background: #fff; color: #111827; box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(20, 30, 50, .08); width: min(300px, 100%); }
.qr-card .muted { color: #6b7280 !important; }
.qr-img { width: 100%; margin-bottom: 6px; }
.qr-img canvas { display: block; border-radius: 8px; }
.qr-help { margin: 0; max-width: 340px; }
.qr-row .btn { flex: 1; justify-content: center; }
#moreTools { overflow-y: auto; overscroll-behavior: contain; }
#moreTools.two { display: grid; grid-template-columns: 1fr 1fr; min-width: 400px; column-gap: 2px; }
.qr-open { display: inline-flex; align-items: center; }
.wr-foot .muted { min-width: 0; }

/* ---------- Ajustar y recortar imágenes ---------- */
.crop-ov { position: fixed; inset: 0; z-index: 95; background: rgba(8, 10, 14, .6); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .16s; }
.crop-ov.in { opacity: 1; }
.crop-card { width: min(560px, 100%); background: var(--panel); color: var(--text); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; }
.crop-h { display: grid; gap: 2px; }
.crop-h b { font-size: 16px; }
.crop-stage { position: relative; height: min(56vh, 420px); border-radius: 12px; overflow: hidden; background: #0b0d10; }
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-tools { display: flex; align-items: center; gap: 8px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--accent); }
.crop-tools .link { margin-left: 4px; }
.crop-card .row { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 600px) {
  .crop-ov { padding: 0; align-items: end; }
  .crop-card { border-radius: 18px 18px 0 0; padding: 16px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .crop-stage { height: min(52vh, 380px); }
  .crop-card .row .btn { flex: 1; justify-content: center; padding: 12px; }
}

/* ---------- Tipografías de los mensajes ---------- */
@font-face { font-family: "MZ Redondeada"; src: url(fonts/nunito-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Redondeada"; src: url(fonts/nunito-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MZ Maquina"; src: url(fonts/courier-prime-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Maquina"; src: url(fonts/courier-prime-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MZ Manuscrita"; src: url(fonts/caveat-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Manuscrita"; src: url(fonts/caveat-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MZ Elegante"; src: url(fonts/playfair-display-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Elegante"; src: url(fonts/playfair-display-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MZ Comic"; src: url(fonts/comic-neue-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Comic"; src: url(fonts/comic-neue-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MZ Retro"; src: url(fonts/vt323-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Moderna"; src: url(fonts/space-grotesk-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MZ Moderna"; src: url(fonts/space-grotesk-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
.font-redondeada { font-family: "MZ Redondeada", system-ui, sans-serif; }
.font-maquina { font-family: "MZ Maquina", "Courier New", monospace; }
.font-manuscrita { font-family: "MZ Manuscrita", cursive; font-size: 1.32em; line-height: 1.25; }
.font-elegante { font-family: "MZ Elegante", Georgia, serif; font-size: 1.04em; }
.font-comic { font-family: "MZ Comic", "Comic Sans MS", cursive; font-size: 1.04em; }
.font-retro { font-family: "MZ Retro", monospace; font-size: 1.32em; line-height: 1.15; letter-spacing: .02em; }
.font-moderna { font-family: "MZ Moderna", system-ui, sans-serif; }
.msg.big[class*="font-"] { font-size: 2em; }
.font-tool { font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.font-tool.on { color: var(--accent); background: var(--accent-soft); }
#fontMenu { left: 170px; min-width: 250px; max-height: min(60vh, 420px); overflow-y: auto; }
.fm-t { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 4px; }
#fontMenu button { display: grid; gap: 1px; padding: 7px 10px; }
#fontMenu button.on { background: var(--accent-soft); }
.fm-s { font-size: 16px; line-height: 1.25; color: var(--text); }
.fm-n { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { #fontMenu { left: auto; right: 0; } }

/* ---------- Tonos de aviso ---------- */
.tone-list { display: grid; gap: 4px; }
.tone-opt { display: flex !important; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-size: 14px !important; color: var(--text) !important; }
.tone-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tone-opt input { width: auto !important; accent-color: var(--accent); margin: 0; }
.to-ic { width: 22px; text-align: center; font-size: 17px; }
.to-n { flex: 1; }
.to-play svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.pv-tone { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--hover); font-size: 13px; text-align: left; }
.pv-tone b { color: var(--accent); font-weight: 600; }
.pv-tone:hover { filter: brightness(.98); }
.photo-view .pv-tone { margin-top: 8px; max-width: 320px; }

/* ---------- Ficha de perfil ---------- */
.photo-view.person { gap: 4px; }
.pv-bio { font-size: 13.5px; max-width: 340px; line-height: 1.45; margin-top: 6px; overflow-wrap: anywhere; }
.pv-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pv-facts:empty { display: none; }
.pv-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.pv-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 12.5px; font-weight: 600; }
.pv-links a:hover { border-color: var(--accent); color: var(--accent); }
.p-links { display: grid; gap: 6px; }
.pick-person { cursor: pointer; border-radius: 8px; }
.pick-person:hover { background: var(--hover); }
.seg.seg-wrap { grid-template-columns: repeat(3, 1fr); }
.ap-glass-tip { margin-top: -4px; }

/* ---------- Tema Cristal (efecto «liquid glass») ---------- */
:root[data-theme^=glass] {
  --bg: #dfe7f5; --panel: rgba(255, 255, 255, .46); --line: rgba(255, 255, 255, .62); --text: #0f1420; --muted: rgba(15, 20, 32, .58);
  --hover: rgba(255, 255, 255, .42); --shadow: 0 12px 40px rgba(20, 30, 70, .18);
  --glass-blur: blur(26px) saturate(190%); --glass-edge: rgba(255, 255, 255, .85); --glass-sheen: rgba(255, 255, 255, .55);
  --g1: #7aa7ff; --g2: #b892ff; --g3: #63e6be; --g4: #ffa8c5;
  color-scheme: light;
}
:root[data-theme=glass-dark] {
  --bg: #0a0d16; --panel: rgba(26, 30, 44, .44); --line: rgba(255, 255, 255, .14); --text: #eef2fa; --muted: rgba(238, 242, 250, .6);
  --hover: rgba(255, 255, 255, .09); --shadow: 0 14px 44px rgba(0, 0, 0, .45);
  --glass-edge: rgba(255, 255, 255, .28); --glass-sheen: rgba(255, 255, 255, .12);
  color-scheme: dark;
}
:root[data-theme^=glass] body { background: var(--bg); }
/* El fondo de colores que se ve a través del cristal (se mueve muy despacio) */
:root[data-theme^=glass] body::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 18% 22%, var(--g1), transparent 62%),
    radial-gradient(34% 42% at 82% 18%, var(--g2), transparent 62%),
    radial-gradient(42% 50% at 72% 82%, var(--g3), transparent 62%),
    radial-gradient(36% 46% at 22% 84%, var(--g4), transparent 62%);
  filter: saturate(1.15); animation: glassFlow 40s ease-in-out infinite alternate;
}
:root[data-theme=glass-dark] body::before { opacity: .8; }
@keyframes glassFlow { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(4%, -3%) rotate(8deg); } 100% { transform: translate(-3%, 4%) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { :root[data-theme^=glass] body::before { animation: none; } }
/* Superficies de vidrio: translúcidas, desenfocan lo de detrás, con borde de luz y brillo diagonal */
:root[data-theme^=glass] :is(.side, .conv, .modal-card, .menu, .toast, .emo-panel, .wink-panel, .auth-card, .crop-card, .tabs .tab.active) {
  background: linear-gradient(135deg, var(--glass-sheen), transparent 38%, transparent 70%, rgba(255, 255, 255, .06)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 1px 0 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(255, 255, 255, .08), var(--shadow);
}
:root[data-theme^=glass] .app { gap: 0; }
:root[data-theme^=glass] .side { margin: 12px 0 12px 12px; border-radius: 22px; overflow: hidden; }
:root[data-theme^=glass] .conv { border-radius: 22px; }
:root[data-theme^=glass] .conv:not(.solo) { border-top-left-radius: 0; }
:root[data-theme^=glass] .modal { background: rgba(10, 14, 24, .22); }
:root[data-theme^=glass] .modal-card { border-radius: 24px; }
:root[data-theme^=glass] .side-foot, :root[data-theme^=glass] .conv-head, :root[data-theme^=glass] .composer { border-color: var(--line); }
:root[data-theme^=glass] .notes-panel { background: var(--panel); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
/* Botones y campos tipo píldora de cristal */
:root[data-theme^=glass] .btn { background: rgba(255, 255, 255, .34); border-color: var(--line); box-shadow: inset 0 1px 0 var(--glass-edge); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
:root[data-theme=glass-dark] .btn { background: rgba(255, 255, 255, .08); }
:root[data-theme^=glass] .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent)); border-color: color-mix(in srgb, var(--accent) 70%, #fff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-theme^=glass] :is(input[type=search], .field, .modal-card input, .modal-card select, .input-row textarea, .np-add input, #npText) {
  background: rgba(255, 255, 255, .38); border-color: var(--line); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}
:root[data-theme=glass-dark] :is(input[type=search], .field, .modal-card input, .modal-card select, .input-row textarea, .np-add input, #npText) { background: rgba(255, 255, 255, .07); }
:root[data-theme^=glass] .contact.active, :root[data-theme^=glass] .contact:hover { background: rgba(255, 255, 255, .42); box-shadow: inset 0 1px 0 var(--glass-edge); }
:root[data-theme=glass-dark] .contact.active, :root[data-theme=glass-dark] .contact:hover { background: rgba(255, 255, 255, .1); }
:root[data-theme^=glass] .seg { background: rgba(255, 255, 255, .25); }
:root[data-theme^=glass] .seg button.on { background: rgba(255, 255, 255, .7); }
:root[data-theme=glass-dark] .seg button.on { background: rgba(255, 255, 255, .16); }
:root[data-theme^=glass] .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 0 0 3.5px var(--st, var(--offline)); }
:root[data-theme^=glass] .cd-bar { background: linear-gradient(90deg, rgba(255, 255, 255, .3), transparent); }
@media (max-width: 760px) {
  :root[data-theme^=glass] .side { margin: 0; border-radius: 0; border: 0; }
  :root[data-theme^=glass] .conv { border-radius: 0; border: 0; }
  :root[data-theme^=glass] .modal-card { border-radius: 24px 24px 0 0; }
}
/* Si el navegador no sabe desenfocar, el cristal se vuelve más opaco para que se lea bien */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme^=glass] { --panel: rgba(255, 255, 255, .86); }
  :root[data-theme=glass-dark] { --panel: rgba(24, 28, 40, .9); }
}
:root[data-theme^=glass] .crop-card { background: linear-gradient(135deg, var(--glass-sheen), transparent 40%), rgba(255, 255, 255, .86); }
:root[data-theme=glass-dark] .crop-card { background: linear-gradient(135deg, var(--glass-sheen), transparent 40%), rgba(20, 24, 36, .9); }
.crop-ov { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Los campos dentro de una etiqueta no heredan su color gris */
.modal-card label :is(input, textarea, select), .auth-card label :is(input, select) { color: var(--text); }

/* ---------- Cabecera del perfil: placa de cristal sobre la imagen (opción D) ---------- */
.me-wrap { padding: 14px 12px 12px; }
.me-wrap.has-cover { padding-bottom: 12px; }
.me-cover-clip { -webkit-mask-image: none !important; mask-image: none !important; } /* corte limpio, sin degradado */
.me-wrap .me { margin: 0 0 12px; padding: 14px 52px 14px 14px; gap: 14px; align-items: center; border-radius: 20px; background: var(--hover); }
.me-wrap.has-cover .me { -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%); }
.me-wrap.tone-light .me { background: rgba(255, 255, 255, .55); color: #111827; --muted: rgba(17, 24, 39, .65); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 24px rgba(20, 30, 50, .12); }
.me-wrap.tone-dark .me { background: rgba(10, 12, 22, .38); color: #fff; --muted: rgba(255, 255, 255, .78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px rgba(0, 0, 0, .25); }
.me-wrap.has-cover .me :is(.me-name, .psm-input, .status-btn) { color: inherit; text-shadow: none; }
.me-wrap .me .avatar.lg { width: 80px; height: 80px; border-radius: 20px; font-size: 30px; }
.me-wrap .me-info { gap: 5px; }
.me-wrap .me-name { font-size: 21px; font-weight: 700; letter-spacing: -.01em; padding: 0; }
.me-wrap .status-pick { display: flex; }
.me-wrap .status-btn { padding: 4px 10px 4px 8px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--panel); color: var(--text); }
.me-wrap.tone-light .status-btn { background: rgba(255, 255, 255, .6); }
.me-wrap.tone-dark .status-btn { background: rgba(255, 255, 255, .14); }
.me-wrap .psm-input { font-size: 14.5px; margin-left: -6px; width: calc(100% + 6px); padding: 2px 6px; color: inherit; }
.me-wrap.tone-light .psm-input::placeholder { color: rgba(17, 24, 39, .55); }
.me-wrap .music { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-wrap .music::before { content: "♪"; color: inherit; }
.me-wrap > .news-btn { top: 22px; right: 20px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .72); color: #1f2937 !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); text-shadow: none !important; }
.me-wrap:not(.has-cover) > .news-btn { background: var(--panel); color: var(--muted) !important; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.me-wrap .search-row { padding: 0; }
.me-wrap .pwa-card { margin: 0 0 12px; }
@media (max-width: 760px) { .me-wrap { padding: 12px 10px 10px; } .me-wrap .search-row { padding: 0; } }
@media (max-width: 360px) { .me-wrap .me .avatar.lg { width: 64px; height: 64px; } .me-wrap .me-name { font-size: 19px; } }
/* Móvil en horizontal: placa compacta */
@media (max-height: 500px) and (pointer: coarse) {
  .me-wrap { padding: 8px 10px 8px; }
  .me-wrap .me { padding: 8px 48px 8px 10px; margin-bottom: 8px; gap: 10px; }
  .me-wrap .me .avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
  .me-wrap .me-name { font-size: 17px; }
  .me-wrap > .news-btn { top: 14px; right: 16px; width: 30px; height: 30px; }
}
/* Menús dentro de la placa: en el tema Cristal, casi opacos (la placa ya desenfoca y no dejaría ver bien lo de detrás) */
:root[data-theme^=glass] .me-wrap .menu { background: rgba(255, 255, 255, .95); }
:root[data-theme=glass-dark] .me-wrap .menu { background: rgba(24, 28, 40, .96); }
@media (pointer: coarse) {
  .me-wrap .status-btn { min-height: 32px; padding: 6px 12px 6px 10px; }
  .me-wrap .me-name { padding: 4px 0; }
}

/* ---------- Aviso legal y protección de datos ---------- */
.auth { grid-template-rows: 1fr auto; }
.auth-card { align-self: center; }
.auth-legal { display: flex; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 14px 0 max(4px, env(safe-area-inset-bottom)); opacity: .8; }
.auth-legal a { color: inherit; text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; color: var(--text); }
.auth-legal.in-app { padding: 4px 0 0; }
.auth-consent { margin: -4px 0 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4; }
.lg-head { display: grid; gap: 10px; }
.lg-head h2 { margin: 0; }
.lg-tabs { grid-template-columns: 1fr 1fr; }
.lg-body { font-size: 13.5px; line-height: 1.55; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.lg-body h3 { font-size: 13.5px; margin: 16px 0 4px; }
.lg-body p { margin: 0 0 8px; }
.lg-body ul { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.lg-body a { color: var(--accent); }
.lg-note { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.lg-todo { background: color-mix(in srgb, var(--away) 25%, transparent); border-radius: 4px; padding: 0 4px; }
.lg-date { color: var(--muted); font-size: 12px; margin-top: 14px !important; }
@media (max-width: 600px) { .lg-body { max-height: none; } }

/* Aviso de correo pendiente */
.mail-banner { display: flex; align-items: center; gap: 10px; margin: 2px 4px 8px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px;
  background: color-mix(in srgb, var(--away) 16%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--away) 40%, transparent); }
.mb-ic { font-size: 20px; }
.mb-t { flex: 1; min-width: 0; display: grid; gap: 1px; color: var(--muted); }
.mb-t b { color: var(--text); font-size: 13px; }
.mail-banner .btn { padding: 6px 12px; font-size: 12.5px; }
.pf-mail { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.pf-mail > span:first-child { grid-column: 1 / -1; }
.pf-mail-v { overflow-wrap: anywhere; font-size: 14px; }
.pf-mail-v i { color: var(--danger); font-style: normal; }
.pf-mail .link { color: var(--accent); font-weight: 600; }
.no-mail { color: var(--danger); }
.adm-legal-btns { display: flex; align-items: center; gap: 14px; }
.adm-legal-btns .link { color: var(--accent); }

/* Aviso de borrado a las 48 h, al principio de cada chat */
.retention { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0 auto 10px; padding: 6px 12px; border-radius: 20px; background: var(--hover); width: fit-content; max-width: 100%; }
.retention a { color: inherit; }

/* ---------- «Lo que estoy escuchando» con enlace de Spotify ---------- */
.me-wrap .music.linked { padding: 0; background: #1db954; }
.me-wrap .music.linked::before { content: none; }
.music.linked a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; color: #fff; text-decoration: none; min-width: 0; max-width: 100%; }
.music.linked a > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.music.linked .mz-cov { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.music.linked a:not(:has(.mz-cov)) { padding-left: 10px; }
.music.linked a:not(:has(.mz-cov))::before { content: "♪"; }
.sp-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 1px 6px; flex: none; }
.music.linked a:hover { filter: brightness(1.06); }
.music-link { gap: 5px; color: #1aa34a !important; }
:root[data-dark] .music-link { color: #3ddc7a !important; }
.music-link .mz-cov { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; }
.music-link .mz-note { font-weight: 700; }
.music-link .mz-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.contact .ps .music-link { max-width: 100%; }
.pv-song { display: flex; align-items: center; gap: 12px; width: min(320px, 100%); margin-top: 8px; padding: 8px 12px 8px 8px; border-radius: 14px; text-decoration: none; text-align: left;
  background: linear-gradient(135deg, #1db954, #128a3e); color: #fff; box-shadow: 0 6px 18px rgba(29, 185, 84, .25); }
.pv-song img, .pv-song-n { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.pv-song-n { display: grid; place-items: center; background: rgba(0, 0, 0, .2); font-size: 22px; }
.pv-song-t { flex: 1; min-width: 0; display: grid; }
.pv-song-t small { font-size: 11px; opacity: .85; }
.pv-song-t b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-song-go { font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .2); padding: 5px 9px; border-radius: 14px; flex: none; }
.pv-song:hover { filter: brightness(1.05); }
.pv-song-t > span { font-size: 12px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-song-go { width: 34px; height: 34px; padding: 0 !important; border-radius: 50% !important; display: grid; place-items: center; background: #fff !important; }
.pv-song-go svg { width: 16px; height: 16px; fill: #128a3e; stroke: none; margin-left: 2px; }

/* ---------- Mensajes en bocadillos (estilo suave) ---------- */
.img-wrap { display: inline-block; max-width: 100%; vertical-align: top; }
.messages.bubbles .mgroup { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 14px 0 4px; }
.messages.bubbles .mgroup.mine { align-items: flex-end; }
.messages.bubbles .mhead { display: none; }
.messages.bubbles .mgroup.in-group:not(.mine) .mhead { display: block; margin: 0 0 1px 12px; font-size: 11.5px; }
.messages.bubbles .msg { max-width: min(78%, 560px); padding: 7px 12px 6px; border-radius: 18px; line-height: 1.4;
  background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.messages.bubbles .mgroup.mine .msg { background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
/* El último bocadillo de cada tanda tiene la esquina del lado de quien habla más recta */
.messages.bubbles .mgroup:not(.mine) .msg { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.messages.bubbles .mgroup:not(.mine) .mhead + .msg { border-top-left-radius: 18px; }
.messages.bubbles .mgroup:not(.mine) .msg:last-child { border-bottom-left-radius: 4px; }
.messages.bubbles .mgroup.mine .msg { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.messages.bubbles .mgroup.mine .mhead + .msg { border-top-right-radius: 18px; }
.messages.bubbles .mgroup.mine .msg:last-of-type { border-bottom-right-radius: 4px; }
/* Hora dentro del bocadillo */
.messages.bubbles .msg .tm { position: static; opacity: .6; float: right; margin: 6px 0 -2px 10px; font-size: 10.5px; line-height: 1; }
/* Fotos, notas de voz, encuestas, ubicaciones… y emojis sueltos: sin fondo de bocadillo */
.messages.bubbles .msg.has-media, .messages.bubbles .msg.big { background: none !important; box-shadow: none !important; padding: 0; }
.messages.bubbles .msg.has-media .tm, .messages.bubbles .msg.big .tm { float: none; display: block; text-align: right; margin: 3px 6px 0; }
.messages.bubbles .mgroup:not(.mine) .msg.has-media .tm, .messages.bubbles .mgroup:not(.mine) .msg.big .tm { text-align: left; }
.messages.bubbles .msg .img-msg { border-radius: 16px; margin: 0; }
.messages.bubbles .msg .voice { background: var(--panel); margin: 0; }
.messages.bubbles .mgroup.mine .msg .voice { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.messages.bubbles .msg .lp { margin-top: 6px; }
.messages.bubbles .receipt { align-self: flex-end; margin-top: 1px; }
.messages.bubbles .msg .auto-tag { display: block; margin-bottom: 2px; }
@media (max-width: 760px) { .messages.bubbles .msg { max-width: 84%; } }
.seg.seg-two { grid-template-columns: 1fr 1fr; }

/* ---------- Visor de imágenes: la foto siempre centrada (también en Safari y en el navegador) ---------- */
.vw-stage { position: relative; display: block; }
.vw-stage img { position: absolute; top: 8px; bottom: 40px; left: 56px; right: 56px; margin: auto; width: auto; height: auto;
  max-width: calc(100% - 112px); max-height: calc(100% - 48px); }
.vw-stage.zoom img { position: static; margin: 0; max-width: none; max-height: none; }
@media (max-width: 760px) {
  .vw-stage img { top: 4px; bottom: 36px; left: 4px; right: 4px; max-width: calc(100% - 8px); max-height: calc(100% - 40px); }
}

/* ---------- La etiqueta de la canción y el estado nunca se salen de la placa del perfil ---------- */
.me-wrap .me-info { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.me-wrap .music { max-width: 100%; min-width: 0; overflow: hidden; }
.me-wrap .music.linked a { max-width: 100%; box-sizing: border-box; }
.me-wrap .music.linked a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.me-wrap .status-pick, .me-wrap .status-btn { max-width: 100%; min-width: 0; }
.me-wrap .status-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ===== Nota de voz: mantener pulsado para grabar ===== */
.composer.voice-mode .tools, .composer.voice-mode #inputRow { display: none !important; }
.voice-panel { display: grid; gap: 10px; padding: 4px 2px 6px; animation: vpIn .18s ease-out; }
.voice-panel.hidden { display: none; }
@keyframes vpIn { from { opacity: 0; transform: translateY(8px); } }
.vp-head { display: flex; align-items: center; gap: 10px; }
.vp-head b { flex: 1; font-size: 14px; }
.vp-time { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; color: var(--muted); }
.voice-panel.recording .vp-time { color: #e5383b; }
.voice-panel.recording .vp-time::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e5383b; margin-right: 6px; vertical-align: 1px; animation: vpBlink 1s infinite; }
@keyframes vpBlink { 50% { opacity: .2; } }
.vp-rec { display: grid; justify-items: center; gap: 10px; padding: 6px 0 4px; }
.vp-mic { --lvl: 0; position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ff6b6b, #e5383b 55%, #c1121f); color: #fff;
  box-shadow: 0 8px 22px rgba(229, 56, 59, .38), inset 0 -3px 8px rgba(0, 0, 0, .18);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease; }
.vp-mic svg { position: relative; width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; pointer-events: none; }
.vp-mic .vp-ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid rgba(229, 56, 59, .35); pointer-events: none;
  transform: scale(calc(1 + var(--lvl) * .35)); transition: transform .08s linear; animation: vpPulse 2s ease-in-out infinite; }
@keyframes vpPulse { 50% { opacity: .45; } }
.vp-mic:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.voice-panel.recording .vp-mic { transform: scale(1.12); }
.voice-panel.recording .vp-ring { animation: none; border-color: rgba(229, 56, 59, .55); background: rgba(229, 56, 59, .12); }
.vp-mic.nudge { animation: vpNudge .4s; }
@keyframes vpNudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.vp-hint { font-size: 12.5px; color: var(--muted); text-align: center; }
.voice-panel.recording .vp-hint { color: #e5383b; font-weight: 600; }
.vp-review { display: grid; gap: 10px; }
.vp-review.hidden, .vp-rec.hidden { display: none; }
.vp-player { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--hover); }
.vp-play { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vp-play svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.vp-play .ic-pause, .voice-panel.playing .vp-play .ic-play { display: none; }
.voice-panel.playing .vp-play .ic-pause { display: block; }
.vp-wave { flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; gap: 2px; }
.vp-wave i { flex: 1; min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 35%, transparent); transition: background .1s; }
.vp-wave i.on { background: var(--accent); }
.vp-wave.busy { opacity: .45; animation: vpBlink 1s infinite; }
.vp-dur { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); min-width: 34px; text-align: right; }
.vp-fx { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.vp-fx::-webkit-scrollbar { display: none; }
.vp-fx .vfx { justify-content: flex-start; }
@media (min-width: 900px) { .vp-fx { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); overflow: visible; } }
.vp-actions { display: flex; gap: 8px; }
.vp-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.vp-actions .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vp-actions .btn.primary { margin-left: auto; min-width: 110px; }
@media (max-width: 420px) { .vp-actions .btn:not(.primary) { padding-left: 10px; padding-right: 10px; } }
@media (orientation: landscape) and (max-height: 500px) { .vp-mic { width: 64px; height: 64px; } .vp-mic svg { width: 28px; height: 28px; } .vp-rec { padding: 0; gap: 6px; } }
.vp-fx .vfx { white-space: nowrap; padding: 6px 12px; }
.vp-fx { grid-auto-columns: max-content; }
@media (min-width: 900px) { .vp-fx { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

/* ===== Nick con estilo ===== */
.n-emo { margin-right: .28em; font-style: normal; }
.n-badge { margin-left: .3em; font-size: .88em; font-style: normal; }
.nsx[class*=ns-] { font-weight: 700; }
.ns-rojo { color: #e11d48; } .ns-naranja { color: #ea580c; } .ns-verde { color: #16a34a; } .ns-azul { color: #2563eb; } .ns-morado { color: #7c3aed; } .ns-rosa { color: #db2777; }
:root[data-dark] .ns-rojo { color: #fb7185; } :root[data-dark] .ns-naranja { color: #fb923c; } :root[data-dark] .ns-verde { color: #4ade80; }
:root[data-dark] .ns-azul { color: #60a5fa; } :root[data-dark] .ns-morado { color: #a78bfa; } :root[data-dark] .ns-rosa { color: #f472b6; }
.nsx:is(.ns-fuego, .ns-oceano, .ns-atardecer, .ns-menta, .ns-galaxia, .ns-oro, .ns-arcoiris, .ns-brillo) {
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.ns-fuego { background-image: linear-gradient(90deg, #ef4444, #f59e0b); }
.ns-oceano { background-image: linear-gradient(90deg, #0891b2, #2563eb); }
.ns-atardecer { background-image: linear-gradient(90deg, #f97316, #db2777, #7c3aed); }
.ns-menta { background-image: linear-gradient(90deg, #059669, #0891b2); }
.ns-galaxia { background-image: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); }
.ns-oro { background-image: linear-gradient(90deg, #a16207, #eab308 50%, #a16207); }
:root[data-dark] .ns-oceano { background-image: linear-gradient(90deg, #22d3ee, #60a5fa); }
:root[data-dark] .ns-menta { background-image: linear-gradient(90deg, #34d399, #22d3ee); }
:root[data-dark] .ns-galaxia { background-image: linear-gradient(90deg, #818cf8, #c084fc, #f472b6); }
:root[data-dark] .ns-oro { background-image: linear-gradient(90deg, #ca8a04, #fde047 50%, #ca8a04); }
.ns-arcoiris { background-image: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #0ea5e9, #8b5cf6, #ec4899, #ef4444); background-size: 200% 100%; animation: nsSlide 4s linear infinite; }
.ns-brillo { background-image: linear-gradient(100deg, var(--accent) 40%, #fff 50%, var(--accent) 60%); background-size: 250% 100%; animation: nsShine 3s ease-in-out infinite; }
:root:not([data-dark]) .ns-brillo { background-image: linear-gradient(100deg, var(--accent) 40%, color-mix(in srgb, var(--accent) 30%, #fff) 50%, var(--accent) 60%); }
.ns-neon { color: #0891b2; text-shadow: 0 0 6px rgba(34, 211, 238, .55); animation: nsGlow 2.4s ease-in-out infinite; }
:root[data-dark] .ns-neon { color: #67e8f9; text-shadow: 0 0 8px rgba(34, 211, 238, .8), 0 0 16px rgba(34, 211, 238, .45); }
@keyframes nsSlide { to { background-position: -200% 0; } }
@keyframes nsShine { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }
@keyframes nsGlow { 50% { text-shadow: 0 0 2px rgba(34, 211, 238, .3); } }
@media (prefers-reduced-motion: reduce) { .ns-arcoiris, .ns-brillo, .ns-neon { animation: none; } }
/* Sobre fondos de foto (cabecera tipo cristal) el nick con estilo mantiene su color */
.me-wrap .me .me-name .nsx[class*=ns-] { text-shadow: none; }
.me-wrap.lay-d .me .me-name .ns-neon { text-shadow: 0 0 6px rgba(34, 211, 238, .55) !important; }

/* ===== Estilo de bocadillo ===== */
.messages.bubbles .mgroup[class*=bs-] .msg:not(.has-media):not(.big) { box-shadow: none; }
.messages.bubbles .mgroup.bs-soft .msg:not(.has-media):not(.big) { color: #1f2937; }
.messages.bubbles .mgroup.bs-strong .msg:not(.has-media):not(.big) { color: #fff; }
.messages.bubbles .mgroup.bs-strong .msg a { color: #fff; text-decoration: underline; }
.messages.bubbles .mgroup.bs-strong .msg .tm, .messages.bubbles .mgroup.bs-strong .msg .tm * { color: rgba(255, 255, 255, .85); }
.messages.bubbles .mgroup.bs-strong .msg .lp { color: var(--text); }
.messages.bubbles .mgroup[class*=bs-] .msg .auto-tag { opacity: .85; }
.messages.bubbles .mgroup.bs-cielo .msg:not(.has-media):not(.big), .bsw-cielo { background: #dbeafe; }
.messages.bubbles .mgroup.bs-menta .msg:not(.has-media):not(.big), .bsw-menta { background: #d1fae5; }
.messages.bubbles .mgroup.bs-limon .msg:not(.has-media):not(.big), .bsw-limon { background: #fef3c7; }
.messages.bubbles .mgroup.bs-melocoton .msg:not(.has-media):not(.big), .bsw-melocoton { background: #ffe1cc; }
.messages.bubbles .mgroup.bs-lila .msg:not(.has-media):not(.big), .bsw-lila { background: #ede9fe; }
.messages.bubbles .mgroup.bs-rosa .msg:not(.has-media):not(.big), .bsw-rosa { background: #fce7f3; }
.messages.bubbles .mgroup.bs-azul .msg:not(.has-media):not(.big), .bsw-azul { background: #2563eb; }
.messages.bubbles .mgroup.bs-verde .msg:not(.has-media):not(.big), .bsw-verde { background: #15803d; }
.messages.bubbles .mgroup.bs-coral .msg:not(.has-media):not(.big), .bsw-coral { background: #e8574b; }
.messages.bubbles .mgroup.bs-grafito .msg:not(.has-media):not(.big), .bsw-grafito { background: #374151; }
.messages.bubbles .mgroup.bs-atardecer .msg:not(.has-media):not(.big), .bsw-atardecer { background: linear-gradient(135deg, #f97316, #db2777); }
.messages.bubbles .mgroup.bs-oceano .msg:not(.has-media):not(.big), .bsw-oceano { background: linear-gradient(135deg, #0891b2, #2563eb); }
.messages.bubbles .mgroup.bs-aurora .msg:not(.has-media):not(.big), .bsw-aurora { background: linear-gradient(135deg, #059669, #6366f1); }
.messages.bubbles .mgroup.bs-fuego .msg:not(.has-media):not(.big), .bsw-fuego { background: linear-gradient(135deg, #dc2626, #ea580c); }
.messages.bubbles .mgroup.bs-noche .msg:not(.has-media):not(.big), .bsw-noche { background: linear-gradient(135deg, #1e1b4b, #5b21b6); }
.messages.bubbles .mgroup.bs-caramelo .msg:not(.has-media):not(.big), .bsw-caramelo { background: linear-gradient(135deg, #d97706, #92400e); }

/* ===== Emoticonos propios ===== */
.cemo { display: inline-block; height: 1.6em; width: auto; max-width: 4.5em; vertical-align: -0.45em; object-fit: contain; margin: 0 1px; cursor: pointer; }
.msg.big-cemo .cemo { height: 64px; max-width: 160px; vertical-align: middle; margin: 2px; }
.emo-view { display: grid; justify-items: center; gap: 6px; padding: 8px 0 2px; text-align: center; }
.emo-view .cemo { height: 112px; max-width: 220px; cursor: default; }
.emo-view .em-code-in { width: 100%; max-width: 280px; text-align: left; }
.emo-suggest { display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.emo-suggest.hidden { display: none; }
.emo-suggest button { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px 4px 5px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12.5px; }
.emo-suggest button.on, .emo-suggest button:hover { border-color: var(--accent); background: var(--accent-soft); }
.emo-suggest .cemo { height: 26px; vertical-align: middle; cursor: inherit; }
/* Panel de emoticonos con pestañas */
.emo-panel { display: block; grid-template-columns: none; width: max-content; max-width: min(340px, calc(100vw - 24px)); }
.emo-panel.hidden { display: none; }
.ep-tabs { display: flex; gap: 4px; margin: -2px 0 6px; }
.emo-panel .ep-tabs button { width: auto; height: auto; flex: 1; padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 8px; }
.emo-panel .ep-tabs button.on { background: var(--accent-soft); color: var(--accent); }
.ep-n { font-size: 10.5px; background: var(--accent); color: #fff; border-radius: 9px; padding: 0 5px; margin-left: 2px; }
.ep-body { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; max-height: 240px; overflow-y: auto; }
.ep-body.mine { grid-template-columns: repeat(6, 46px); }
.emo-panel .ep-body.mine button { width: 46px; height: 46px; display: grid; place-items: center; }
.ep-body.mine .cemo { height: 36px; max-width: 42px; vertical-align: middle; cursor: inherit; margin: 0; }
.emo-panel .ep-add { border: 1.5px dashed var(--line); color: var(--muted); font-size: 18px; }
.ep-hint { grid-column: 2 / -1; align-self: center; font-size: 12px; color: var(--muted); padding-left: 6px; }
@media (pointer: coarse) { .ep-body { grid-template-columns: repeat(8, 38px); } .ep-body.mine { grid-template-columns: repeat(6, 48px); } }
/* Gestión */
.em-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.em-add #emPick span { font-size: 16px; margin-right: 4px; }
.em-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; width: 100%; padding: 10px; border-radius: 14px; background: var(--hover); }
.em-new.hidden { display: none; }
.em-new img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(rgba(127, 127, 127, .14) 0 25%, transparent 0 50%) 0 0 / 12px 12px; }
.em-code-in { flex: 1; min-width: 140px; }
.em-colon { display: flex; align-items: center; gap: 2px; font-weight: 700; color: var(--muted); }
.em-colon input { flex: 1; min-width: 0; }
.em-head { display: flex; justify-content: space-between; align-items: baseline; }
.em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.em-item { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.em-item .cemo { height: 48px; max-width: 80px; cursor: default; margin: 0; }
.em-code { font-size: 12px; font-weight: 600; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px; border-radius: 6px; }
.em-code:hover { background: var(--hover); }
.em-ren { width: 100%; font-size: 12px; padding: 4px 6px; }
.em-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; color: var(--muted); opacity: .7; }
.em-del:hover { background: #e5484d; color: #fff; opacity: 1; }
.em-empty { grid-column: 1 / -1; padding: 14px; text-align: center; border: 1.5px dashed var(--line); border-radius: 14px; }

/* ===== Accesos desde Mi perfil ===== */
.pf-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-custom .btn { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: left; padding: 10px 12px; height: auto; align-items: center; }
.pf-custom .btn span { grid-row: span 2; font-size: 22px; }
.pf-custom .btn small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
@media (max-width: 420px) { .pf-custom { grid-template-columns: 1fr; } }

/* ===== Ventana «Mi estilo» ===== */
.sty-prev { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--hover); min-width: 0; }
.sty-names, .sty-bubbles, .sty-badges, .sty-emo { min-width: 0; }
.sp-card { display: flex; align-items: center; gap: 10px; }
.sp-who { display: grid; min-width: 0; }
.sp-name { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-msgs.messages { padding: 0 !important; overflow: visible; background: none !important; }
.sp-msgs .mgroup { margin: 0 !important; }
.sp-msgs .msg { background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.sty-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.sty-n, .sty-b { display: grid; justify-items: center; gap: 2px; padding: 9px 6px 7px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); min-width: 0; }
.sty-n .nsx { font-size: 14.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sty-n small, .sty-b small { font-size: 11px; color: var(--muted); }
.sty-n.on, .sty-b.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.sty-emo { display: grid; gap: 6px; }
.sty-emo-row { display: flex; gap: 8px; align-items: center; }
.sty-emo-row input { width: 52px; text-align: center; font-size: 20px; padding: 6px; flex: none; }
.sty-quick { min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.sty-quick button { flex: none; width: 34px; height: 34px; border-radius: 8px; font-size: 19px; }
.sty-quick button:hover { background: var(--hover); }
.sty-quick .sty-none { font-size: 13px; color: var(--muted); }
.sty-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.sb-sw { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 14px 14px 14px 5px; font-size: 12.5px; font-weight: 700; color: #1f2937; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.sty-b[data-b=""] .sb-sw { background: var(--accent-soft); }
.sb-sw:is(.bsw-azul, .bsw-verde, .bsw-coral, .bsw-grafito, .bsw-atardecer, .bsw-oceano, .bsw-aurora, .bsw-fuego, .bsw-noche, .bsw-caramelo) { color: #fff; }
.sty-b:not([data-b=""]) .sb-sw { box-shadow: none; }
.sty-b[data-b=""] .sb-sw { color: var(--text); }
.sty-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.sty-badge { position: relative; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.sty-badge:not(.got) { opacity: .62; cursor: default; }
.sty-badge:not(.got) .bg-ic { filter: grayscale(1); }
.sty-badge.got { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.sty-badge.on { border-color: var(--accent); background: var(--accent-soft); }
.bg-ic { font-size: 24px; line-height: 1.1; }
.bg-t { display: grid; gap: 2px; min-width: 0; }
.bg-t b { font-size: 13.5px; }
.bg-t small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.bg-bar { display: block; height: 5px; border-radius: 3px; background: var(--hover); overflow: hidden; margin-top: 3px; }
.bg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bg-n { font-variant-numeric: tabular-nums; }
.bg-feat { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
/* Insignias en la ficha */
.pv-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.pv-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 20px; background: var(--hover); font-size: 12px; font-weight: 600; }
.pv-badge i { font-style: normal; font-size: 15px; }
.pv-badge.feat { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.sty-emo { grid-template-columns: minmax(0, 1fr); }
.sty-emo-row { min-width: 0; align-items: flex-start; }
.sty-quick { flex-wrap: wrap; overflow: visible; }
.emo-panel { width: min(318px, calc(100vw - 24px)); box-sizing: border-box; }
.ep-body { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
.ep-body.mine { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
@media (pointer: coarse) { .emo-panel { width: min(350px, calc(100vw - 24px)); } .ep-body { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); } .ep-body.mine { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); } }
.emo-panel .ep-body button { width: 100%; }

/* ===== Estado con estilo ===== */
.nsx .ej { -webkit-text-fill-color: #111; color: #111; }
.nsx[class*=ns-] .psm-link { -webkit-text-fill-color: var(--accent); color: var(--accent); }
.nsx.ns-neon .ej, .nsx.ns-neon .psm-link { text-shadow: none; }
.psm-view { font-size: 13px; padding: 4px 0; border-radius: 7px; cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; }
.psm-view.hidden { display: none; }
.me-wrap[class*=lay-] .psm-view { font-size: 14.5px; padding: 2px 0; }
.psm-view .nsx[class*=ns-] { font-weight: 600; }
.ps .nsx[class*=ns-], .pv-psm .nsx[class*=ns-], #cPsm .nsx[class*=ns-] { font-weight: 600; }
.sp-psm { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sty-n .nsx { max-width: 100%; }
@media (max-height: 500px) and (pointer: coarse) { .psm-view { display: none; } }

/* ===== 2.7 · Estilos exclusivos y de Halloween ===== */
.nsx.ns-diamante { background-image: linear-gradient(100deg, #60a5fa, #c4b5fd 30%, #f0abfc 45%, #fff 50%, #a5f3fc 55%, #60a5fa 75%, #818cf8); background-size: 250% 100%; animation: nsShine 3.2s ease-in-out infinite;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; filter: drop-shadow(0 0 4px rgba(147, 197, 253, .45)); }
:root:not([data-dark]) .nsx.ns-diamante { background-image: linear-gradient(100deg, #2563eb, #7c3aed 30%, #c026d3 45%, #93c5fd 50%, #0891b2 55%, #2563eb 75%, #6d28d9); }
.nsx.ns-calabaza { background-image: linear-gradient(90deg, #ea580c, #f59e0b 50%, #ea580c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; text-shadow: none; }
.ns-fantasma { color: #64748b; animation: nsGhost 3s ease-in-out infinite; }
:root[data-dark] .ns-fantasma { color: #e2e8f0; text-shadow: 0 0 10px rgba(226, 232, 240, .55); }
@keyframes nsGhost { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ns-diamante, .ns-fantasma { animation: none; } }
.nsx:is(.ns-diamante, .ns-calabaza) .ej { -webkit-text-fill-color: initial; color: initial; }
.messages.bubbles .mgroup.bs-diamante .msg:not(.has-media):not(.big), .bsw-diamante { background: linear-gradient(125deg, #6366f1, #8b5cf6 35%, #ec4899 65%, #06b6d4); background-size: 200% 200%; animation: bsShift 6s ease infinite; }
@keyframes bsShift { 50% { background-position: 100% 100%; } }
.messages.bubbles .mgroup.bs-telarana .msg:not(.has-media):not(.big), .bsw-telarana {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80' fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1'%3E%3Cpath d='M0 0L80 80M80 0L0 80M40 0V80M0 40H80'/%3E%3Cpath d='M40 22L53 27 58 40 53 53 40 58 27 53 22 40 27 27Z'/%3E%3Cpath d='M40 8L62 18 72 40 62 62 40 72 18 62 8 40 18 18Z'/%3E%3C/svg%3E") center / 80px, linear-gradient(135deg, #1c1917, #431407 60%, #7c2d12); }
.sb-sw:is(.bsw-diamante, .bsw-telarana) { color: #fff; }
.sty-n.locked, .sty-b.locked { opacity: .55; border-style: dashed; }
.sty-n.ev, .sty-b.ev { border-color: #f59e0b66; background: linear-gradient(180deg, transparent, rgba(245, 158, 11, .08)); }
.pf-custom { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .pf-custom { grid-template-columns: 1fr; } }
/* Capa del efecto de Halloween */
.wink-layer.spooky { background: radial-gradient(ellipse at center, rgba(67, 20, 7, .25), rgba(10, 6, 20, .55)); animation: spookyIn .4s ease-out; }
@keyframes spookyIn { from { opacity: 0; } }

/* Aviso del evento */
.ev-banner { display: flex; gap: 10px; align-items: center; margin: 8px 10px; padding: 10px 10px 10px 12px; border-radius: 16px; color: #fff;
  background: radial-gradient(circle at 12% 30%, rgba(251, 146, 60, .45), transparent 55%), linear-gradient(135deg, #1c1917, #3b0764 70%, #7c2d12); box-shadow: 0 6px 18px rgba(59, 7, 100, .25); }
.ev-ic { font-size: 30px; animation: evBob 2.4s ease-in-out infinite; }
@keyframes evBob { 50% { transform: translateY(-3px) rotate(-6deg); } }
.ev-t { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: rgba(255, 255, 255, .88); }
.ev-t b { display: block; font-size: 14px; color: #fdba74; margin-bottom: 1px; }
.ev-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ev-btns .btn { background: #f97316; border-color: #f97316; color: #fff; padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.ev-x { color: rgba(255, 255, 255, .6) !important; width: 36px; height: 36px; font-size: 13px; }

/* ===== Ventana de novedades ===== */
.modal-card.wn-card { padding: 0; overflow: hidden; max-width: 460px; }
.wn { display: grid; }
.wn-head { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(135deg, #2f7fe0, #7c4dff 55%, #e83e8c); overflow: hidden; }
.wn-head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.wn-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.wn-fallback span { font-size: 54px; letter-spacing: 10px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.wn-body { padding: 18px 22px 4px; display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; }
.wn-v { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.wn-body h2 { margin: 0 0 4px; }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wn-list li { display: flex; gap: 12px; align-items: flex-start; }
.wn-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; border-radius: 12px; background: var(--hover); }
.wn-list li > span:last-child { display: grid; gap: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.wn-list b { color: var(--text); font-size: 14px; }
.wn .row { padding: 14px 22px 20px; margin: 0; }
.wn-ok { flex: 1; padding: 12px; font-size: 15px; }

/* ===== Juegos ===== */
.gm-list { display: grid; gap: 8px; }
.gm-pick { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); }
.gm-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.gm-ic { font-size: 30px; }
.gm-pick b { display: block; font-size: 15px; }
.gm-pick small { color: var(--muted); font-size: 12.5px; }
.game { width: 260px; max-width: 100%; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); display: grid; gap: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.game.my-turn { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent), 0 4px 14px rgba(0, 0, 0, .06); }
.game-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 13.5px; }
.game-st { font-weight: 500; font-size: 12px; color: var(--muted); text-align: right; }
.game-st b { color: var(--accent); }
.game-pl { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; }
.gp { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 14px; background: var(--hover); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp i { font-style: normal; font-weight: 800; }
.gp.p0 i { color: #e5484d; } .gp.p1 i { color: #2f7fe0; }
.gp b { margin-left: 2px; }
.gp.turn { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.gp.win { background: #fef3c7; color: #92400e; font-weight: 700; }
.gvs { font-size: 11px; color: var(--muted); }
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tc { aspect-ratio: 1; border-radius: 12px; background: var(--hover); font-size: 34px; font-weight: 800; display: grid; place-items: center; color: var(--text); transition: transform .12s, background .12s; }
.tc:not(:disabled):hover { background: var(--accent-soft); transform: scale(1.04); }
.tc.p0 { color: #e5484d; } .tc.p1 { color: #2f7fe0; }
.tc.p0, .tc.p1 { animation: tcIn .22s ease-out; }
@keyframes tcIn { from { transform: scale(.4); opacity: 0; } }
.tc.line { background: #fef3c7; }
:root[data-dark] .tc.line { background: #78350f; }
.tc:disabled { cursor: default; }
.game:not(.my-turn) .tc:empty { opacity: .75; }
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; perspective: 600px; }
.mc { aspect-ratio: 1; padding: 0; border-radius: 10px; background: none; }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mc.up .mc-in { transform: rotateY(180deg); }
.mc-b, .mc-f { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mc-b { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .14) 0 6px, transparent 6px 12px), linear-gradient(135deg, var(--accent), #7c4dff); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.mem.th-halloween .mc-b { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 6px, transparent 6px 12px), linear-gradient(135deg, #f97316, #3b0764); }
.mc-f { transform: rotateY(180deg); background: var(--hover); font-size: 26px; }
.mc.ok.p0 .mc-f { background: #fee2e2; } .mc.ok.p1 .mc-f { background: #dbeafe; }
:root[data-dark] .mc.ok.p0 .mc-f { background: #7f1d1d; } :root[data-dark] .mc.ok.p1 .mc-f { background: #1e3a8a; }
.mc.miss .mc-f { box-shadow: inset 0 0 0 2px #e5484d; }
.mc:not(:disabled):hover .mc-b { filter: brightness(1.1); }
.mc:disabled { cursor: default; }
.game:not(.my-turn):not(.done) .mc:not(.up) { opacity: .8; }
.mc.busy .mc-in, .tc.busy { opacity: .6; }
.game-f { display: flex; justify-content: center; align-items: center; gap: 12px; }
.game-f:empty { display: none; }
.game-join { justify-self: center; }
.messages.bubbles .mgroup.mine .game { margin-left: auto; }

/* ===== Invitar ===== */
.inv-card { display: grid; gap: 4px; justify-items: center; }
.inv-card img { width: 100%; border-radius: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); aspect-ratio: 1200 / 630; object-fit: cover; background: var(--hover); }
.inv-reward { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; font-size: 13px; background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(236, 72, 153, .12)); }
.inv-reward > span:first-child { font-size: 24px; }
.rw { display: grid; justify-items: center; text-align: center; gap: 6px; }
.rw-ic { font-size: 54px; animation: evBob 2.4s ease-in-out infinite; }
.rw h2 { margin: 0; }
.rw-prev { display: grid; gap: 8px; justify-items: center; padding: 12px 16px; border-radius: 16px; background: var(--hover); width: 100%; }
.rw-prev .nsx { font-size: 18px; font-weight: 700; }
.rw-prev .messages { padding: 0 !important; background: none !important; overflow: visible; }
.rw-prev .mgroup { margin: 0 !important; align-items: center !important; }

/* ===== Tu mes en MeZaje ===== */
.wr-offer { text-align: center; display: grid; gap: 4px; justify-items: center; }
.wr-offer-ic { font-size: 50px; }
.wr-offer h2 { margin: 0; }
.wrap-ov { position: fixed; inset: 0; z-index: 400; background: rgba(5, 8, 15, .82); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.wrap-ov.in { opacity: 1; }
.wrap-st { position: relative; width: min(420px, 100vw); height: min(760px, 100dvh); border-radius: 22px; overflow: hidden; color: #fff; display: grid;
  background: linear-gradient(160deg, #2f7fe0, #7c4dff 55%, #e83e8c); transition: background .4s; }
.wrap-st.w2 { background: linear-gradient(160deg, #0ea5e9, #2563eb 60%, #4338ca); }
.wrap-st.w3 { background: linear-gradient(160deg, #f97316, #db2777 60%, #7c3aed); }
.wrap-st.w4 { background: linear-gradient(160deg, #facc15, #f97316 55%, #dc2626); }
.wrap-st.w5 { background: linear-gradient(160deg, #10b981, #0891b2 60%, #1e40af); }
.wrap-st.w6 { background: linear-gradient(160deg, #1e1b4b, #5b21b6 60%, #be185d); }
.wrap-st.w7 { background: linear-gradient(160deg, #a16207, #ca8a04 50%, #f59e0b); }
@media (max-width: 480px) { .wrap-st { border-radius: 0; height: 100dvh; } }
.wrap-bars { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.wrap-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.wrap-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.wrap-bars i.done b { width: 100%; }
.wrap-bars i.now b { animation: wrBar linear forwards; }
@keyframes wrBar { to { width: 100%; } }
.wrap-x { position: absolute; top: 20px; right: 12px; z-index: 4; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 16px; background: rgba(0, 0, 0, .18); }
.wrap-prev, .wrap-next { position: absolute; top: 60px; bottom: 90px; z-index: 2; background: none; }
.wrap-prev { left: 0; width: 30%; } .wrap-next { right: 0; width: 70%; }
.wrap-slide { display: grid; place-items: center; padding: 60px 26px 30px; z-index: 1; }
.ws { display: grid; justify-items: center; text-align: center; gap: 10px; animation: wsIn .45s ease-out; width: 100%; }
@keyframes wsIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.ws-k { font-size: 17px; font-weight: 700; opacity: .9; }
.ws-k2 { font-size: 15px; opacity: .85; }
.ws-big { font-size: 34px; font-weight: 800; line-height: 1.1; word-break: break-word; }
.ws-num { font-size: 92px; font-weight: 900; line-height: 1; letter-spacing: -.03em; text-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.ws-s { font-size: 22px; font-weight: 700; }
.ws .avatar { width: 140px; height: 140px; border-radius: 34px; font-size: 52px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .85), 0 14px 30px rgba(0, 0, 0, .25); }
.ws-emo { font-size: 110px; line-height: 1; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .25)); }
.ws-emo .cemo { height: 120px; max-width: 220px; cursor: default; }
.ws-more { display: flex; gap: 18px; margin-top: 6px; }
.ws-more span { display: grid; justify-items: center; font-size: 40px; }
.ws-more .cemo { height: 44px; }
.ws-more small { font-size: 13px; font-weight: 700; opacity: .85; }
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ws-grid > div { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: 18px; background: rgba(255, 255, 255, .16); }
.wg-i { font-size: 30px; }
.ws-grid b { font-size: 32px; line-height: 1.1; }
.ws-grid span:not(.wg-i) { font-size: 13px; opacity: .9; }
.ws-grid small { font-size: 11.5px; opacity: .8; }
.ws-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ws-badges span { display: grid; justify-items: center; gap: 4px; padding: 14px 12px; min-width: 110px; border-radius: 18px; background: rgba(255, 255, 255, .18); font-weight: 700; font-size: 13.5px; }
.ws-badges i { font-style: normal; font-size: 44px; }
.ws-card { width: min(250px, 62vw); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, .15); box-shadow: 0 16px 40px rgba(0, 0, 0, .3); }
.ws-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-img:not([src]) { visibility: hidden; }
.ws-actions { position: relative; z-index: 5; }
.ws-share { background: #fff !important; color: #4338ca !important; border: 0; padding: 12px 26px; font-size: 15px; font-weight: 800; }
.wrap-st.w8 .wrap-next { display: none; }
.wrap-st.w8 .wrap-prev { width: 18%; }
.ev-banner { align-items: flex-start; position: relative; padding-right: 38px; }
.ev-btns { flex-direction: row; align-items: center; margin-top: 8px; }
.ev-x { position: absolute; top: 2px; right: 2px; }

/* ===== 2.8 · Conectar con gente ===== */
.request.rq-rich { align-items: flex-start; flex-wrap: wrap; margin: 4px 10px 6px; padding: 10px; border-radius: 14px; }
.request.rq-rich .who { cursor: pointer; flex: 1 1 140px; }
.request.rq-rich .who b { font-size: 14px; }
.rq-note { font-style: italic; color: var(--text); margin-top: 3px; overflow-wrap: anywhere; }
.request.rq-rich .ok, .request.rq-rich .no { align-self: center; padding: 7px 11px; }
.rq-head { display: flex; gap: 12px; align-items: center; }
.rq-head h2 { margin: 0 0 2px; }
.photo-view .rq-note { max-width: 320px; text-align: center; font-size: 15px; padding: 8px 14px; border-radius: 14px; background: var(--hover); margin-top: 8px; }
.rq-common, .pv-common { font-size: 12.5px; color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 14px; margin-top: 8px; text-align: center; }
.pv-common { justify-self: center; margin: -4px auto 0; width: fit-content; max-width: 100%; }
.rq-common.muted { color: var(--muted); background: var(--hover); }
/* Quizá conozcas */
.sug { margin: 6px 10px 8px; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.sug-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 2px 4px 6px; }
.sug-i { display: flex; align-items: center; gap: 8px; padding: 5px 2px; }
.sug-who { flex: 1; min-width: 0; display: grid; text-align: left; color: var(--text); }
.sug-who b, .sug-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-who b { font-size: 13.5px; font-weight: 600; }
.sug-add { padding: 5px 12px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 700; }
.sug-x { width: 36px; height: 36px; font-size: 12px; color: var(--muted); flex: none; }
/* Participantes del grupo */
.pk-add { margin-left: auto; flex: none; min-width: 36px; height: 32px; padding: 0 10px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 16px; }
.pk-add.in { font-size: 12.5px; background: var(--accent); color: #fff; }
.pk-add:hover { background: var(--accent); color: #fff; }
.pk-sent { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; padding: 0 10px; }
.pick .dot { margin-left: auto; }
.gl-open { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.gl-open svg, .inv-share .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.qr-big { display: grid; place-items: center; padding: 6px 0; }
/* Tarjeta de contacto en el chat */
.ccard { width: 250px; max-width: 100%; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.cc-h { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 9px 12px 0; }
.cc-b { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; cursor: pointer; }
.cc-t { display: grid; min-width: 0; }
.cc-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-psm { font-style: italic; }
.cc-f { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: center; }
.cc-f .btn { width: 100%; padding: 8px; }
.cc-sent { color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px; }
.messages.bubbles .mgroup.mine .ccard { margin-left: auto; }
/* Privacidad */
.pol { display: grid; gap: 6px; }
.pol-o { display: flex !important; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; }
.pol-o:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pol-o input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.pol-o span { display: grid; }
.pol-o b { font-size: 14px; color: var(--text); }
.pol-o small { font-size: 12px; color: var(--muted); }
.request.rq-rich { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 8px; }
.request.rq-rich .rq-btns { grid-column: 2; display: flex; justify-content: flex-end; gap: 6px; }
.request.rq-rich .rq-btns .ok { padding: 7px 16px; }
.small.muted .link { color: var(--accent); font-size: inherit; }

/* ===== 2.9 · Modo fácil ===== */
.easy-head, .easy-bar, .easy-emo, .easy-only { display: none; }
.ez-open { display: grid !important; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 12px 14px; height: auto; border-width: 2px; }
.ez-open > span { grid-row: span 2; font-size: 30px; }
.ez-open b { font-size: 15px; }
.ez-open small { font-weight: 400; font-size: 12px; color: var(--muted); }
.ez-intro { display: grid; justify-items: center; text-align: center; gap: 8px; }
.ez-big { font-size: 54px; line-height: 1; }
.ez-intro h2 { margin: 0; }
.ez-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 8px; text-align: left; font-size: 15px; }

:root.easy { --ez: 20px; }
:root.easy.easy-xxl { --ez: 24px; }
/* Alto contraste: blanco y negro con bordes marcados */
:root.easy-hc { --bg: #ffffff !important; --panel: #ffffff !important; --text: #000000 !important; --muted: #2b2b2b !important; --line: #000000 !important; --hover: #eeeeee !important; --accent: #0047b3 !important; --accent-soft: #dbe7ff !important; }
:root.easy-hc body { background: #fff !important; }
:root.easy-hc body::before { display: none; }

/* Lo que se oculta */
:root.easy :is(#meWrap, .side-foot, #tabs, #pwaCard, #calBtn, #notesBtn, #expBtn, #watchPill, .conv-actions, #cNick, #ephBadge, #cdBar, #watchRoom, #notesPanel, .composer .tools, .emo-suggest, .fx-replay, .vfx-tag, .ev-banner, .sug, #vpFx, #vpRedo) { display: none !important; }
:root.easy .easy-only { display: inline; }

/* Cabecera «Hola, …» */
:root.easy .easy-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px; }
:root.easy .eh-av .avatar { width: 58px; height: 58px; border-radius: 16px; cursor: pointer; }
:root.easy .eh-hi { flex: 1; display: grid; line-height: 1.15; min-width: 0; }
:root.easy .eh-hi small { font-size: calc(var(--ez) * .8); color: var(--muted); }
:root.easy .eh-hi b { font-size: calc(var(--ez) * 1.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root.easy .eh-set { display: grid; justify-items: center; gap: 2px; padding: 8px 12px; border-radius: 16px; background: var(--hover); color: var(--text); font-size: calc(var(--ez) * .7); font-weight: 700; border: 2px solid var(--line); }
:root.easy .eh-set span { font-size: calc(var(--ez) * 1.3); line-height: 1; }

/* «Mis personas» */
:root.easy .list { padding: 6px 12px 20px; font-size: var(--ez); }
.ez-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { :root.easy .side .ez-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ez-tile { position: relative; display: grid; justify-items: center; gap: 8px; padding: 12px 10px 14px; border-radius: 22px; background: var(--panel); border: 2px solid var(--line); color: var(--text); text-align: center; min-height: 44px; }
.ez-tile:active { transform: scale(.98); }
.ez-tile.new { border-color: #e5383b; box-shadow: 0 0 0 3px rgba(229, 56, 59, .2); }
.ez-tile .ez-av { width: 100% !important; height: auto !important; aspect-ratio: 1; border-radius: 18px !important; font-size: 48px !important; box-shadow: none !important; }
.ez-tile b { font-size: var(--ez); line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.ez-on { position: absolute; top: 18px; left: 18px; width: 22px; height: 22px; border-radius: 50%; background: #22c55e; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.ez-badge { position: absolute; top: 4px; right: 4px; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 20px; background: #e5383b; color: #fff; font-size: 22px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.ez-star { color: #f59e0b; margin-right: 4px; }
.ez-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 30px 12px; font-size: var(--ez); }
.ez-empty span { color: var(--muted); }
:root.easy .request { font-size: calc(var(--ez) * .8); margin: 4px 0 10px; }
:root.easy .request button { font-size: calc(var(--ez) * .8); padding: 10px 16px; }
:root.easy :is(.mail-banner, .bday-banner) { font-size: calc(var(--ez) * .8); margin-left: 0; margin-right: 0; }

/* Conversación */
:root.easy .conv-head { padding: 10px 12px; gap: 10px; }
:root.easy #backBtn { width: auto; height: 52px; padding: 0 14px 0 8px; border-radius: 16px; background: var(--hover); border: 2px solid var(--line); display: inline-flex !important; align-items: center; gap: 4px; font-size: calc(var(--ez) * .85); font-weight: 700; color: var(--text); }
:root.easy #backBtn svg { width: 26px; height: 26px; }
@media (min-width: 761px) { :root.easy #backBtn { display: none !important; } }
:root.easy #cAvatar { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
:root.easy .conv-name b { font-size: calc(var(--ez) * 1.1); }
:root.easy #cPsm { font-size: calc(var(--ez) * .7); }
:root.easy .conv-name .dot { width: 14px; height: 14px; }
:root.easy .messages { font-size: var(--ez); }
:root.easy .messages .msg { font-size: var(--ez) !important; line-height: 1.35; padding: 10px 14px 9px !important; }
:root.easy .messages .msg .tm { font-size: calc(var(--ez) * .6); }
:root.easy .messages .mhead { font-size: calc(var(--ez) * .75) !important; }
:root.easy .messages .sys, :root.easy .day-sep, :root.easy .receipt { font-size: calc(var(--ez) * .7); }
:root.easy .messages .img-msg { max-width: min(100%, 320px); max-height: 380px; }
:root.easy .voice { padding: 10px 16px 10px 10px; gap: 12px; border-width: 2px; }
:root.easy .vplay { width: 56px; height: 56px; }
:root.easy .vplay svg { width: 26px; height: 26px; }
:root.easy .vtime { font-size: calc(var(--ez) * .8); font-weight: 700; }
.say { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: 0 0 -10px 8px; border-radius: 50%; background: var(--accent-soft); font-size: 20px; vertical-align: middle; float: right; }
:root.easy .messages.bubbles .mgroup.bs-strong .say { background: rgba(255, 255, 255, .25); }
:root.easy-hc .messages.bubbles .msg:not(.has-media):not(.big) { background: #fff !important; color: #000 !important; box-shadow: 0 0 0 2px #000 !important; }
:root.easy-hc .messages.bubbles .mgroup.mine .msg:not(.has-media):not(.big) { background: #0047b3 !important; color: #fff !important; box-shadow: none !important; }
:root.easy-hc .messages.bubbles .mgroup.mine .msg .tm { color: rgba(255, 255, 255, .9); }
:root.easy .typing { font-size: calc(var(--ez) * .75); }

/* Botones de abajo: Audio, Foto y Escribir */
:root.easy .easy-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 2px; }
:root.easy .composer.voice-mode .easy-bar { display: none; }
.eb { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; min-height: 92px; border-radius: 22px; font-size: calc(var(--ez, 20px) * .9); font-weight: 800; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.eb span { font-size: calc(var(--ez, 20px) * 1.6); line-height: 1; }
.eb-audio { background: #e5383b; } .eb-photo { background: #2563eb; } .eb-write { background: #16a34a; }
:root.easy-hc .eb { outline: 3px solid #000; }
:root.easy .composer.writing .eb-write { background: #0f5132; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5); }
:root.easy .composer:not(.writing) #inputRow { display: none !important; }
:root.easy .composer.writing .easy-emo { display: flex; justify-content: space-between; gap: 4px; padding: 8px 0 2px; }
.easy-emo button { flex: 1; font-size: 30px; height: 52px; border-radius: 14px; background: var(--hover); }
:root.easy #inputRow { gap: 10px; padding-top: 8px; }
:root.easy #input { font-size: var(--ez); min-height: 58px; padding: 14px 16px; border-width: 2px; }
:root.easy #sendBtn { font-size: var(--ez); padding: 0 22px; min-height: 58px; border-radius: 18px; }

/* Grabar en modo fácil */
:root.easy .vp-mic { width: 120px; height: 120px; }
:root.easy .vp-mic svg { width: 52px; height: 52px; }
:root.easy .vp-hint { font-size: calc(var(--ez) * .9); font-weight: 700; color: var(--text); }
:root.easy .voice-panel.recording .vp-hint { color: #e5383b; }
:root.easy .vp-head b, :root.easy .vp-time { font-size: var(--ez); }
:root.easy .vp-play { width: 60px; height: 60px; }
:root.easy .vp-actions .btn { font-size: calc(var(--ez) * .9); padding: 14px 18px; min-height: 60px; }
:root.easy .vp-actions .btn.primary { flex: 1; }
:root.easy #vpClose { width: 48px; height: 48px; }

/* «✓ Enviado» */
.ez-sent { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); z-index: 500; display: grid; justify-items: center; gap: 6px; padding: 22px 30px; border-radius: 26px; background: rgba(22, 163, 74, .95); color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); animation: ezIn .2s ease-out forwards; pointer-events: none; }
.ez-sent span { font-size: 54px; line-height: 1; }
.ez-sent.out { opacity: 0; transition: opacity .35s; }
@keyframes ezIn { to { transform: translate(-50%, -50%) scale(1); } }

/* Avisos y ventanas más grandes */
:root.easy .toast { width: min(420px, calc(100vw - 24px)); font-size: calc(var(--ez) * .85); padding: 16px 18px; border-width: 2px; }
:root.easy .toast b { font-size: var(--ez); }
:root.easy .modal-card { font-size: calc(var(--ez) * .85); }
:root.easy .modal-card .btn { font-size: calc(var(--ez) * .85); min-height: 52px; }
/* Ajustes del modo fácil */
.ez-card h2.ez-h { font-size: 26px; margin: 0; }
.ez-sec { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.ez-sec small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ez-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ez-seg button { padding: 14px; border-radius: 16px; border: 2px solid var(--line); font-weight: 800; font-size: 18px; color: var(--text); }
.ez-seg button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ez-check { display: flex !important; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); font-size: 18px; font-weight: 700; color: var(--text) !important; }
.ez-check input { width: 26px; height: 26px; accent-color: var(--accent); }
.ez-favs { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.ez-fav { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; border: 2px solid var(--line); color: var(--text); text-align: left; }
.ez-fav b { flex: 1; font-size: 18px; }
.ez-fav i { font-style: normal; font-size: 30px; color: var(--muted); }
.ez-fav.on { border-color: #f59e0b; background: rgba(245, 158, 11, .1); }
.ez-fav.on i { color: #f59e0b; }
.ez-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; font-size: 17px !important; border-width: 2px; }
.ez-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.ez-exit { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 58px; border-radius: 16px; border: 2px dashed #e5383b; color: #b91c1c; font-weight: 800; font-size: 16px; user-select: none; -webkit-user-select: none; touch-action: none; }
.ez-exit i { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(229, 56, 59, .18); }
.ez-exit.holding i { width: 100%; transition: width 2s linear; }
.ez-exit span { position: relative; }
.ez-done { flex: 1; min-height: 58px; font-size: 19px !important; }
:root.easy .vtime { white-space: nowrap; flex: none; }
:root.easy .vwave { min-width: 0; }
.say { float: none; margin: -4px 0 -6px 10px; }
:root.easy .eh-hi b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.1; }

/* ===== Novedades con portada ===== */
.news-entry.has-cover { padding-top: 0; overflow: hidden; }
.ne-cover { position: relative; margin: 0 -14px 4px; aspect-ratio: 2 / 1; background: linear-gradient(135deg, #2f7fe0, #7c4dff 55%, #e83e8c); overflow: hidden; }
.ne-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ne-ver { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ne-new.on-cover { position: absolute; right: 10px; top: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.news-entry.latest .ne-h b { font-size: 17px; }
/* Anteriores: portada en banda y plegadas */
.news-entry.folded { cursor: pointer; }
.news-entry.folded .ne-cover { aspect-ratio: 3.2 / 1; transition: aspect-ratio .3s; }
.news-entry.folded.open .ne-cover { aspect-ratio: 2 / 1; }
.news-entry.folded .ne-cover img { object-position: center 40%; }
.news-entry.folded:not(.open) .ne-items { display: none; }
.news-entry.folded .ne-h { display: flex; align-items: center; gap: 8px; }
.news-entry.folded .ne-h b { flex: 1; }
.ne-chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; flex: none; }
.news-entry.folded.open .ne-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.news-entry.folded:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.news-entry.folded:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 3.0 · Cabecera: barra con la app y sus botones, foto más grande y filtro junto al buscador ===== */
.app-bar { position: relative; z-index: 4; display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; }
.ab-logo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.ab-logo img { width: 30px; height: 30px; border-radius: 9px; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.ab-logo b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ab-tools { display: flex; gap: 6px; flex: none; }
.ab-tools .icon-btn, .search-row .view-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--text); flex: none; }
.ab-tools .icon-btn svg, .search-row .view-btn svg { width: 20px; height: 20px; }
.ab-tools .icon-btn:hover, .search-row .view-btn:hover { background: var(--accent-soft); color: var(--accent); }
.me-wrap.has-cover .ab-tools .icon-btn, .me-wrap.has-cover .search-row .view-btn { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.me-wrap.tone-dark .ab-logo b { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.me-wrap.tone-dark :is(.ab-tools .icon-btn, .search-row .view-btn) { background: rgba(255, 255, 255, .18); color: #fff; }
.me-wrap.tone-light .ab-logo b { color: #111827; }
.me-wrap.tone-light :is(.ab-tools .icon-btn, .search-row .view-btn) { background: rgba(255, 255, 255, .6); color: #1f2937; }
.ab-tools .news-btn .news-dot { top: 6px; right: 6px; }
/* Placa del perfil: sin hueco a la derecha (el botón de novedades ya está arriba) y foto más grande */
.me-wrap .me { padding: 14px; gap: 16px; }
.me-wrap .me .avatar.lg { width: 104px; height: 104px; border-radius: 28px; font-size: 38px; }
.me-wrap .me-name { font-size: 22px; }
.me-wrap .me > .me-info { flex: 1; min-width: 0; }
/* El nombre y el mensaje personal pueden ocupar dos líneas antes de cortarse (en escritorio la columna es estrecha) */
.me-wrap .me-name { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.15; }
.me-wrap #mePsmView { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Buscador con el botón «Ver la lista por» */
.me-wrap .search-row { position: relative; align-items: center; gap: 8px; }
.me-wrap .search-row input { flex: 1; min-width: 0; height: 42px; border-radius: 14px; }
.search-row .view-btn.on { box-shadow: inset 0 0 0 2px var(--accent); }
.search-row .view-btn svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.view-menu { position: absolute; left: auto; right: 0; top: calc(100% + 6px); z-index: 40; width: 270px; max-width: calc(100vw - 32px); padding: 6px; border-radius: 16px; }
.view-menu .vm-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; }
.me-wrap .view-menu .vm-t { color: #6b7280; }
.view-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 11px; text-align: left; color: var(--text); }
.view-menu button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.view-menu button span { display: grid; flex: 1; }
.view-menu button b { font-size: 14px; }
.view-menu button small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.view-menu button.on { background: var(--accent-soft); color: var(--accent); }
.view-menu button.on::after { content: "✓"; font-weight: 800; }
.view-menu button:hover:not(.on) { background: var(--hover); }
.me-wrap .view-menu { color: var(--text); --muted: #6b7280; --hover: #f1f3f6; }
:root[data-dark] .me-wrap .view-menu { --muted: #9ca3af; --hover: rgba(255, 255, 255, .08); }
@media (max-width: 360px) { .me-wrap .me .avatar.lg { width: 84px; height: 84px; border-radius: 24px; } .ab-logo b { font-size: 18px; } .ab-tools .icon-btn { width: 36px; height: 36px; } }
@media (max-height: 500px) and (pointer: coarse) {
  .app-bar { margin-bottom: 6px; }
  .ab-logo img { width: 24px; height: 24px; } .ab-logo b { font-size: 17px; }
  .ab-tools .icon-btn, .search-row .view-btn { width: 34px; height: 34px; }
  .me-wrap .me { padding: 8px 10px; }
  .me-wrap .me .avatar.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 20px; }
  .me-wrap .search-row input { height: 36px; }
}
/* Pie de la lista: los cuatro botones caben también en móviles de 320 px */
.foot-btn { min-width: 0; }
.foot-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) { .foot-btn { font-size: 10px; letter-spacing: -.01em; } }
.side { min-width: 0; } /* sin esto, una canción o un estado muy largos ensanchaban la columna en móviles pequeños */

/* ===== 3.0 · Brillo de estado en la esquina de la placa del perfil ===== */
@property --stg { syntax: '<color>'; inherits: false; initial-value: rgba(0, 0, 0, 0); }
.me-wrap .me { position: relative; isolation: isolate; }
.me-wrap .me::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  --stg: var(--offline);
  background:
    radial-gradient(125% 100% at 0% 100%, color-mix(in srgb, var(--stg) 78%, transparent) 0%, color-mix(in srgb, var(--stg) 34%, transparent) 28%, transparent 56%);
  transition: --stg .6s ease;
}
.me-wrap .me[data-st=online]::before { --stg: var(--online); }
.me-wrap .me:is([data-st=busy], [data-st=phone])::before { --stg: var(--busy); }
.me-wrap .me:is([data-st=away], [data-st=brb], [data-st=lunch])::before { --stg: var(--away); }
.me-wrap .me[data-st=invisible]::before { --stg: color-mix(in srgb, var(--offline) 70%, transparent); }
.me-wrap.tone-light .me::before, .me-wrap:not(.has-cover) .me::before { opacity: .8; }
@media (max-height: 500px) and (pointer: coarse) { .me-wrap .me::before { background: radial-gradient(90% 140% at 0% 100%, color-mix(in srgb, var(--stg) 55%, transparent), transparent 55%); } }
:root.easy .me-wrap .me::before { display: none; }

/* ===== 3.0 · Foto de perfil animada ===== */
.avatar > .av-anim { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; opacity: 0; transition: opacity .35s; pointer-events: none; }
.avatar > .av-anim.on { opacity: 1; }
.btn.an-open { display: flex; align-items: center; gap: 8px; }
.btn.an-open small { margin-left: auto; padding: 1px 7px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
#modalCard.an-card { width: min(440px, 100%); }
.an-wrap { display: grid; gap: 12px; }
.an-wrap h2 { margin-bottom: 0; }
.an-sub { margin: -6px 0 0; }
.an-stage { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 26%; overflow: hidden; background: #0b0d10; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.an-stage > canvas, .an-stage > video, .an-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; touch-action: none; }
.an-stage > canvas { cursor: grab; }
.an-stage > canvas:active { cursor: grabbing; }
.an-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 20px; text-align: center; color: #e5e7eb; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 45%, #111827), #0b0d10 70%); }
.an-empty span { font-size: 44px; }
.an-empty b { font-size: 15px; }
.an-empty small { font-size: 12.5px; opacity: .75; }
.an-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); background: rgba(0, 0, 0, .18); animation: an-pop .8s ease-out infinite; }
@keyframes an-pop { from { transform: scale(1.25); opacity: .4; } 30% { transform: scale(1); opacity: 1; } }
.an-prog { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.an-prog i { display: block; height: 100%; width: 0; background: #ef4444; border-radius: inherit; }
.an-src { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.an-src .btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 10px; font-weight: 600; }
.an-src .btn span { font-size: 18px; }
.an-rec { justify-self: center; display: flex; align-items: center; gap: 10px; padding: 10px 22px 10px 12px; border-radius: 40px; background: #ef4444; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px rgba(239, 68, 68, .4); }
.an-rec i { width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 7px #ef4444, inset 0 0 0 9px #fff; }
.an-rec.busy { opacity: .7; pointer-events: none; }
.an-trim { display: grid; gap: 10px; }
.an-trim label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.an-trim label span { display: flex; justify-content: space-between; }
.an-trim label b { color: var(--accent); font-variant-numeric: tabular-nums; }
.an-trim input[type=range] { width: 100%; accent-color: var(--accent); }
.an-note:empty { display: none; }
.an-wrap .row { align-items: center; }
.an-wrap #anDel { margin-right: auto; }
@media (max-width: 380px) { .an-src { grid-template-columns: 1fr; } }

/* ===== 3.0 · Tinta: bote de pintura ===== */
#inkCanvas.tool-fill { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 20 20' fill='none' stroke='%231f2937' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 9.5l5.5-5.5 6 6-5.5 5.5a1.5 1.5 0 01-2.1 0L4.5 11.6a1.5 1.5 0 010-2.1z' fill='%23fff'/%3E%3Cpath d='M17 13.5s1.5 1.8 1.5 2.8a1.5 1.5 0 01-3 0c0-1 1.5-2.8 1.5-2.8z' fill='%231f2937'/%3E%3C/svg%3E") 17 18, cell; }
#inkCanvas.tool-erase { cursor: cell; }
.ink-sizes button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ink-sizes [data-fill].on { color: var(--accent); background: var(--accent-soft); }

/* ===== 3.0 · Cristal: el panel de notas va encima de la conversación, que ya tiene su propio desenfoque,
   y el navegador no puede desenfocar dos veces. Se le da un fondo casi opaco para que se lea bien. ===== */
:root[data-theme^=glass] .notes-panel { background: color-mix(in srgb, var(--bg) 97%, transparent); box-shadow: -10px 0 30px rgba(10, 20, 50, .14); }
:root[data-theme=glass-dark] .notes-panel { background: color-mix(in srgb, #121726 97%, transparent); box-shadow: -10px 0 30px rgba(0, 0, 0, .4); }
:root[data-theme^=glass] .notes-panel :is(#npText, .np-add input) { background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
:root[data-theme=glass-dark] .notes-panel :is(#npText, .np-add input) { background: rgba(255, 255, 255, .06); }

/* ===== 3.0 · Juegos: hasta 6 jugadores, tableros de memoria más grandes y cifras y letras ===== */
.game.wide { width: 300px; }
.game-pl.many { flex-wrap: wrap; gap: 5px; }
.game-pl.many .gp { max-width: calc(50% - 4px); }
.gp .gp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--muted)); flex: none; }
.gp.p0 { --pc: #e5484d; } .gp.p1 { --pc: #2f7fe0; } .gp.p2 { --pc: #2ea44f; } .gp.p3 { --pc: #f2711c; } .gp.p4 { --pc: #8e44ec; } .gp.p5 { --pc: #e83e8c; }
.gp.empty { background: none; border: 1px dashed var(--line); color: var(--muted); }
.gp.out { opacity: .45; text-decoration: line-through; }
.gp em { font-style: normal; color: var(--online); font-weight: 800; }
.mem { grid-template-columns: repeat(var(--cols, 4), 1fr); }
.mem[style*="--cols:6"] { gap: 4px; }
.mem[style*="--cols:6"] .mc-f { font-size: 20px; }
.mem[style*="--cols:6"] .mc, .mem[style*="--cols:6"] .mc-b, .mem[style*="--cols:6"] .mc-f { border-radius: 8px; }
.mc.ok.p2 .mc-f { background: #dcfce7; } .mc.ok.p3 .mc-f { background: #ffedd5; } .mc.ok.p4 .mc-f { background: #ede9fe; } .mc.ok.p5 .mc-f { background: #fce7f3; }
:root[data-dark] .mc.ok.p2 .mc-f { background: #14532d; } :root[data-dark] .mc.ok.p3 .mc-f { background: #7c2d12; } :root[data-dark] .mc.ok.p4 .mc-f { background: #4c1d95; } :root[data-dark] .mc.ok.p5 .mc-f { background: #831843; }
/* Opciones al retar */
.gm-seg { display: flex; gap: 6px; }
.gm-seg button { flex: 1; padding: 10px 0; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 800; font-size: 16px; }
.gm-seg button.on, .gm-sizes button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.gm-hint { margin: 4px 0 0; }
.gm-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gm-sizes button { display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 14px; border: 1.5px solid var(--line); }
.gm-sizes small { color: var(--muted); font-size: 11.5px; }
.gm-grid { display: grid; gap: 2px; margin-bottom: 6px; }
.gm-grid b { width: 7px; height: 7px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.gm-grid.g-s { grid-template-columns: repeat(4, 7px); } .gm-grid.g-m, .gm-grid.g-l { grid-template-columns: repeat(6, 7px); }
/* Cifras y letras */
.cyl-timer { position: relative; height: 22px; border-radius: 11px; background: var(--hover); overflow: hidden; }
.cyl-timer i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 30%, transparent); transition: width 1s linear; }
.cyl-timer.low i { background: color-mix(in srgb, var(--busy) 40%, transparent); }
.cyl-timer span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 800; line-height: 22px; font-variant-numeric: tabular-nums; }
.cyl-letters { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.cyl-nums { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.cyl-t { aspect-ratio: 1 / 1.15; border-radius: 7px; background: linear-gradient(#fff, #eef2f7); color: #13203a; font-weight: 900; font-size: 17px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .12); display: grid; place-items: center; padding: 0; transition: transform .1s, opacity .15s; }
.cyl-t.num { aspect-ratio: auto; height: 38px; font-size: 16px; background: linear-gradient(#2f7fe0, #1f5fc4); color: #fff; }
.cyl-t:not(:disabled):active { transform: scale(.92); }
.cyl-t.used { opacity: .25; }
.cyl-t:disabled { cursor: default; }
.cyl-target { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.cyl-target small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cyl-target b { font-size: 34px; font-weight: 900; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--accent); }
.cyl-ops { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.cyl-op { height: 32px; border-radius: 8px; background: var(--hover); font-weight: 800; font-size: 16px; }
.cyl-op:active { transform: scale(.94); }
.cyl-line { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 4px 4px 12px; border-radius: 10px; border: 1.5px solid var(--line); }
.cyl-w { flex: 1; min-width: 0; font-weight: 800; letter-spacing: .06em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cyl-w.ph { font-weight: 400; letter-spacing: 0; color: var(--muted); font-size: 13px; }
.cyl-val { color: var(--accent); font-weight: 700; white-space: nowrap; }
.cyl-del { width: 34px; height: 32px; border-radius: 8px; font-size: 16px; color: var(--muted); }
.cyl-del:hover { background: var(--hover); color: var(--text); }
.cyl-acts { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.cyl-wait { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.cyl-wait b { color: var(--text); letter-spacing: .04em; }
.cyl-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cyl-res li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 9px; background: var(--hover); font-size: 12.5px; }
.cyl-res li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.cyl-res li span { overflow-wrap: anywhere; letter-spacing: .02em; }
.cyl-res li em { font-style: normal; font-weight: 800; color: var(--muted); }
.cyl-res li.ok em { color: var(--online); }
.cyl-best { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.cyl-best b { color: var(--text); }
.game [data-cyl-next] { justify-self: center; }
.cyl-nx { font-variant-numeric: tabular-nums; }
/* 3.0 · Guiño Fuegote */
.wink-layer.hot { background: radial-gradient(ellipse at 50% 110%, rgba(255, 90, 20, .55), rgba(255, 40, 80, .18) 55%, transparent 80%); animation: wfade 3.2s both; }

/* ===== 3.0 · Editar y eliminar mensajes ===== */
.msg { position: relative; }
.m-more { position: absolute; top: 50%; transform: translateY(-50%); right: calc(100% + 4px); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--panel); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); opacity: 0; transition: opacity .15s; z-index: 2; }
.m-more svg { width: 16px; height: 16px; fill: currentColor; }
.msg.can-edit:hover .m-more, .m-more:focus-visible { opacity: 1; }
.m-more:hover { color: var(--text); }
@media (hover: none) { .m-more { display: none; } }
.messages:not(.bubbles) .m-more { right: auto; left: auto; position: static; transform: none; display: inline-grid; width: 22px; height: 22px; box-shadow: none; background: none; vertical-align: middle; margin-right: 2px; }
.msg.pressed { transform: scale(.97); transition: transform .15s; }
.msg.editing { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg.deleted { font-style: italic; color: var(--muted) !important; background: none !important; border: 1px dashed var(--line) !important; box-shadow: none !important; }
.msg.deleted .del-txt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.msg.deleted .del-txt svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tm .edited { font-style: italic; }
.msg-menu { min-width: 210px; }
.msg-menu button svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.msg-menu .mm-note { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
.edit-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; margin: 0 12px; border-radius: 12px 12px 0 0; background: var(--accent-soft); color: var(--accent); border-left: 3px solid var(--accent); }
.edit-bar > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.edit-bar > span { flex: 1; min-width: 0; display: grid; font-size: 12.5px; }
.edit-bar .eb-txt { color: var(--text); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-bar .icon-btn { width: 30px; height: 30px; color: var(--accent); }
.edit-bar .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
:root.easy .edit-bar { display: none !important; }
@media (hover: none) { .msg.can-edit { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
/* Foto animada: la vista previa es el vídeo en directo; el lienzo de grabación va oculto detrás */
.an-stage > canvas.an-cv { opacity: 0; pointer-events: none; }
.an-stage > video.an-live { transform-origin: 50% 50%; will-change: transform; }
.an-stage.movable { cursor: grab; touch-action: none; }
.an-stage.movable:active { cursor: grabbing; }

/* ===== 3.1 · Tinta: selector de modo y modo artista ===== */
.ink-head { justify-content: space-between; align-items: center; }
.ink-mode { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--hover); }
.ink-mode button { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ink-mode button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
#modalCard.art-card { max-width: none; width: min(1180px, 100%); height: min(860px, 94dvh); max-height: none; padding: 0; overflow: hidden; display: block; border-radius: 20px; }
.art { --art-desk: #e6eaf0; position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; background: var(--panel); }
:root[data-dark] .art { --art-desk: #0d0f13; }
.art-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.art-sp { flex: 1; }
.art-ib { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--text); flex: none; }
.art-ib:hover:not(:disabled) { background: var(--hover); }
.art-ib:disabled { opacity: .35; }
.art-ib svg, .art-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.art-send { padding: 9px 18px; }
.art-stage { position: relative; overflow: hidden; background: var(--art-desk); }
.art-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.art-stage canvas[data-cur-tool="brush"], .art-stage canvas[data-cur-tool="erase"], .art-stage canvas[data-cur-tool="shape"] { cursor: crosshair; }
.art-stage canvas[data-cur-tool="hand"] { cursor: grab; }
.art-stage canvas[data-cur-tool="text"] { cursor: text; }
.art-stage canvas[data-cur-tool="pick"], .art-stage canvas[data-cur-tool="fill"], .art-stage canvas[data-cur-tool="sticker"] { cursor: cell; }
.art-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--panel); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.art-zoom button { min-width: 32px; height: 30px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; padding: 0 6px; }
.art-zoom button:hover { background: var(--hover); }
.art-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 20px; background: rgba(17, 24, 39, .82); color: #fff; font-size: 12.5px; font-weight: 600; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.art-textin { position: absolute; z-index: 3; width: 220px; min-height: 44px; padding: 8px 10px; border: 2px dashed var(--accent); border-radius: 10px; background: rgba(255, 255, 255, .85); font-weight: 700; resize: none; outline: none; line-height: 1.15; }
.art-opts { min-height: 58px; padding: 8px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; align-content: center; }
.art-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.art-row::-webkit-scrollbar { display: none; }
.art-brushes button, .art-chips button, .art-pals button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--text); }
.art-brushes button span { font-size: 17px; }
.art-brushes button.on, .art-chips button.on, .art-pals button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.art-sls { gap: 18px; flex-wrap: wrap; overflow: visible; }
.art-sl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex: 1 1 180px; min-width: 0; }
.art-sl input { flex: 1; min-width: 70px; accent-color: var(--accent); }
.art-sl b { min-width: 34px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.art-note { color: var(--muted); font-size: 12px; }
.art-sws { gap: 7px; }
.art-sw { flex: none; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); position: relative; }
.art-sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.art-more { display: grid; place-items: center; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e); cursor: pointer; overflow: hidden; }
.art-more span { color: #fff; font-weight: 800; font-size: 18px; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); pointer-events: none; }
.art-more input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.art-rec small { flex: none; color: var(--muted); font-size: 11.5px; font-weight: 700; margin-right: 2px; }
.art-rec .art-sw { width: 24px; height: 24px; }
.art-stks button { flex: none; width: 42px; height: 42px; border-radius: 10px; font-size: 26px; display: grid; place-items: center; }
.art-stks button img { width: 30px; height: 30px; object-fit: contain; }
.art-stks button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.art-bgb i { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); background: #fff; }
.art-bgb.bg-cuaderno i { background: repeating-linear-gradient(#fffef6 0 4px, #c7d7ef 4px 5px); }
.art-bgb.bg-cuadricula i { background: #fff; background-image: linear-gradient(#dfe6f0 1px, transparent 1px), linear-gradient(90deg, #dfe6f0 1px, transparent 1px); background-size: 5px 5px; }
.art-bgb.bg-pizarra i { background: #22382e; }
.art-bgb.bg-negro i { background: #111318; }
.art-bgb.bg-foto i { background: linear-gradient(135deg, #f59e0b, #ec4899 60%, #6366f1); }
.art-tools { display: flex; gap: 2px; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; justify-content: center; }
.art-tools::-webkit-scrollbar { display: none; }
.art-tools button { flex: none; display: grid; justify-items: center; gap: 3px; min-width: 62px; padding: 6px 4px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--muted); }
.art-tools button:hover { background: var(--hover); color: var(--text); }
.art-tools button.on { background: var(--accent-soft); color: var(--accent); }
.art-tools button.act:not(.on) { color: var(--accent); }
.art-div { flex: none; width: 1px; margin: 6px 4px; background: var(--line); }
.art-colorbtn i { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--line); }
.art-confirm { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(15, 20, 30, .35); padding: 16px; }
.art-confirm > div { width: min(340px, 100%); background: var(--panel); border-radius: 16px; padding: 20px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.art-confirm span { color: var(--muted); font-size: 13.5px; }
.art-confirm .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.art-confirm .danger-btn { background: var(--danger); border-color: var(--danger); }
@media (max-width: 760px) {
  #modalCard.art-card { width: 100%; height: var(--vvh, 100dvh); border-radius: 0; animation: none; }
  #modalCard.art-card::before { display: none; }
  .art-top { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .art-top .ink-mode button { padding: 6px 9px; }
  .art-tools { justify-content: flex-start; }
  .art-tools button { min-width: 56px; }
  .art-opts { padding: 8px 10px; }
  .art-sls { gap: 10px; }
  .art-sl { flex-basis: 100%; }
}
/* «Ver cómo se dibujó» */
.img-wrap { position: relative; display: inline-block; }
.ink-play { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 16px; background: rgba(17, 24, 39, .78); color: #fff; font-size: 12px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ink-play svg { width: 14px; height: 14px; fill: currentColor; }
.ink-play:hover { background: rgba(17, 24, 39, .92); }
#modalCard.art-play-card { max-width: 720px; }
.art-play { display: grid; gap: 12px; }
.art-play-h { display: flex; align-items: center; justify-content: space-between; }
.art-play-st { position: relative; height: min(62dvh, 540px); display: grid; place-items: center; background: var(--hover); border-radius: 14px; overflow: hidden; }
.art-play-st canvas { border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.art-play-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; text-align: center; padding: 20px; }
.art-play-bar { display: flex; align-items: center; gap: 12px; }
.art-play-prog { flex: 1; height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.art-play-prog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.art .art-sl { display: flex; grid-template-columns: none; }
@media (max-width: 760px) {
  .art-tools { gap: 0; padding-left: 4px; padding-right: 4px; }
  .art-tools button { min-width: 46px; padding: 8px 4px; }
  .art-tools button span { display: none; }
  .art-tools .art-colorbtn { order: -2; }
  .art-tools .art-div { order: -1; }
  .art-sls { gap: 2px; }
  .art-sl { font-size: 12px; }
}

/* ===== 3.1 · MeZaje: el punto de la j es un punto de estado verde ===== */
.ab-logo .jd { position: relative; }
.ab-logo .jd::after { content: ''; position: absolute; left: .02em; top: .06em; width: .27em; height: .27em; border-radius: 50%; background: linear-gradient(#6ee07a, #2fa84a); box-shadow: 0 0 0 .045em var(--jd-ring, transparent); }

/* ===== 3.1 · Ayuda de instalación al llegar desde la web ===== */
.inst-land { text-align: center; }
.inst-land > img { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 6px 20px rgba(31, 95, 196, .3); margin: 4px auto 6px; display: block; }
.inst-land h2 { margin: 6px 0 4px; }
.inst-land #ilText { margin: 0 0 12px; }
.inst-land .ios-steps { text-align: left; }
.inst-land .row { justify-content: center; }
.auth-card .auth-icon { width: 72px; height: 72px; border-radius: 19px; margin: 0 auto 4px; display: block; box-shadow: 0 8px 22px rgba(31, 95, 196, .3); }
.brand .jd { position: relative; font-weight: inherit; color: inherit; }
.brand .jd::after { content: ''; position: absolute; left: .02em; top: .06em; width: .27em; height: .27em; border-radius: 50%; background: linear-gradient(#6ee07a, #2fa84a); }
