/* Aero Messenger — estilo "Aero" de mediados de los 2000 */
:root {
  --text: #1c2b3d;
  --muted: #6b7b8d;
  --border: #7fa3cb;
  --line: #c3d7ea;
  --title: #17406e;
  --hover-top: #f3f9fe;
  --hover-bot: #dcedfc;
  --hover-border: #a9cbee;
  --online: #3fae28;
  --busy: #e03b3b;
  --away: #f19d1d;
  --offline: #a3aeb9;
  --task-h: 44px;
  --tint: #3a8ee6;
  font-family: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background:
    radial-gradient(900px 380px at 82% -8%, rgba(255, 255, 255, .85), transparent 65%),
    radial-gradient(700px 300px at 8% 108%, rgba(140, 220, 120, .45), transparent 70%),
    radial-gradient(500px 260px at 100% 100%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, #3f86d0 0%, #8cc4f0 42%, #d9eefc 100%);
  background-attachment: fixed;
}
body::before, body::after {
  content: ""; position: fixed; pointer-events: none; border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, .13);
}
body::before { width: 1400px; height: 520px; left: -300px; top: 55%; transform: rotate(-8deg); }
body::after { width: 1100px; height: 420px; right: -380px; top: 18%; transform: rotate(12deg); border-width: 26px; }

button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #abc0d6; border-radius: 3px; padding: 4px 6px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #3d8ee0; box-shadow: 0 0 0 2px rgba(61, 142, 224, .2); }
a { color: #1a5fb4; }
[hidden] { display: none !important; }

#desktop { position: fixed; inset: 0 0 var(--task-h) 0; z-index: 1; }
body.logged-out #desktop { bottom: 0; }

/* ---------- ventanas ---------- */
.window {
  border-color: color-mix(in srgb, var(--tint) 55%, #fff) !important;
  position: absolute; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 34px rgba(8, 38, 78, .3), 0 0 0 1px rgba(255, 255, 255, .55) inset;
}
.titlebar {
  flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 9px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tint) 6%, #fff) 0%, color-mix(in srgb, var(--tint) 18%, #fff) 47%,
    color-mix(in srgb, var(--tint) 30%, #fff) 53%, color-mix(in srgb, var(--tint) 20%, #fff) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--tint) 40%, #fff); user-select: none; -webkit-user-select: none; touch-action: none;
}
.tb-icon { width: 16px; height: 16px; flex: none; }
.tb-title { flex: 1; min-width: 0; font-weight: 600; color: color-mix(in srgb, var(--tint) 45%, #0b2240); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn {
  width: 28px; height: 20px; border: 1px solid #8fb0d2; border-radius: 3px; cursor: pointer; line-height: 1; padding: 0;
  background: linear-gradient(#fdfeff, #d9e8f6); color: #24405f; font-size: 12px;
}
.tb-btn:hover { background: linear-gradient(#eef8ff, #b9dcfa); }
.tb-btn.close { width: 38px; }
.tb-btn.close:hover { background: linear-gradient(#f5a394, #d33f28); color: #fff; border-color: #a5301f; }
.tb-back { display: none; border: 0; background: none; font-size: 26px; line-height: 1; padding: 0 8px 2px 0; color: var(--title); cursor: pointer; }

.btn {
  padding: 5px 14px; border: 1px solid #7d9ec3; border-radius: 3px; cursor: pointer; color: #142236;
  background: linear-gradient(#fdfeff 0%, #e9f1fa 49%, #d5e4f4 50%, #e6effa 100%);
}
.btn:hover { border-color: #3c7fb1; background: linear-gradient(#eaf6fd 0%, #d9f0fc 49%, #bee6fd 50%, #a7d9f5 100%); }
.btn:active { background: linear-gradient(#c4e5f6, #98d1ef); }
.btn.primary { font-weight: 600; }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { background: none; border: 0; color: #1a5fb4; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- estados ---------- */
.sicon { width: 16px; height: 16px; flex: none; vertical-align: middle; }
.sicon .orb { fill: var(--c); stroke: rgba(0, 0, 0, .28); stroke-width: .7; }
.sicon .shine { fill: #fff; fill-opacity: .55; }
.sicon .det { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.st-online { --c: var(--online); }
.st-busy { --c: var(--busy); }
.st-away { --c: var(--away); }
.st-offline, .st-blocked { --c: var(--offline); }
.sicon .blk { fill: #fff; stroke: #d42a2a; stroke-width: 1.4; }
.sicon .blk-l { fill: none; stroke: #d42a2a; stroke-width: 1.4; }

.avatar-frame {
  --c1: #e3e9ef; --c2: #9aa8b5;
  width: 96px; height: 96px; padding: 4px; border-radius: 10px; flex: none; position: relative;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 2px 6px rgba(0, 30, 70, .25), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.avatar-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: #fff; }
.avatar-frame.s-online { --c1: #b7f19d; --c2: #3c9b1e; }
.avatar-frame.s-busy { --c1: #ffaaaa; --c2: #c61f1f; }
.avatar-frame.s-away { --c1: #ffe09a; --c2: #e08a00; }
.avatar-frame.md { width: 64px; height: 64px; padding: 3px; border-radius: 8px; }
.avatar-frame.sm { width: 40px; height: 40px; padding: 3px; border-radius: 6px; }
.avatar-frame.sm img { border-radius: 4px; }
.avatar-frame.xs { width: 26px; height: 26px; padding: 2px; border-radius: 5px; }
.avatar-frame.xs img { border-radius: 3px; }
.avatar-frame.clickable { cursor: pointer; }

.emo { display: inline-block; font-size: 1.15em; line-height: 1; vertical-align: -1px; font-style: normal; font-weight: normal; }

/* ---------- inicio de sesión ---------- */
.login-win { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
.login-body {
  overflow: auto; padding: 22px 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #e2f1fd 0%, #fff 160px);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 300; color: #1d4f86; letter-spacing: -.3px; }
.brand img { width: 34px; height: 34px; }
.brand b { font-weight: 600; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.login-form label { display: flex; flex-direction: column; gap: 3px; color: #33475e; }
.login-form label.check { flex-direction: row; align-items: center; gap: 6px; }
.login-form input:not([type=checkbox]), .login-form select { width: 100%; padding: 6px 7px; }
.login-form .btn { align-self: center; min-width: 140px; margin-top: 4px; padding: 7px 14px; }
.err { color: #c0271b; min-height: 1em; font-size: 12px; }
.err:empty { display: none; }
.switch-mode { text-align: center; font-size: 12px; }
.signing { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0 10px; color: #33475e; }
.buddies-spin { width: 64px; height: 64px; animation: spin 1.3s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotate(180deg) scale(.88); } 100% { transform: rotate(360deg); } }
.login-foot { font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- ventana principal ---------- */
.main-win { left: 24px; top: 24px; width: 330px; height: calc(100% - 48px); max-height: 760px; min-height: 360px; }
.me-panel {
  flex: none; display: flex; gap: 10px; padding: 14px 12px 12px; position: relative; min-height: 108px;
  border-bottom: 1px solid color-mix(in srgb, var(--tint) 35%, #fff);
}
.me-panel::after { content: ""; position: absolute; inset: 55% 0 0 0; pointer-events: none; background: linear-gradient(transparent, rgba(255, 255, 255, .78)); }
.me-panel > * { position: relative; z-index: 1; }
.me-info { background: rgba(255, 255, 255, .62); border-radius: 6px; padding: 4px 6px !important; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); align-self: flex-start; }
.me-line { display: flex; align-items: baseline; gap: 2px; min-width: 0; flex-wrap: wrap; }
.me-line .me-nick { white-space: normal; overflow-wrap: anywhere; }
.psm-view { color: #45596f; font-style: italic; padding: 2px 4px; margin-left: -5px; border: 1px solid transparent; border-radius: 3px; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psm-view:hover { border-color: #a9cbee; background: rgba(255, 255, 255, .7); }
.psm-view .ph { color: #6b7b8d; }
.me-line .me-nick { min-width: 0; flex: 0 1 auto; }
.me-line .status-btn { flex: none; margin-left: 0; }
.scene-btn { position: absolute !important; right: 6px; top: 6px; border: 1px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .45); border-radius: 4px; cursor: pointer; font-size: 13px; padding: 1px 5px; opacity: .75; }
.scene-btn:hover { opacity: 1; background: rgba(255, 255, 255, .85); }
.icon-btn { position: relative; }
.plus-badge { position: absolute; right: 2px; bottom: 0; font-size: 11px; color: #2a8a14; }
.ico-add { font-size: 14px; }
.contact .c-st { color: #4d6a88; }
.contact.pics { padding-left: 10px; }
.contact.pics.large { padding-top: 4px; padding-bottom: 4px; align-items: center; }
.contact.pics > .sicon, .contact.pics > span:has(> .sicon) { display: none; }
.c-text.two-lines { display: flex; flex-direction: column; white-space: nowrap; }
.c-text.two-lines .c-psm { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.news { flex: none; border-top: 1px solid color-mix(in srgb, var(--tint) 35%, #fff); background: linear-gradient(color-mix(in srgb, var(--tint) 6%, #fff), color-mix(in srgb, var(--tint) 16%, #fff)); }
.news-head { width: 100%; text-align: left; border: 0; background: none; padding: 5px 10px; font-weight: 600; color: color-mix(in srgb, var(--tint) 50%, #0b2240); cursor: pointer; }
.news-head .arrow { font-size: 9px; margin-right: 5px; color: #6b88a8; }
.news-head .count { font-weight: 400; color: var(--muted); }
.news-list { max-height: 150px; overflow: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.news-item { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; line-height: 1.3; }
.news-item .was { color: var(--muted); text-decoration: line-through; }
.news-empty { font-size: 11.5px; color: var(--muted); padding: 2px 2px 4px; }
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.me-nick {
  font-size: 15px; font-weight: 600; color: #123a66; cursor: text; border: 1px solid transparent; border-radius: 3px;
  padding: 1px 3px; margin-left: -4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-nick:hover { border-color: #a9cbee; background: rgba(255, 255, 255, .7); }
.inline-edit { font-size: 15px; font-weight: 600; width: 100%; padding: 1px 3px; }
.status-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 3px;
  background: none; padding: 1px 4px; margin-left: -5px; cursor: pointer; color: #33475e; max-width: 100%;
}
.status-btn:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.psm-input {
  width: 100%; border: 1px solid transparent; background: transparent; padding: 2px 4px; margin-left: -5px; color: #45596f; font-style: italic;
}
.psm-input:hover { border-color: #a9cbee; background: rgba(255, 255, 255, .7); }
.psm-input:focus { font-style: normal; background: #fff; }
.np-btn { align-self: flex-start; border: 0; background: none; padding: 0; color: #5a6f86; cursor: pointer; font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-btn:hover { color: #1a5fb4; text-decoration: underline; }

.list-tools { flex: none; display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #f7fbff; }
.search { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 12px; }
.icon-btn {
  flex: none; width: 30px; height: 26px; display: grid; place-items: center; cursor: pointer; padding: 0;
  border: 1px solid transparent; border-radius: 3px; background: none; font-size: 15px;
}
.icon-btn:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }

.conn-banner { flex: none; background: #fff6d6; border-bottom: 1px solid #edd78a; color: #6d5300; padding: 5px 10px; font-size: 12px; }
.contact-list { flex: 1; overflow: auto; padding: 4px 0 10px; }
.group-head {
  display: flex; align-items: center; gap: 4px; padding: 5px 8px 3px; color: #234e7f; font-weight: 600; cursor: pointer; user-select: none;
}
.group-head .arrow { width: 12px; font-size: 9px; color: #6b88a8; transition: transform .15s; }
.group-head.collapsed .arrow { transform: rotate(-90deg); }
.group-head .count { color: var(--muted); font-weight: 400; }
.contact {
  display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 18px; margin: 0 4px;
  white-space: nowrap; overflow: hidden; border: 1px solid transparent; border-radius: 3px; cursor: default; user-select: none;
}
.contact:hover, .contact:focus-visible { outline: none; border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.contact .c-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.contact .c-psm { color: var(--muted); }
.contact.off .c-nick { color: #7d8996; }
.contact.blocked .c-nick { text-decoration: line-through; }
.contact .tag { color: var(--muted); font-size: 11px; }
.c-more {
  display: none; flex: none; border: 0; background: none; width: 26px; height: 22px; cursor: pointer; color: #567; border-radius: 3px; font-size: 16px; line-height: 1;
}
.contact:hover .c-more { display: block; }
.request { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px 8px 18px; margin: 0 4px 4px; background: #fffbe8; border: 1px solid #f0de9c; border-radius: 4px; }
.request .r-actions { display: flex; gap: 6px; }
.request .btn { padding: 3px 10px; }
.empty-list { padding: 24px 22px; text-align: center; color: var(--muted); line-height: 1.5; }
.empty-list .big { font-size: 34px; display: block; margin-bottom: 6px; }
.main-foot {
  flex: none; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 11px; color: #4e6580; text-align: center;
  background: linear-gradient(180deg, #f2f8fe, #dcebf9);
}

/* ---------- ventanas de conversación ---------- */
.chat-win {
  width: 540px; height: 500px; min-width: 340px; min-height: 340px; resize: both;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 14%, #fff) 0, color-mix(in srgb, var(--tint) 5%, #fff) 160px, #fbfdff 100%);
}
.chat-banner { flex: none; position: relative; border-bottom: 1px solid color-mix(in srgb, var(--tint) 35%, #fff); }
.chat-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .7)); }
.chat-banner .chat-head .head-text { display: inline-block; flex: 0 1 auto; background: rgba(255, 255, 255, .62); border-radius: 6px; padding: 3px 8px; }
.chat-banner > * { position: relative; z-index: 1; }
.chat-banner .chat-head { padding: 10px 12px 2px; }
.chat-banner .to { font-size: 14px; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.chat-banner .to b { font-size: 15px; }
.chat-banner .chat-tools { border-bottom: 0; }
.chat-banner .tool { background: rgba(255, 255, 255, .55); }
.chat-tools { flex: none; display: flex; gap: 2px; padding: 4px 6px; border-bottom: 1px solid #cfe0f0; overflow-x: auto; scrollbar-width: none; }
.tool {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid transparent; border-radius: 3px;
  background: none; cursor: pointer; white-space: nowrap; color: #24405f;
}
.tool:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.tool-ico { font-size: 15px; }
.chat-head { flex: none; padding: 6px 12px 6px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.chat-head .head-avatar { display: none; }
.chat-head .head-text { min-width: 0; flex: 1; }
.chat-head .to { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #33475e; }
.chat-head .to b { color: #10345c; }
.chat-head .em { color: var(--muted); }
.chat-head .psm { color: var(--muted); font-style: italic; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { flex: 1; min-height: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 8px 8px 0; }
.chat-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.history {
  flex: 1; min-height: 60px; overflow: auto; padding: 8px 10px; background: #fff;
  border: 1px solid #c2d6ea; border-radius: 4px; overflow-wrap: anywhere; position: relative;
}
.msg { margin: 0 0 6px; }
.msg-who { color: #5d6f82; display: flex; gap: 6px; align-items: baseline; }
.msg-who > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { margin-left: auto; font-size: 10.5px; color: #9aa7b4; flex: none; }
.msg-text { padding: 1px 0 1px 14px; white-space: normal; }
.sys { color: #5d6f82; margin: 6px 0; padding-left: 2px; }
.sys.nudge { color: #b0420a; font-weight: 600; }
.sys.wink { color: #8a3fb8; }
.sys.date { text-align: center; font-size: 11px; color: #8796a6; border-top: 1px solid #e3ebf3; padding-top: 4px; margin: 10px 0 6px; }
.sys.note { color: #a2550c; font-style: italic; }
.file-card {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 8px 14px; padding: 8px 10px; max-width: 360px;
  border: 1px solid #c8dbee; border-radius: 6px; background: linear-gradient(#fbfdff, #edf5fd);
}
.file-card .f-icon { font-size: 26px; }
.file-card .f-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-card .f-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .f-info span { color: var(--muted); font-size: 11.5px; }
.file-card .f-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.file-card .btn { padding: 2px 9px; font-size: 12px; }
.file-preview { display: block; max-width: min(320px, 100%); max-height: 260px; margin: 0 0 8px 14px; border-radius: 6px; border: 1px solid #c8dbee; }

.compose { flex: none; border: 1px solid #c2d6ea; border-radius: 4px; background: #fff; }
.compose-tools { display: flex; gap: 2px; padding: 3px 4px; border-bottom: 1px solid #e1ebf5; background: linear-gradient(#fbfdff, #eef5fc); border-radius: 4px 4px 0 0; }
.ct {
  border: 1px solid transparent; background: none; border-radius: 3px; padding: 1px 6px; cursor: pointer; font-size: 15px; line-height: 20px;
}
.ct small { font-size: 9px; margin-left: 1px; color: #678; }
.ct:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.ct.font-btn { font-family: Georgia, serif; font-weight: 700; color: #1a4f8a; }
.compose-row { display: flex; gap: 6px; padding: 4px; }
.compose-input { flex: 1; min-width: 0; height: 58px; resize: none; border: 0; padding: 4px; }
.compose-input:focus { box-shadow: none; }
.send { align-self: stretch; min-width: 72px; }
.side { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding-bottom: 2px; }
.side-them { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.statusbar { flex: none; min-height: 26px; padding: 5px 12px; font-size: 11.5px; color: #4f6378; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar.typing { color: #1f6e1f; }
.chat-win.dragover .history { outline: 2px dashed #3d8ee0; outline-offset: -4px; background: #f2f8ff; }

@keyframes shake {
  0%, 100% { translate: 0 0; } 10% { translate: -14px 5px; } 20% { translate: 12px -7px; } 30% { translate: -12px -4px; }
  40% { translate: 14px 6px; } 50% { translate: -9px 3px; } 60% { translate: 9px -5px; } 70% { translate: -6px 4px; }
  80% { translate: 6px -2px; } 90% { translate: -3px 2px; }
}
.shake { animation: shake .75s linear; }

.wink-layer { position: fixed; pointer-events: none; overflow: visible; z-index: 9600; }
html, body { overflow: hidden; }
.wink-big {
  position: absolute; left: 50%; top: 45%; font-size: 110px; line-height: 1; translate: -50% -50%;
  animation: winkBig 3.4s ease forwards; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25));
}
@keyframes winkBig {
  0% { scale: 0; opacity: 0; } 15% { scale: 1.25; opacity: 1; } 25% { scale: 1; } 80% { scale: 1; opacity: 1; } 100% { scale: 1.4; opacity: 0; }
}
.wp { position: absolute; line-height: 1; }

/* ---------- barra de tareas ---------- */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--task-h); z-index: 7000; display: flex; gap: 4px; padding: 5px 6px;
  background: linear-gradient(180deg, rgba(64, 104, 150, .88) 0%, rgba(22, 48, 82, .94) 50%, rgba(12, 30, 56, .97) 100%);
  border-top: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-x: auto; scrollbar-width: none;
}
.task-btn {
  flex: 0 1 190px; min-width: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer; color: #fff;
  background: linear-gradient(rgba(255, 255, 255, .16), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .5); white-space: nowrap; overflow: hidden;
}
.task-btn span { overflow: hidden; text-overflow: ellipsis; }
.task-btn img { width: 20px; height: 20px; border-radius: 3px; flex: none; object-fit: cover; }
.task-btn:hover { background: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, .1)); }
.task-btn.active { background: linear-gradient(rgba(255, 255, 255, .38), rgba(255, 255, 255, .16)); border-color: rgba(255, 255, 255, .5); }
.task-btn.main-btn { flex: 0 0 auto; font-weight: 600; }
.task-btn.flash { animation: flash 1s steps(1) infinite; }
@keyframes flash { 50% { background: linear-gradient(#ffd37a, #f08a00); color: #3a2200; text-shadow: none; border-color: #ffe2a8; } }

/* ---------- avisos ---------- */
#toasts { position: fixed; right: 12px; bottom: calc(var(--task-h) + 12px); z-index: 9800; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body.logged-out #toasts { bottom: 12px; }
.toast {
  pointer-events: auto; width: 280px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #e8f3fd 100%); border: 1px solid var(--border); border-radius: 7px;
  box-shadow: 0 10px 26px rgba(8, 38, 78, .3); animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { translate: 0 30px; opacity: 0; } }
@keyframes toastOut { to { translate: 0 20px; opacity: 0; } }
.toast-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; font-size: 11px; color: #3d5876; background: linear-gradient(#f4f9fe, #dcebf9); border-bottom: 1px solid #c4d9ee; }
.toast-head img { width: 14px; height: 14px; }
.toast-head span { flex: 1; }
.toast-x { border: 0; background: none; cursor: pointer; font-size: 14px; color: #567; width: 22px; height: 18px; border-radius: 3px; }
.toast-x:hover { background: #d33f28; color: #fff; }
.toast-body { display: flex; gap: 10px; padding: 10px 12px 12px; align-items: center; }
.toast-body .t-text { min-width: 0; flex: 1; }
.toast-body b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #10345c; }
.toast-body .t-sub { color: #4a5f75; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast.error .toast-body { color: #8a1e12; }

/* ---------- menús, ventanas emergentes y diálogos ---------- */
.menu, .popover {
  position: fixed; z-index: 9500; background: #fff; border: 1px solid #98b6d6; border-radius: 5px; padding: 3px;
  box-shadow: 0 8px 22px rgba(8, 38, 78, .28);
}
.menu { min-width: 210px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: none; padding: 5px 10px 5px 6px; border-radius: 3px; white-space: nowrap;
}
.menu-item:hover:not(:disabled) { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.menu-item:disabled { color: #9aa6b2; cursor: default; }
.menu-item .mi-icon { width: 20px; display: grid; place-items: center; font-size: 14px; }
.menu-item.checked { font-weight: 600; }
.menu-item.checked::after { content: "✓"; margin-left: auto; color: #2a7a1c; padding-left: 12px; }
.menu-sep { height: 1px; background: #dde7f1; margin: 3px 4px; }
.menu-title { padding: 5px 8px 3px; font-size: 11px; color: var(--muted); }

.emo-grid { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; max-height: 260px; overflow: auto; }
.emo-grid button, .wink-grid button {
  border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; font-size: 20px; height: 34px; padding: 0;
}
.emo-grid button:hover, .wink-grid button:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }
.wink-grid { display: grid; grid-template-columns: repeat(4, 76px); gap: 4px; }
.wink-grid button { height: auto; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 26px; }
.wink-grid button small { font-size: 11px; color: #4a5f75; }
.pop-title { padding: 3px 6px 6px; font-size: 11px; color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 9200; display: grid; place-items: center; background: rgba(16, 40, 72, .28); padding: 16px; }
.modal { position: relative; width: min(390px, 100%); max-height: calc(100vh - 32px); }
.modal-body { padding: 16px 18px 6px; overflow: auto; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.modal-body label { display: flex; flex-direction: column; gap: 3px; color: #33475e; }
.modal-body label.check { flex-direction: row; align-items: center; gap: 6px; }
.modal-body input:not([type=checkbox]):not([type=color]), .modal-body select { width: 100%; padding: 5px 7px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.modal .row { display: flex; gap: 10px; align-items: center; }
.font-preview { border: 1px solid var(--line); border-radius: 4px; padding: 10px; background: #fff; }
.pic-wrap { display: flex; gap: 14px; align-items: flex-start; }
.pic-grid { display: grid; grid-template-columns: repeat(4, 52px); gap: 6px; }
.pic-grid button { width: 52px; height: 52px; padding: 2px; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.pic-grid button:hover, .pic-grid button.sel { border-color: #3d8ee0; }
.pic-grid img { width: 100%; height: 100%; border-radius: 4px; display: block; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; padding: 3px; }
.pick-list button { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid transparent; background: none; padding: 5px 8px; border-radius: 3px; cursor: pointer; }
.pick-list button:hover { border-color: var(--hover-border); background: linear-gradient(var(--hover-top), var(--hover-bot)); }

/* ---------- móvil ---------- */
@media (max-width: 720px) {
  :root:not(.x) { --task-h: calc(48px + env(safe-area-inset-bottom)); }
  body:not(.native) #taskbar { padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  body:not(.native) input, body:not(.native) select, body:not(.native) textarea { font-size: 16px; }
  body:not(.native) .main-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-height: none; border-radius: 0; border: 0; }
  body:not(.native) .main-win .tb-btn.min, body:not(.native) .main-win .tb-btn.close { display: none; }
  body:not(.native) .chat-win {
    position: fixed !important; left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - var(--task-h)) !important;
    border-radius: 0; border: 0; resize: none; z-index: 8000 !important;
  }
  body:not(.native) .chat-win .tb-back { display: block; }
  body:not(.native) .chat-win .tb-btn.min { display: none; }
  body:not(.native) .chat-win .tb-icon { display: none; }
  body:not(.native) .titlebar { height: 44px; }
  body:not(.native) .tool-label { display: none; }
  body:not(.native) .tool { padding: 6px 10px; }
  body:not(.native) .tool-ico { font-size: 18px; }
  body:not(.native) .chat-main { grid-template-columns: 1fr; padding: 0 6px; }
  body:not(.native) .side { display: none; }
  body:not(.native) .chat-head .head-avatar { display: block; }
  body:not(.native) .compose-input { height: 48px; }
  body:not(.native) .c-more { display: block; }
  body:not(.native) .contact { padding: 7px 6px 7px 16px; }
  body:not(.native) #toasts { left: 10px; right: 10px; align-items: stretch; }
  body:not(.native) .toast { width: auto; }
  body:not(.native) .emo-grid { grid-template-columns: repeat(7, 38px); }
  body:not(.native) .emo-grid button { height: 38px; }
  body:not(.native) .wink-grid { grid-template-columns: repeat(4, 70px); }
  body:not(.native) .task-btn { flex-basis: 150px; }
}

/* ---------- guiños con sonido ---------- */
.wk { position: absolute; left: 0; top: 0; line-height: 1; will-change: transform; }
.wk.plain { will-change: auto; }
.wk-full { position: absolute; left: 0; top: 0; pointer-events: none; }
.balloon {
  width: 34px; height: 40px; border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 35% 30%, #d8f0ff 0, #4fa8f5 35%, #1d6fd0 70%, #0f4c9c 100%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, .2);
}
.balloon::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -4px; border: 4px solid transparent; border-bottom: 6px solid #1d6fd0; transform: rotate(180deg); }
.drop { width: 11px; height: 15px; background: rgba(70, 160, 255, .85); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.cream { width: 14px; height: 14px; background: #fffaf0; border: 2px solid #e9dcc0; border-radius: 50%; }
.shard { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 16px solid rgba(190, 230, 255, .9); filter: drop-shadow(0 0 1px rgba(0, 60, 120, .6)); }
.raindrop { width: 2px; height: 18px; background: rgba(180, 210, 255, .75); border-radius: 2px; }
.comic {
  padding: 30px 38px; font: 900 32px/1 Impact, "Arial Black", sans-serif; letter-spacing: 1px; white-space: nowrap;
  clip-path: polygon(50% 0, 61% 18%, 82% 6%, 78% 30%, 100% 32%, 83% 50%, 100% 68%, 77% 70%, 82% 94%, 61% 82%, 50% 100%, 39% 82%, 18% 94%, 23% 70%, 0 68%, 17% 50%, 0 32%, 22% 30%, 18% 6%, 39% 18%);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .8);
}
.blob svg { display: block; overflow: visible; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .15)); }
.wink-grid { grid-template-columns: repeat(4, 82px); }
.wink-grid button { font-size: 28px; }

/* ---------- modos de envío y grabación ---------- */
.ct.on { border-color: #e8a33a; background: linear-gradient(#fff4dd, #ffe0a6); }
.mode-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 6px 0; }
.mode-chip { border: 1px solid #f0c27a; background: #fff6e2; color: #7a4a00; border-radius: 12px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; text-align: left; }
.mode-chip:hover { background: #ffe9bf; }
.rec-bar { display: flex; align-items: center; gap: 8px; padding: 8px; color: #8a1e12; font-weight: 600; flex-wrap: wrap; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e0261b; animation: recBlink 1s infinite; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; margin-right: auto; }
.rec-bar .btn { font-weight: 400; }

/* ---------- mensajes especiales ---------- */
.media-wrap { padding: 2px 0 2px 14px; }
.img-msg { display: inline-block; max-width: min(280px, 100%); border-radius: 8px; overflow: hidden; border: 1px solid #c8dbee; background: #f3f8fd; cursor: zoom-in; }
.img-msg img { display: block; max-width: 100%; max-height: 260px; }
.img-msg.loading { padding: 18px 22px; color: var(--muted); cursor: default; }
.voice-msg { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 1px solid #c8dbee; border-radius: 20px; background: linear-gradient(#fbfdff, #e9f3fc); min-width: 220px; max-width: 100%; }
.voice-ico { font-size: 16px; }
.voice-play { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #5a95cf; background: linear-gradient(#6fb1f0, #2a75c8); color: #fff; cursor: pointer; font-size: 12px; flex: none; }
.voice-bar { flex: 1; height: 5px; border-radius: 3px; background: #cfe0f1; overflow: hidden; min-width: 60px; }
.voice-prog { height: 100%; width: 0; background: #2a75c8; }
.voice-mid { flex: 1; min-width: 60px; display: flex; flex-direction: column; gap: 4px; }
.voice-name { font-size: 12px; color: #23405f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.voice-save { border: 0; background: none; cursor: pointer; font-size: 15px; color: #2a75c8; padding: 0 2px; }
.video-msg { max-width: min(340px, 100%); }
.video-msg video { display: block; width: 100%; max-height: 260px; border-radius: 8px; background: #000; }
.video-poster { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px; border-radius: 8px; border: 1px solid #2b3f57; background: linear-gradient(#2b4b74, #0f1d2e); color: #fff; cursor: pointer; text-align: left; }
.video-poster small { color: #b9d3ef; margin-left: auto; }
.vp-play { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); flex: none; }
.voice-time { font-size: 11.5px; color: #4a5f75; font-variant-numeric: tabular-nums; }
.once-card {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 4px 14px; padding: 8px 12px; text-align: left; cursor: pointer; max-width: 340px;
  border: 1px dashed #e8833a; border-radius: 8px; background: linear-gradient(#fff8ef, #ffecd6); color: #6b3a00;
}
.once-card:hover { background: linear-gradient(#fff2e2, #ffe0bd); }
.once-card .once-ico { font-size: 24px; }
.once-card .once-txt { display: flex; flex-direction: column; }
.once-card small { color: #8a5a20; }
.once-gone { color: #9a6b3c; font-style: italic; }
.once-badge { color: #c0630f; font-size: 11px; font-style: normal; font-weight: 400; }
.once-reveal { padding-right: 10px; }
.once-open { background: #fff8ef; border-radius: 4px; padding: 4px 8px 4px 14px; }
.once-bar { height: 3px; margin: 3px 0 4px 14px; background: #e8833a; border-radius: 2px; transform-origin: left; }
.ttl { margin-left: 6px; font-size: 10.5px; color: #b0620e; background: #fff3df; border-radius: 8px; padding: 0 6px; white-space: nowrap; font-style: normal; font-weight: 400; display: inline-block; }
.sys.call { color: #23557f; }

.lightbox { position: fixed; inset: 0; z-index: 9700; background: rgba(8, 18, 34, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 70px); border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; -webkit-user-select: none; }
.lb-foot { display: flex; align-items: center; gap: 10px; color: #e7f0fa; flex-wrap: wrap; justify-content: center; }
.once-view img { -webkit-touch-callout: none; }
.once-count { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e8833a; color: #fff; font-weight: 700; }
.once-voice { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; }
.once-big { font-size: 80px; animation: recBlink 1.4s infinite; }

/* ---------- llamadas ---------- */
.call-win { left: 50%; top: 50%; translate: -50% -50%; width: min(720px, calc(100vw - 32px)); height: min(520px, calc(100vh - 80px)); position: fixed; min-width: 300px; resize: both; background: #0f1d2e; }
.call-win.audio-only { width: 340px; height: 420px; resize: none; }
.call-stage { position: relative; flex: 1; min-height: 0; background: radial-gradient(circle at 50% 35%, #2b4b74, #0d1828 75%); overflow: hidden; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; background: #000; }
.call-win.has-video .call-remote { opacity: 1; }
.call-win.audio-only .call-remote { width: 1px; height: 1px; }
.call-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; text-align: center; padding: 16px; }
.call-win.has-video .call-ph { display: none; }
.call-name { font-size: 18px; font-weight: 600; }
.call-status { color: #b9d3ef; font-variant-numeric: tabular-nums; }
.call-pill { position: absolute; left: 12px; top: 10px; padding: 3px 10px; border-radius: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; display: none; }
.call-win.has-video .call-pill { display: block; }
.call-local { position: absolute; right: 12px; bottom: 12px; width: 26%; max-width: 200px; min-width: 96px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .7); background: #000; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.call-local.mirror { transform: scaleX(-1); }
.call-win.cam-off .call-local { opacity: .25; }
.call-controls { flex: none; display: flex; justify-content: center; gap: 12px; padding: 10px; background: linear-gradient(#1c3352, #0f1d2e); }
.call-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); cursor: pointer; font-size: 20px;
  background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .08)); color: #fff;
}
.call-btn:hover { background: linear-gradient(rgba(255, 255, 255, .38), rgba(255, 255, 255, .15)); }
.call-btn.off { background: linear-gradient(#f3f3f3, #c9c9c9); filter: grayscale(1); }
.call-btn.hang { background: linear-gradient(#ff6b5b, #c8261b); border-color: #8f1a12; }
.call-btn.hang:hover { background: linear-gradient(#ff8576, #d93a2e); }
.call-btn.accept { background: linear-gradient(#69d65a, #2e9b22); border-color: #1f6e17; }
.call-controls .call-btn.hang { transform: rotate(135deg); }
.incoming-call {
  position: fixed; left: 50%; top: 20px; translate: -50% 0; z-index: 9650; display: flex; align-items: center; gap: 12px;
  width: min(420px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: linear-gradient(#fff, #e6f2fd); box-shadow: 0 14px 40px rgba(8, 38, 78, .4); animation: ringIn .4s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes ringIn { from { translate: -50% -40px; opacity: 0; } }
.incoming-call .ic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.incoming-call .ic-text b { font-size: 15px; color: #10345c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-call .ic-text span { color: #4a5f75; }
.incoming-call .ic-btns { display: flex; gap: 8px; }
.incoming-call .avatar-frame { animation: ringPulse 1.2s infinite; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 8px rgba(63, 174, 40, .25); } }

.snd-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #e3ebf3; flex-wrap: wrap; }
.snd-label { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.snd-state { font-size: 11px; color: var(--muted); }
.snd-row .btn { padding: 3px 9px; }
.modal:has(.snd-row) { width: min(520px, 100%); }

@media (max-width: 720px) {
  body:not(.native) .call-win, body:not(.native) .call-win.audio-only { left: 0; top: 0; translate: none; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; resize: none; }
  body:not(.native) .call-win .titlebar { display: none; }
  body:not(.native) .call-controls { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body:not(.native) .call-local { width: 30%; }
  body:not(.native) .media-wrap { padding-left: 4px; }
  body:not(.native) .voice-msg { min-width: 0; width: 100%; }
}

body.reduce-motion .shake, body.reduce-motion .buddies-spin, body.reduce-motion .task-btn.flash { animation: none; }
body.reduce-motion .task-btn.flash { background: linear-gradient(#ffd37a, #f08a00); color: #3a2200; }

/* ---------- Plus! ---------- */
.plus { border-radius: 2px; }
body.line-times .msg-text[data-time]::before { content: "[" attr(data-time) "] "; color: #9aa7b4; font-size: 11px; font-style: normal; font-weight: 400; }
.dlg-sub { font-size: 12px; color: var(--muted); }
.scene-preview { height: 70px; border-radius: 6px; border: 2px solid var(--tint); }
.scene-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scene-grid button { height: 46px; border-radius: 5px; border: 2px solid transparent; cursor: pointer; position: relative; overflow: hidden; padding: 0; }
.scene-grid button span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; background: rgba(255, 255, 255, .78); color: #1c2b3d; padding: 1px 0; }
.scene-grid button.on, .color-row button.on { border-color: #1a5fb4; box-shadow: 0 0 0 2px rgba(26, 95, 180, .3); }
.color-row { display: flex; flex-wrap: wrap; gap: 5px; }
.color-row button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #9ab; cursor: pointer; padding: 0; }
.color-row button.auto { background: linear-gradient(135deg, #3a8ee6, #fff); font-size: 10px; font-weight: 700; color: #123; }
.nick-dlg { gap: 8px !important; }
.nick-preview { min-height: 34px; padding: 6px 10px; border: 1px solid #c2d6ea; border-radius: 4px; background: #fff; font-size: 16px; font-weight: 600; color: #123a66; overflow-wrap: anywhere; }
.nick-code { width: 100%; font-family: Menlo, Consolas, monospace; font-size: 12px; resize: vertical; }
.fmt-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fmt-btn { padding: 3px 9px !important; min-width: 30px; }
.fmt-row input[type=color] { width: 32px; height: 26px; padding: 1px; }
.fmt-row .sep { width: 8px; }
.plus-palette { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.plus-palette button { aspect-ratio: 1; border: 1px solid #9ab; border-radius: 3px; cursor: pointer; padding: 0; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 2px; max-height: 96px; overflow: auto; }
.sym-grid button { border: 1px solid #d5e2ef; background: #fff; border-radius: 3px; cursor: pointer; font-size: 14px; padding: 2px 0; }
.sym-grid button:hover, .tpl:hover { background: #e6f2fd; }
.tpl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 120px; overflow: auto; }
.tpl { border: 1px solid #d5e2ef; background: #fff; border-radius: 3px; padding: 4px 6px; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.modal:has(.nick-dlg) { width: min(560px, 100%); }
.modal:has(.plugins) { width: min(520px, 100%); }
.plugin { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #e3ebf3; cursor: pointer; }
.plugin input[type=checkbox] { margin-top: 3px; }
.plugin input:not([type]) , .plugin input[type=number] { margin-top: 4px; }
.plugin > div > input:not([type=checkbox]) { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid #c8dbee; background: #f3f8fd; border-radius: 12px; padding: 2px 9px; cursor: pointer; font-size: 12px; }
.chip:hover { background: #dcecfb; }
.cmd-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.cmd-table td { padding: 3px 6px; border-bottom: 1px solid #eef3f8; vertical-align: top; }
.cmd-table code, .sys code { background: #eef4fa; border-radius: 3px; padding: 0 4px; font-family: Menlo, Consolas, monospace; font-size: 11.5px; }
label.check { display: flex; gap: 6px; align-items: center; }

#boss { position: fixed; inset: 0; z-index: 99999; background: #fff; font: 12px Arial, sans-serif; color: #000; overflow: hidden; }
#boss .boss-bar { background: #217346; color: #fff; padding: 6px 10px; font-weight: 600; }
#boss .boss-menu { background: #f3f3f3; border-bottom: 1px solid #d4d4d4; padding: 4px 10px; white-space: pre; color: #333; }
#boss table { border-collapse: collapse; width: 100%; }
#boss th { background: #efefef; border: 1px solid #d4d4d4; font-weight: 400; color: #555; padding: 2px 6px; width: 34px; }
#boss td { border: 1px solid #e1e1e1; padding: 2px 6px; height: 20px; text-align: right; }

/* ---------- app de escritorio ---------- */
body.native { background: color-mix(in srgb, var(--tint) 10%, #fff); }
body.native::before, body.native::after { display: none; }
body.native #taskbar { display: none !important; }
body.native #desktop { inset: 0; }
body.native #toasts { display: none; }
body.native .main-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-height: none; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
body.native .main-win > .titlebar, body.native .chat-win > .titlebar, body.native .call-win > .titlebar { display: none; }
body.native .login-win { box-shadow: none; }
body.native-child { background: #fff; }
body.native-child .chat-win { position: fixed; left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important; height: auto !important; border: 0; border-radius: 0; box-shadow: none; resize: none; }
body.native-child .call-win { position: fixed; inset: 0; translate: none; width: auto !important; height: auto !important; border: 0; border-radius: 0; resize: none; z-index: 9000; }
body.native .chat-win .compose-input { height: 64px; }

/* ---------- juegos ---------- */
.chat-win.gaming .chat-main { grid-template-columns: auto 1fr 300px; }
.game-pane {
  --p0: #2f7fe0; --p1: #f08a00;
  min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--tint) 7%, #fff));
  border: 1px solid #c2d6ea; border-radius: 6px; padding: 8px 10px 10px; margin-bottom: 6px;
}
.gp-head { display: flex; align-items: center; gap: 6px; }
.gp-title { flex: 1; font-weight: 600; color: color-mix(in srgb, var(--tint) 45%, #0b2240); }
.gp-x { border: 0; background: none; cursor: pointer; color: #567; width: 24px; height: 22px; border-radius: 3px; }
.gp-x:hover { background: #e3eef9; }
.gp-players { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; }
.gp-pl { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 12px; border: 1px solid transparent; min-width: 0; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-pl.turn { border-color: #9cc6ee; background: #eaf4fe; font-weight: 600; }
.gp-vs { color: var(--muted); font-size: 11px; }
.gp-mark { flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--c); font-size: 11px; font-weight: 700; color: #fff; }
.gp-mark.p0 { --c: var(--p0); } .gp-mark.p1 { --c: var(--p1); }
.gp-mark.k-ttt { background: none; color: var(--c); font-size: 14px; }
.gp-mark.k-c4.p0 { --c: #e23b32; } .gp-mark.k-c4.p1 { --c: #f2c200; }
.gp-mark.k-checkers.p0 { --c: #d23a2a; } .gp-mark.k-checkers.p1 { --c: #2b2b2b; }
.gp-status { text-align: center; color: #4a5f75; padding: 3px; border-radius: 4px; }
.gp-status.mine { color: #1f6e1f; font-weight: 600; background: #eefbe8; }
.gp-status.over { font-weight: 600; font-size: 14px; color: #17406e; background: #fff7dc; }
.gp-board { display: flex; justify-content: center; }
.gp-foot { display: flex; justify-content: center; gap: 8px; margin-top: auto; }
.gp-score { text-align: center; color: #33475e; }
.gp-score.big { font-size: 15px; }
.gp-hint { text-align: center; font-size: 11px; color: var(--muted); }

.b-ttt { display: grid; grid-template-columns: repeat(3, 72px); gap: 5px; }
.b-ttt .cell {
  height: 72px; border: 1px solid #b9d0e8; border-radius: 6px; background: linear-gradient(#fff, #eef5fc);
  font-size: 40px; line-height: 1; cursor: pointer; font-weight: 700; padding: 0;
}
.b-ttt .cell:disabled { cursor: default; }
.b-ttt .cell:not(:disabled):hover { background: linear-gradient(#f2f9ff, #d8ebfc); border-color: #6aa8e4; }
.b-ttt .cell.p0 { color: var(--p0); } .b-ttt .cell.p1 { color: var(--p1); }
.b-ttt .cell.last { box-shadow: inset 0 0 0 2px rgba(47, 127, 224, .25); }
.b-ttt .cell.win { background: linear-gradient(#fff8d6, #ffe48a); border-color: #e5b800; }

.b-c4 { display: flex; gap: 3px; padding: 6px; background: linear-gradient(#2f6fd0, #1d4fa6); border-radius: 8px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3); }
.c4-col { display: flex; flex-direction: column; gap: 3px; border: 0; background: none; padding: 2px; border-radius: 6px; cursor: pointer; }
.c4-col:disabled { cursor: default; }
.c4-col:not(:disabled):hover { background: rgba(255, 255, 255, .18); }
.c4-cell { width: 30px; height: 30px; border-radius: 50%; background: #e9f1fb; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .35); }
.c4-cell.p0 { background: radial-gradient(circle at 35% 30%, #ff8a80, #d8281e); }
.c4-cell.p1 { background: radial-gradient(circle at 35% 30%, #fff1a0, #e8b600); }
.c4-cell.last { outline: 2px solid #fff; outline-offset: -1px; }
.c4-cell.win { box-shadow: 0 0 0 3px #fff, 0 0 10px 3px #fff; }

.b-chk { display: grid; grid-template-columns: repeat(8, 32px); border: 3px solid #6e4a2a; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.b-chk .sq { width: 32px; height: 32px; border: 0; padding: 0; display: grid; place-items: center; position: relative; }
.b-chk .sq.light { background: #f1dfc0; }
.b-chk .sq.dark { background: #a8794f; cursor: pointer; }
.b-chk .sq.last { background: #c39a5e; }
.b-chk .sq.sel { background: #7fae4f; }
.b-chk .sq.target::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: rgba(140, 220, 90, .9); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.b-chk .sq.movable .piece { box-shadow: 0 0 0 2px #ffe680, 0 2px 3px rgba(0, 0, 0, .5); }
.b-chk .piece { width: 25px; height: 25px; border-radius: 50%; box-shadow: 0 2px 3px rgba(0, 0, 0, .5); display: grid; place-items: center; }
.b-chk .piece.p0 { background: radial-gradient(circle at 35% 30%, #ff8f7d, #c22a1b); }
.b-chk .piece.p1 { background: radial-gradient(circle at 35% 30%, #6b6b6b, #141414); }
.b-chk .piece.king::after { content: "♛"; color: #ffd84a; font-size: 15px; line-height: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }

.dots-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.b-dots { display: grid; }
.b-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: #35506e; }
.b-dots .ln { border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 4px; position: relative; }
.b-dots .ln::after { content: ""; position: absolute; border-radius: 3px; background: #dce7f2; }
.b-dots .ln.h::after { left: 0; right: 0; top: 4px; height: 4px; }
.b-dots .ln.v::after { top: 0; bottom: 0; left: 4px; width: 4px; }
.b-dots .ln:not(:disabled):hover::after { background: #9cc6ee; }
.b-dots .ln:disabled { cursor: default; }
.b-dots .ln.p0::after { background: var(--p0); }
.b-dots .ln.p1::after { background: var(--p1); }
.b-dots .ln.last::after { box-shadow: 0 0 0 2px #fff3a6; }
.b-dots .box { display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; border-radius: 3px; margin: 2px; }
.b-dots .box.p0 { background: color-mix(in srgb, var(--p0) 80%, #fff); }
.b-dots .box.p1 { background: color-mix(in srgb, var(--p1) 80%, #fff); }

.b-rps { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rps-btns { display: flex; gap: 8px; }
.rps-btn {
  width: 72px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  border: 1px solid #b9d0e8; border-radius: 8px; background: linear-gradient(#fff, #eef5fc);
}
.rps-btn span { font-size: 34px; line-height: 1.1; }
.rps-btn small { color: #4a5f75; text-transform: capitalize; }
.rps-btn:not(:disabled):hover { border-color: #6aa8e4; background: linear-gradient(#f2f9ff, #d8ebfc); transform: translateY(-2px); }
.rps-btn:disabled { cursor: default; opacity: .55; }
.rps-btn.sel { opacity: 1; border-color: #3fae28; background: linear-gradient(#f3fff0, #d4f5c8); }
.rps-wait { color: #4a5f75; }
.rps-last { font-size: 12px; color: #33475e; text-align: center; background: #f2f7fc; border-radius: 4px; padding: 4px 8px; }

.game-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; padding: 8px 10px; max-width: 420px;
  border: 1px solid #c8dbee; border-radius: 6px; background: linear-gradient(#fbfdff, #eaf3fd);
}
.gc-ico { font-size: 26px; }
.gc-text { flex: 1; min-width: 160px; }
.gc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gc-actions .btn { padding: 3px 10px; }
.gc-status { color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  body:not(.native) .chat-win.gaming .chat-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  body:not(.native) .game-pane { order: -1; max-height: 58vh; margin: 6px 0 0; }
  body:not(.native) .chat-win.gaming .history { min-height: 80px; }
}

/* ---------- paquete de aspecto local ---------- */
.wink-grid button img { width: 48px; height: 36px; object-fit: contain; }
.wink-thumb { width: 28px; height: 21px; object-fit: contain; vertical-align: middle; }
.pic-grid.many { max-height: 236px; overflow-y: auto; overflow-x: hidden; padding-right: 6px; }
.snd-clip { max-width: 110px; }
.wink-layer ruffle-player, .wink-layer ruffle-embed { display: block; }
.popover .wink-grid { max-height: 360px; overflow: auto; }
.emo.wlm { width: 19px; height: 19px; vertical-align: -5px; background-repeat: no-repeat; background-size: auto; }
.emo.wlm.anim { animation-name: emo-play; animation-timing-function: steps(var(--n)); animation-iteration-count: 2; }
@keyframes emo-play { from { background-position: 0 0; } to { background-position: calc(var(--n) * -19px) 0; } }
body.reduce-motion .emo.wlm.anim { animation: none; }
.emo-grid.wlm { grid-template-columns: repeat(10, 28px); max-height: 300px; }
.emo-grid.wlm button { height: 28px; display: grid; place-items: center; padding: 0; }

/* ---------- piezas del aspecto clásico: ocultas en el diseño normal (ver classic.css) ---------- */
.c7-body, .c7-pane { display: contents; }
.c7-tabs, .c7-addrow, .c7-find, .c7-ad, .c7-task, .c7-to, .c7-fmt, .c7-search { display: none !important; }
.send-col { display: flex; flex-direction: column; gap: 4px; }
.send-col .send { flex: 1; }
