/* =====================================================================
   Temas: cada uno solo redefine variables. El resto del CSS las usa.
   ===================================================================== */
:root, [data-theme="light"], [data-theme="system"] {
  --bg: #eef0f7;
  --bg-glow-1: #c7d2fe; --bg-glow-2: #fbcfe8;
  --panel: #ffffff; --panel-2: #f6f7fb; --hover: #eef0f8;
  --line: #e4e7f0; --text: #171a2c; --muted: #6b7088;
  --accent: #4f46e5; --accent-2: #7c3aed; --accent-ink: #ffffff; --accent-soft: #eceafe;
  --mine-text: #ffffff; --theirs: #ffffff; --theirs-text: #171a2c;
  --chat-bg: #f6f7fb; --dots: rgb(79 70 229 / .07);
  --warn-bg: #fff6e6; --warn: #9a5b00; --error: #c4302b; --ok: #16a34a;
  --shadow: 0 1px 2px rgb(20 20 50 / .06), 0 8px 24px rgb(20 20 50 / .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0b0d18; --bg-glow-1: #312e81; --bg-glow-2: #581c87;
    --panel: #14172a; --panel-2: #0f1220; --hover: #1d2138;
    --line: #262a44; --text: #e8eaf6; --muted: #8d92b0;
    --accent: #818cf8; --accent-2: #a855f7; --accent-ink: #0b0d18; --accent-soft: #23264a;
    --mine-text: #0b0d18; --theirs: #1d2138; --theirs-text: #e8eaf6;
    --chat-bg: #0f1220; --dots: rgb(129 140 248 / .07);
    --warn-bg: #2b2210; --warn: #f5b950; --error: #ff7b72; --ok: #4ade80;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg: #0b0d18; --bg-glow-1: #312e81; --bg-glow-2: #581c87;
  --panel: #14172a; --panel-2: #0f1220; --hover: #1d2138;
  --line: #262a44; --text: #e8eaf6; --muted: #8d92b0;
  --accent: #818cf8; --accent-2: #a855f7; --accent-ink: #0b0d18; --accent-soft: #23264a;
  --mine-text: #0b0d18; --theirs: #1d2138; --theirs-text: #e8eaf6;
  --chat-bg: #0f1220; --dots: rgb(129 140 248 / .07);
  --warn-bg: #2b2210; --warn: #f5b950; --error: #ff7b72; --ok: #4ade80;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
  color-scheme: dark;
}

[data-theme="midnight"] {
  --bg: #050816; --bg-glow-1: #1e3a8a; --bg-glow-2: #6d28d9;
  --panel: #0c1230; --panel-2: #080d24; --hover: #151d45;
  --line: #1f2a5c; --text: #e6e9ff; --muted: #8b93c9;
  --accent: #a78bfa; --accent-2: #60a5fa; --accent-ink: #070b1d; --accent-soft: #1f2459;
  --mine-text: #070b1d; --theirs: #151d45; --theirs-text: #e6e9ff;
  --chat-bg: #080d24; --dots: rgb(167 139 250 / .09);
  --warn-bg: #2a1f3d; --warn: #fbbf24; --error: #fb7185; --ok: #34d399;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 20 / .5);
  color-scheme: dark;
}

[data-theme="forest"] {
  --bg: #eef2ef; --bg-glow-1: #eef2ef; --bg-glow-2: #eef2ef;
  --panel: #ffffff; --panel-2: #f5f8f6; --hover: #edf3ef;
  --line: #e0e7e2; --text: #142019; --muted: #5d6e65;
  --accent: #1f7a52; --accent-2: #1a6b48; --accent-ink: #ffffff; --accent-soft: #e2f0e8;
  --mine-text: #ffffff; --theirs: #ffffff; --theirs-text: #142019;
  --chat-bg: #f3f6f4; --dots: rgb(31 122 82 / .05);
  --warn-bg: #fdf5e3; --warn: #8a5a00; --error: #b4322b; --ok: #1f7a52;
  --shadow: 0 1px 2px rgb(16 40 28 / .05), 0 6px 20px rgb(16 40 28 / .06);
  color-scheme: light;
}

[data-theme="sunset"] {
  --bg: #fdeee3; --bg-glow-1: #fecaca; --bg-glow-2: #fde68a;
  --panel: #ffffff; --panel-2: #fff7f1; --hover: #fff0e6;
  --line: #f6dfd2; --text: #2d1710; --muted: #8b6658;
  --accent: #e8573f; --accent-2: #f59e0b; --accent-ink: #ffffff; --accent-soft: #fde5dc;
  --mine-text: #ffffff; --theirs: #ffffff; --theirs-text: #2d1710;
  --chat-bg: #fff7f1; --dots: rgb(232 87 63 / .08);
  --warn-bg: #fff3d6; --warn: #92400e; --error: #b91c1c; --ok: #15803d;
  color-scheme: light;
}

[data-theme="sakura"] {
  --bg: #fbeef3; --bg-glow-1: #fbcfe8; --bg-glow-2: #ddd6fe;
  --panel: #ffffff; --panel-2: #fdf5f8; --hover: #fbe9f0;
  --line: #f3dbe5; --text: #2e1622; --muted: #8f6577;
  --accent: #d63f7a; --accent-2: #a855f7; --accent-ink: #ffffff; --accent-soft: #fbe1ec;
  --mine-text: #ffffff; --theirs: #ffffff; --theirs-text: #2e1622;
  --chat-bg: #fdf5f8; --dots: rgb(214 63 122 / .08);
  --warn-bg: #fff4e0; --warn: #92400e; --error: #be123c; --ok: #15803d;
  color-scheme: light;
}

[data-theme="terminal"] {
  --bg: #000000; --bg-glow-1: #052e10; --bg-glow-2: #001a05;
  --panel: #050d06; --panel-2: #020602; --hover: #0b1f0e;
  --line: #134d1f; --text: #b7ffc8; --muted: #4fb36a;
  --accent: #33ff66; --accent-2: #00d147; --accent-ink: #001a05; --accent-soft: #0b2a12;
  --mine-text: #001a05; --theirs: #071509; --theirs-text: #b7ffc8;
  --chat-bg: #020602; --dots: rgb(51 255 102 / .06);
  --warn-bg: #1f1a00; --warn: #ffe066; --error: #ff5c5c; --ok: #33ff66;
  --shadow: 0 0 0 1px #134d1f, 0 0 24px rgb(51 255 102 / .08);
  --font: var(--mono);
  --radius: 6px;
  color-scheme: dark;
}

[data-theme="contrast"] {
  --bg: #000000; --bg-glow-1: #000000; --bg-glow-2: #000000;
  --panel: #000000; --panel-2: #000000; --hover: #1a1a1a;
  --line: #ffffff; --text: #ffffff; --muted: #e6e6e6;
  --accent: #ffd400; --accent-2: #ffd400; --accent-ink: #000000; --accent-soft: #333000;
  --mine-text: #000000; --theirs: #000000; --theirs-text: #ffffff;
  --chat-bg: #000000; --dots: transparent;
  --warn-bg: #000000; --warn: #ffd400; --error: #ff6b6b; --ok: #7CFC00;
  --shadow: none;
  color-scheme: dark;
}
[data-theme="contrast"] .msg.theirs, [data-theme="contrast"] .composer input { border: 2px solid #fff; }

/* =====================================================================
   Base
   ===================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: var(--font-size, 15px)/1.45 var(--font);
  color: var(--text);
  background:
    radial-gradient(60vmax 60vmax at 0% 0%, color-mix(in srgb, var(--bg-glow-1) 55%, transparent), transparent 60%),
    radial-gradient(60vmax 60vmax at 100% 100%, color-mix(in srgb, var(--bg-glow-2) 50%, transparent), transparent 60%),
    var(--bg);
}
.theme-switching *, .theme-switching *::before { transition: none !important; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 650; border-radius: 12px; padding: 12px 18px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform .15s, filter .15s;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel);
}
.chip:hover { background: var(--hover); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn circle { fill: currentColor; stroke: none; }
.icon-btn svg circle[r="4"] { fill: none; stroke: currentColor; }

.avatar {
  --h: 240;
  width: 40px; height: 40px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-weight: 700; text-transform: uppercase; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 70% 50%));
}
[data-theme="terminal"] .avatar, [data-theme="contrast"] .avatar {
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent);
}

/* =====================================================================
   Acceso
   ===================================================================== */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; position: relative; }
.corner { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
          background: var(--panel); box-shadow: var(--shadow); }
.login-card {
  width: min(420px, 100%); background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 26px;
  padding: 32px 28px 24px; box-shadow: var(--shadow);
}
.brand { text-align: center; }
.brand-mark {
  width: 68px; height: 68px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-mark img { width: 44px; height: 44px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .2)); }
.brand h1 { margin: 14px 0 4px; font-size: 26px; letter-spacing: -.02em; }
.brand p { margin: 0; font-size: 14px; }
#login-form { display: grid; gap: 14px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--accent);
                     box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); min-height: 0; }
.hint:empty { display: none; }
.error { color: var(--error); margin: 0; font-size: 14px; }
.error:empty { display: none; }
.features {
  list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.features li {
  font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px;
}
.features b { color: var(--accent); font-weight: 650; }
.disclaimer { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--warn); }

/* =====================================================================
   App
   ===================================================================== */
.app {
  height: 100%; display: grid; grid-template-columns: 340px 1fr; gap: 14px; padding: 14px;
  max-width: 1400px; margin: 0 auto;
}
.sidebar, .chat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); min-height: 0; overflow: hidden;
}
.sidebar { display: flex; flex-direction: column; }
.me { display: flex; align-items: center; gap: 10px; padding: 16px 12px 12px 16px; }
.me-info { flex: 1; min-width: 0; display: grid; }
.me-info strong { overflow: hidden; text-overflow: ellipsis; }
.conn { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.on::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.conn.off::before { background: var(--error); }

.search {
  margin: 4px 14px 8px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); color: var(--accent); }
.search input { flex: 1; border: 0; background: none; padding: 11px 0; outline: none; min-width: 0; }
.section-label {
  margin: 10px 18px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.contacts { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; }
.contacts-empty { flex: 1; text-align: center; color: var(--muted); font-size: 14px; padding: 24px; margin: 0; }
.contacts li button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px;
  text-align: left; transition: background .15s;
}
.contacts li button:hover { background: var(--hover); }
.contacts li.active button { background: var(--accent-soft); }
.contact-main { flex: 1; min-width: 0; display: grid; }
.contact-top { display: flex; align-items: center; gap: 6px; }
.contact-top strong { overflow: hidden; text-overflow: ellipsis; }
.preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-side { display: grid; justify-items: end; gap: 4px; }
.contact-side time { font-size: 11px; color: var(--muted); }
.shield { width: 14px; height: 14px; flex: none; }
.shield.ok { color: var(--ok); }
.shield.no { color: var(--warn); }
.unread {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.sidebar-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px;
                border-top: 1px solid var(--line); padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* ---------- chat */
.chat { display: flex; flex-direction: column; min-width: 0; position: relative; }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 68px;
  border-bottom: 1px solid var(--line); background: var(--panel); z-index: 1;
}
.chat-title { flex: 1; min-width: 0; display: grid; }
.status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status .lock { color: var(--ok); font-weight: 600; }
.back { display: none; }
.messages {
  list-style: none; margin: 0; padding: 20px clamp(12px, 4vw, 40px); flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  background: transparent;
}
.msg {
  max-width: min(72%, 560px); padding: 9px 14px 7px; border-radius: var(--radius);
  overflow-wrap: anywhere; white-space: pre-wrap; position: relative;
  animation: pop .18s ease-out;
}
.msg.theirs {
  align-self: flex-start; background: var(--theirs); color: var(--theirs-text);
  border: 1px solid var(--line); border-bottom-left-radius: 6px;
}
.msg.mine {
  align-self: flex-end; color: var(--mine-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-bottom-right-radius: 6px;
}
.msg.first { margin-top: 10px; }
.msg.theirs.cont { border-top-left-radius: 6px; }
.msg.mine.cont { border-top-right-radius: 6px; }
.msg time { display: block; font-size: 10.5px; opacity: .7; text-align: right; margin-top: 2px; }
.sys {
  align-self: center; font-size: 12.5px; color: var(--muted); text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; margin: 12px 0 6px; max-width: 92%;
}
.sys.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; border-radius: 14px; }
@keyframes pop { from { transform: translateY(6px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } * { transition: none !important; } }

.chat.is-empty .chat-head, .chat.is-empty .composer { display: none; }
.empty-chat {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  padding: 24px; pointer-events: none;
}
.empty-art {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 32px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); opacity: .9;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 30%, transparent);
}
.empty-art img { width: 60px; }
.empty-chat h2 { margin: 0 0 6px; font-size: 20px; }
.empty-chat p { margin: 0 auto; color: var(--muted); max-width: 34ch; }

.composer {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--panel);
  border-top: 1px solid var(--line); padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.composer input {
  flex: 1; min-width: 0; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); outline: none;
}
.composer input:focus { border-color: var(--accent); }
.send {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s;
}
.send:hover:not(:disabled) { transform: scale(1.06); }
.send svg { width: 20px; height: 20px; }

/* ---------- diálogos */
dialog {
  border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--text);
  width: min(460px, calc(100% - 32px)); padding: 22px; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(5 5 20 / .5); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 12px; font-size: 18px; }
dialog p { margin: 0 0 10px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 18px 0 0; }
dialog menu button { border-radius: 12px; padding: 10px 16px; font-weight: 600; }
dialog menu button.ghost { border: 1px solid var(--line); }
dialog menu button.ghost:hover { background: var(--hover); }
.safety {
  font: 600 18px/1.7 var(--mono); letter-spacing: .5px; display: grid;
  grid-template-columns: repeat(4, auto); justify-content: center; gap: 2px 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0;
}
.mono { font-family: var(--mono); word-break: break-all; font-size: 13px; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.theme-card {
  display: grid; gap: 8px; padding: 10px; border-radius: 16px; border: 2px solid var(--line);
  text-align: left; background: var(--panel-2); color: var(--text); font-family: var(--font);
}
.theme-card:hover { border-color: var(--muted); }
.theme-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.theme-card strong { font-size: 14px; }
.theme-card small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.swatch {
  height: 54px; border-radius: 10px; position: relative; overflow: hidden;
  border: 1px solid rgb(127 127 127 / .25);
}
.swatch i { position: absolute; border-radius: 8px; }
.swatch i:nth-child(1) { left: 8px; top: 9px; width: 54%; height: 14px; }
.swatch i:nth-child(2) { right: 8px; bottom: 9px; width: 46%; height: 14px; }

/* =====================================================================
   Móvil: una columna, ocupa toda la pantalla
   ===================================================================== */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar, .chat { border-radius: 0; border: 0; box-shadow: none; }
  .me { padding-top: max(14px, env(safe-area-inset-top)); }
  .chat-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .app .chat { display: none; }
  .app.in-chat .sidebar { display: none; }
  .app.in-chat .chat { display: flex; }
  .back { display: grid; margin-left: -8px; }
  .msg { max-width: 84%; }
  .login-card { padding: 28px 20px 20px; }
}

/* =====================================================================
   Perfil, búsqueda, multimedia, emojis y stickers
   ===================================================================== */
.me-btn, .peer-btn {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left;
  padding: 4px 6px; margin: -4px -6px; border-radius: 14px; color: var(--text);
}
.me-btn:hover, .peer-btn:hover { background: var(--hover); }
.peer-btn .chat-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { overflow: hidden; }
.avatar.has-photo { background: var(--panel-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 96px; height: 96px; border-radius: 32px; font-size: 38px; }
[data-theme="terminal"] .avatar.has-photo, [data-theme="contrast"] .avatar.has-photo { background: var(--panel-2); }

.new-chat-error {
  margin: -2px 14px 6px; padding: 8px 12px; border-radius: 12px; font-size: 13px;
  background: color-mix(in srgb, var(--error) 12%, var(--panel)); color: var(--error);
}

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-view { display: grid; justify-items: center; gap: 4px; text-align: center; margin-bottom: 8px; }
.profile-view h3 { margin: 8px 0 0; font-size: 20px; }
.profile-view p { margin: 0; }
dialog .field { display: grid; gap: 6px; margin-bottom: 10px; }
dialog .field span { font-size: 13px; font-weight: 600; color: var(--muted); }
dialog .field input {
  padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2);
}
dialog .hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.advanced {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  background: var(--panel-2);
}
.advanced summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.advanced[open] summary { margin-bottom: 10px; }
.advanced .chip { margin: 4px 0 8px; }
.viewer { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto 12px; border-radius: 12px; }

/* Barra de escribir con botones */
.composer { gap: 6px; padding-left: 10px; }
.composer .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
.icon-btn circle.ring { fill: none; stroke: currentColor; }

/* Selector de emojis / stickers */
.picker {
  position: absolute; left: 12px; right: 12px; bottom: 80px; max-width: 420px; z-index: 5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: min(380px, 55vh); overflow: hidden;
  animation: rise .15s ease-out;
}
@keyframes rise { from { transform: translateY(8px); } }
.picker-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.picker-tabs button {
  flex: 1; padding: 8px; border-radius: 12px; font-weight: 600; font-size: 13px; color: var(--muted);
}
.picker-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.picker-body { overflow-y: auto; padding: 4px 10px 12px; }
.picker-group {
  margin: 10px 4px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.emoji {
  font-size: 24px; line-height: 1; padding: 6px 0; border-radius: 10px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.emoji:hover { background: var(--hover); transform: scale(1.15); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; padding-top: 8px; }
.sticker-btn, .sticker-face {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; line-height: 1;
  /* contorno blanco tipo pegatina */
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff)
          drop-shadow(0 -2px 0 #fff) drop-shadow(0 4px 6px rgb(0 0 0 / .25));
}
.sticker-btn { font-size: 46px; padding: 10px 0; border-radius: 16px; transition: transform .12s; }
.sticker-btn:hover { background: var(--hover); transform: rotate(-6deg) scale(1.1); }

/* Mensajes especiales */
.msg.jumbo, .msg.sticker { background: none !important; border: 0 !important; padding: 2px 4px; }
.msg.jumbo .body { font-size: 44px; line-height: 1.15; }
.msg.sticker .sticker-face { font-size: 96px; display: block; padding: 6px; animation: wobble .4s ease-out; }
@keyframes wobble { 0% { transform: scale(.6) rotate(-10deg); } 70% { transform: scale(1.08) rotate(3deg); } }
.msg.jumbo time, .msg.sticker time { color: var(--muted); opacity: 1; }
.msg.media { padding: 4px; max-width: min(72%, 360px); }
.msg.media img, .msg.media video {
  display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: calc(var(--radius) - 4px);
  background: rgb(0 0 0 / .08);
}
.msg.media img { cursor: zoom-in; min-height: 60px; }
.msg.media time { padding: 2px 8px 2px; }
.msg .body { white-space: pre-wrap; }

.drop-hint {
  position: absolute; inset: 72px 12px 80px; z-index: 6; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 20px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--panel) 85%, transparent); pointer-events: none;
}

@media (max-width: 760px) {
  .picker { left: 8px; right: 8px; max-width: none; }
  .msg.media { max-width: 80%; }
  .composer .icon-btn { width: 36px; height: 36px; }
}

/* =====================================================================
   Servicio caído, conexión perdida y estado de entrega
   ===================================================================== */
.down {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px);
}
.down-card {
  width: min(440px, 100%); text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 28px 24px; box-shadow: var(--shadow);
}
.down-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; }
.down-card h2 { margin: 0 0 10px; font-size: 22px; }
.down-card p { margin: 0 0 12px; }
.down-card .muted { font-size: 13px; }
.offline-banner {
  background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 13px;
  padding: 6px 12px; font-weight: 600;
}
.tick { font-size: 11px; }

/* =====================================================================
   Ticks, separadores de día, acceso y personalización
   ===================================================================== */
.tick { font-size: 11px; letter-spacing: -2px; margin-left: 1px; }
.tick.sending { letter-spacing: 0; }
.tick.read { color: #34b7f1; }
.msg.mine .tick.read { color: #9ee7ff; }
[data-theme="light"] .msg.mine .tick.read, [data-theme="forest"] .msg.mine .tick.read { color: #b9f0ff; }
.preview .tick { font-size: 12px; margin-right: 2px; }
.preview .tick.read { color: #34b7f1; }
.day {
  align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
  text-transform: capitalize; position: sticky; top: 4px; z-index: 1;
}
.msg.missing::before { content: "Archivo no disponible en este dispositivo"; font-size: 12px; opacity: .7; padding: 8px; display: block; }
.bio { font-size: 14px; color: var(--muted); margin-top: 6px !important; font-style: italic; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field .hint { font-weight: 400; }
.verify-step { text-align: center; margin-top: 18px; }
.verify-icon { font-size: 44px; }
.verify-step h2 { margin: 6px 0; font-size: 20px; }
.verify-step form { display: grid; gap: 12px; margin-top: 16px; }
#verify-code {
  text-align: center; font: 600 28px/1 var(--mono); letter-spacing: 10px; padding: 12px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2);
}
button.link { background: none; color: var(--muted); text-decoration: underline; padding: 4px; }
.chip.danger { color: var(--error); margin-top: 14px; }

dialog { max-height: min(88vh, 900px); overflow-y: auto; }
.settings-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }
.settings-h:first-of-type { margin-top: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-dot {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line); font-size: 12px; font-weight: 700; color: var(--accent-ink);
}
.color-dot.theme-color { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.color-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.swatches input[type="color"] {
  width: 40px; height: 34px; border: 1px dashed var(--muted); border-radius: 10px; padding: 2px; background: none; cursor: pointer;
}
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.wall {
  height: 64px; border-radius: 12px; border: 2px solid var(--line); font-size: 12px; font-weight: 600;
  display: grid; place-items: end center; padding-bottom: 6px; color: var(--text); background-color: var(--chat-bg);
}
.wall[aria-pressed="true"] { border-color: var(--accent); }
.wall[data-wall="dots"] { background-image: radial-gradient(var(--muted) 1px, transparent 1.4px); background-size: 10px 10px; }
.wall[data-wall="grid"] { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 12px 12px; }
.wall[data-wall="diagonal"] { background-image: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 9px); }
.wall[data-wall="bubbles"] { background-image: radial-gradient(circle at 30% 30%, var(--accent-soft) 0 12px, transparent 13px), radial-gradient(circle at 75% 60%, var(--accent-soft) 0 8px, transparent 9px); }
.wall[data-wall="gradient"] { background-image: linear-gradient(135deg, var(--accent-soft), var(--chat-bg)); }
.wall[data-wall="image"] { background-image: linear-gradient(transparent, transparent), var(--wall-image, linear-gradient(135deg, var(--line), var(--panel-2))); background-size: cover; }
.segmented { display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.segmented button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.switch span { display: grid; gap: 2px; }
.switch small { color: var(--muted); font-size: 12.5px; }

/* Fondos de chat */
[data-wall="plain"] .chat { --wall: none; }
[data-wall="grid"] .chat { --wall: linear-gradient(var(--dots) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, var(--dots) 1px, transparent 1px) 0 0 / 26px 26px; }
[data-wall="diagonal"] .chat { --wall: repeating-linear-gradient(45deg, var(--dots) 0 2px, transparent 2px 16px); }
[data-wall="bubbles"] .chat {
  --wall: radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--accent) 9%, transparent) 0 46px, transparent 47px) 0 0 / 220px 220px,
          radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--accent-2) 8%, transparent) 0 26px, transparent 27px) 0 0 / 160px 160px;
}
[data-wall="gradient"] .chat {
  --wall: linear-gradient(165deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%, color-mix(in srgb, var(--accent-2) 14%, transparent));
}
[data-wall="image"] .chat {
  --wall: linear-gradient(color-mix(in srgb, var(--chat-bg) 30%, transparent), color-mix(in srgb, var(--chat-bg) 30%, transparent)),
          var(--wall-image, none) center / cover no-repeat;
}

.offline-banner.replaced { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.offline-banner.replaced[hidden] { display: none; }

/* Iniciar sesión / Registrarte */
.auth-title { margin: 0; font-size: 20px; }
.auth-sub { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
#login-form[data-mode="login"] .register-only { display: none !important; }
#login-form[data-mode="register"] .login-only { display: none !important; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 0; }
button.link-strong { color: var(--accent); font-weight: 700; padding: 2px 4px; background: none; }
button.link-strong:hover { text-decoration: underline; }

/* Fondo del chat fijo: se pinta en la ventana del chat (tamaño fijo), no en la lista
   de mensajes, que crece al escribir y hacía que la foto se agrandara */
.chat::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: var(--wall, radial-gradient(var(--dots) 1px, transparent 1.4px) 0 0 / 18px 18px), var(--chat-bg);
}
.chat > :not(.picker):not(.drop-hint):not(.empty-chat) { position: relative; z-index: 1; }
.empty-chat { z-index: 1; }

/* =====================================================================
   Responder, reacciones, menú de mensaje, notas de voz, grupos
   ===================================================================== */
.typing { color: var(--accent); font-style: italic; }
.msg .author { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 2px;
  color: hsl(var(--h, 240) 65% 55%); }
[data-theme="dark"] .msg .author, [data-theme="midnight"] .msg .author, [data-theme="terminal"] .msg .author { color: hsl(var(--h, 240) 70% 72%); }
.msg .quote {
  display: grid; gap: 1px; text-align: left; width: 100%; margin: 0 0 6px; padding: 6px 10px; border-radius: 10px;
  border-left: 3px solid currentColor; background: rgb(0 0 0 / .08); font-size: 13px; color: inherit; opacity: .9;
}
.msg.mine .quote { background: rgb(255 255 255 / .18); }
.msg .quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.deleted .body { font-style: italic; opacity: .75; }
.msg.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); } }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  font-size: 13px; padding: 1px 7px; border-radius: 999px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); line-height: 1.5;
}
.reaction.own { border-color: var(--accent); background: var(--accent-soft); }
.msg.voice { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; min-width: 240px; }
.msg.voice audio { width: 100%; height: 36px; }
.msg.voice time, .msg.voice .reactions, .msg.voice .quote, .msg.voice .author { grid-column: 1 / -1; }
.mic-icon { font-size: 18px; }

.msg-menu {
  position: fixed; z-index: 60; min-width: 220px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; animation: rise .12s ease-out;
}
.menu-reactions { display: flex; justify-content: space-between; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-reactions button { font-size: 24px; padding: 4px; border-radius: 12px; transition: transform .1s; }
.menu-reactions button:hover { transform: scale(1.2); background: var(--hover); }
.menu-reactions button.own { background: var(--accent-soft); }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--text); }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--error); }

.reply-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; background: var(--panel);
  border-top: 1px solid var(--line);
}
.reply-bar[hidden] { display: none; }
.reply-body { flex: 1; min-width: 0; display: grid; border-left: 3px solid var(--accent); padding-left: 10px; font-size: 13px; }
.reply-body strong { color: var(--accent); }
.reply-body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

.rec-bar { display: none; flex: 1; align-items: center; gap: 10px; }
.composer.recording .rec-bar { display: flex; }
.composer.recording > :not(.rec-bar) { display: none; }
.rec-bar .send { margin-left: auto; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--error); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.small { font-size: 12.5px; }

.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.member-list li { display: flex; align-items: center; gap: 10px; }
.member-list .member-name { flex: 1; font-weight: 600; }
.member-list .avatar { width: 32px; height: 32px; border-radius: 11px; font-size: 13px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* Menú de hamburguesa */
#new-group-btn, #theme-btn, .sidebar-foot { display: none !important; }
.sidebar { position: relative; }
.app-menu {
  position: absolute; top: 62px; right: 12px; z-index: 30; min-width: 250px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  display: grid; animation: rise .12s ease-out;
}
.app-menu[hidden] { display: none; }
.app-menu button {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; font-size: 15px;
  text-align: left; color: var(--text);
}
.app-menu button[hidden] { display: none; }
.app-menu button:hover, .app-menu button:focus-visible { background: var(--hover); }
.app-menu button.danger { color: var(--error); }
.app-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
#menu-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }

.about-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.about-icon { font-size: 22px; line-height: 1.2; }
#dlg-body > .primary { width: 100%; margin: 6px 0; }

/* =====================================================================
   Estilo profesional: colores sólidos, iconos de línea, menos adornos.
   Va al final para imponerse a lo anterior en todos los temas.
   ===================================================================== */
body { background: var(--bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, strong { letter-spacing: -0.01em; }

/* Iconos */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.inline-ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.chip .inline-ico, .primary .inline-ico { margin-right: 8px; }
.chip.removable .inline-ico { margin: 0 0 0 6px; }
.muted-ico { color: var(--muted); }
.group-ico { width: 15px; height: 15px; margin-right: 6px; color: var(--muted); vertical-align: -2px; }

/* Botones */
.primary, .send, .unread, .brand-mark, .empty-art, .color-dot.theme-color {
  background: var(--accent) !important; background-image: none !important;
}
.primary { border-radius: 10px; font-weight: 600; box-shadow: none; padding: 12px 18px; }
.primary:hover:not(:disabled) { filter: brightness(1.07); transform: none; }
.send { box-shadow: none; width: 44px; height: 44px; }
.send:hover:not(:disabled) { transform: none; filter: brightness(1.08); }
.chip { border-radius: 8px; font-weight: 500; padding: 7px 12px; display: inline-flex; align-items: center; }
.icon-btn { border-radius: 10px; }

/* Acceso */
.login-card { background: var(--panel); backdrop-filter: none; border-radius: 18px; padding: 36px 32px 28px; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; box-shadow: none; }
.brand-mark img { width: 34px; height: 34px; filter: none; }
.brand h1 { font-size: 24px; font-weight: 700; margin-top: 16px; }
.auth-title { font-size: 18px; font-weight: 650; margin-top: 4px; }
.field input { border-radius: 10px; background: var(--panel); }
.features { gap: 4px 14px; margin-top: 24px; }
.features li { background: none; border: 0; padding: 0; font-size: 12px; }
.features li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; }
.features b { color: var(--text); font-weight: 600; }
.disclaimer { color: var(--muted); }
.corner { box-shadow: none; border: 1px solid var(--line); }
.state-icon { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.state-icon .ico { width: 28px; height: 28px; }
.verify-step h2, .down-card h2 { font-weight: 650; }

/* Estructura */
.app { gap: 12px; padding: 12px; }
.sidebar, .chat { border-radius: 16px; box-shadow: var(--shadow); }
.me { padding: 16px 12px 12px 16px; }
.avatar { border-radius: 50%; font-weight: 600; font-size: 15px;
  background: hsl(var(--h, 150) 32% 42%) !important; background-image: none !important; color: #fff; }
.avatar.has-photo { background: var(--panel-2) !important; }
.avatar.xl { border-radius: 50%; }
.member-list .avatar { border-radius: 50%; }
.search { border-radius: 10px; background: var(--panel-2); }
.section-label { font-size: 11px; letter-spacing: .08em; }
.contacts li button { border-radius: 10px; padding: 10px 10px; }
.contacts li.active button { background: var(--accent-soft); }
.contact-name { display: flex; align-items: center; min-width: 0; font-weight: 600; }
.unread { box-shadow: none; }
.app-menu { border-radius: 12px; min-width: 260px; }
.app-menu button { font-size: 14.5px; gap: 12px; }
.app-menu button .ico { color: var(--muted); }
.app-menu button.danger .ico { color: var(--error); }

/* Chat */
.chat-head { min-height: 64px; }
.peer-btn .avatar, #peer-avatar { width: 40px; height: 40px; }
.status .lock { color: var(--accent); font-weight: 500; }
.messages { gap: 2px; }
.msg { border-radius: 12px; padding: 7px 11px 6px; box-shadow: 0 1px 1px rgb(0 0 0 / .05); animation: none; }
.msg.mine { background: var(--accent) !important; background-image: none !important; }
.msg.mine.first { border-top-right-radius: 4px; }
.msg.theirs.first { border-top-left-radius: 4px; }
.msg.mine, .msg.mine.cont { border-bottom-right-radius: 12px; }
.msg.theirs, .msg.theirs.cont { border-bottom-left-radius: 12px; }
.msg.first { margin-top: 8px; }
.msg time { font-size: 10.5px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 1px; }
.msg.jumbo, .msg.sticker { box-shadow: none; }
.tick { display: inline-flex; letter-spacing: 0; }
.tick .ico { width: 15px; height: 15px; stroke-width: 2; }
.tick.sending .ico { width: 13px; height: 13px; }
.tick.read { color: #4fc3f7; }
.msg.mine .tick.read { color: #b3ecff; }
.tick.failed { color: var(--error); }
.preview .tick { vertical-align: -3px; }
.preview .tick .ico { width: 14px; height: 14px; }
.day { border-radius: 8px; text-transform: none; font-weight: 600; box-shadow: 0 1px 1px rgb(0 0 0 / .04); }
.sys { border-radius: 8px; display: inline-flex; align-items: center; gap: 2px; max-width: min(92%, 520px); line-height: 1.4; }
.sys .inline-ico { color: var(--accent); flex: none; }
.sys.warn .inline-ico { color: var(--warn); }
.msg .quote { border-radius: 8px; border-left-width: 3px; }
.msg.deleted .body { display: inline-flex; align-items: center; }
.mic-icon { width: 20px; height: 20px; color: inherit; opacity: .8; }
.reaction { border-radius: 10px; box-shadow: 0 1px 1px rgb(0 0 0 / .05); }
.composer { gap: 4px; }
.composer input { border-radius: 22px; background: var(--panel-2); }
.reply-bar { border-left: 0; }
.msg-menu { border-radius: 12px; min-width: 230px; }
.menu-item { display: flex; align-items: center; gap: 10px; }
.menu-item .inline-ico { margin: 0; color: var(--muted); width: 18px; height: 18px; }
.menu-item.danger .inline-ico { color: var(--error); }

/* Diálogos */
dialog { border-radius: 16px; padding: 24px; }
dialog h2 { font-size: 18px; font-weight: 650; margin-bottom: 16px; }
dialog menu button { border-radius: 10px; }
.about-row { gap: 14px; }
.about-icon { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.device-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.device-row .member-name { font-weight: 500; }
.theme-card { border-radius: 12px; }
.empty-art { border-radius: 24px; box-shadow: none; width: 84px; height: 84px; }
.empty-art img { width: 48px; }
.empty-chat h2 { font-weight: 650; }
.picker { border-radius: 14px; }
.picker-tabs button { border-radius: 8px; }

@media (max-width: 760px) {
  .sidebar, .chat { border-radius: 0; box-shadow: none; border: 0; }
  .app { padding: 0; gap: 0; }
}
