/* Messenger (see modules/messenger.js) */
/* chat pages: Secret small at the top centre, paused; tapping her goes back to her Home */
.mx-secret-hit{display:none}
body.mx-on .mx-secret-hit{display:block;position:absolute;inset:8%;border-radius:50%;border:0;background:transparent;cursor:pointer;z-index:3;-webkit-tap-highlight-color:transparent}
body.mx-on #stage{opacity:.75;filter:saturate(.7)}
body.mx-on #view{padding-bottom:12px}

.mx-head{display:flex;align-items:center;gap:8px;margin:2px 0 8px}
.mx-title{flex:1;text-align:center;margin:0;font-size:1.1rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-head-side{width:44px;flex:none}
.mx-icon{appearance:none;flex:none;width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:var(--panel);color:var(--fg);display:grid;place-items:center;cursor:pointer;padding:0}

.mx-av{flex:none;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(140deg,#16314a,#2a1d4a);
  border:1px solid #2a3a5c;color:var(--cyan);font-weight:500;font-size:1.05rem}
.mx-av-big{width:112px;height:112px;font-size:2.6rem}

/* contact list (like LINE) */
.mx-list{display:flex;flex-direction:column}
.mx-row{appearance:none;display:flex;align-items:center;gap:12px;width:100%;padding:10px 4px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--fg);text-align:left;cursor:pointer}
.mx-row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.mx-row-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-row-last{color:var(--muted);font-size:.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-row-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.mx-row-time{color:var(--muted);font-size:.75rem}
.mx-unread{min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--ok);color:#03140b;font-size:.75rem;font-weight:600;display:grid;place-items:center}
.mx-empty{text-align:center;padding:24px 8px;display:flex;flex-direction:column;gap:12px;align-items:center}
.mx-reqs{display:flex;flex-direction:column;gap:8px;margin-bottom:6px}
.mx-req{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--panel);border:1px solid #3d3216;border-radius:14px;padding:10px 12px}
.mx-req-text{flex:1;min-width:0;display:flex;flex-direction:column}
.mx-req-btns{display:flex;gap:6px;margin-left:auto}
.mx-small{min-height:38px;padding:6px 14px}

/* conversation */
.mx-thread{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:6px 2px 10px}
body.mx-on #app{height:100vh;height:100dvh;min-height:0}
body.mx-on #view{flex:1;min-height:0}
.mx-msg{display:flex;flex-direction:column;max-width:80%}
.mx-theirs{align-self:flex-start;align-items:flex-start}
.mx-mine{align-self:flex-end;align-items:flex-end}
.mx-bubble{padding:9px 13px;border-radius:18px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}
.mx-theirs .mx-bubble{background:var(--panel-2);border:1px solid var(--line);border-bottom-left-radius:6px}
.mx-mine .mx-bubble{background:#2b2410;border:1px solid #4a3b14;border-bottom-right-radius:6px}
.mx-meta{font-size:.72rem;color:var(--muted);margin-top:2px;display:flex;gap:6px;align-items:center}
.mx-by-secret{color:var(--cyan);border:1px solid #1e3550;border-radius:999px;padding:0 6px}
.mx-compose{display:flex;gap:8px;align-items:flex-end;padding-top:6px;padding-bottom:env(safe-area-inset-bottom,0px)}
.mx-compose textarea{flex:1;max-height:120px;min-height:46px}
.mx-send{appearance:none;flex:none;width:46px;height:46px;border-radius:50%;border:0;background:var(--gold);color:#1a1300;display:grid;place-items:center;cursor:pointer}

/* unread badge on the menu item and the menu button */
a[data-badge]{position:relative}
a[data-badge]::after{content:attr(data-badge);position:absolute;right:12px;top:50%;transform:translateY(-50%);min-width:20px;height:20px;padding:0 6px;
  border-radius:999px;background:var(--ok);color:#03140b;font-size:.72rem;font-weight:600;display:grid;place-items:center}
.vh-menu-btn.mx-has-unread::after{content:'';position:absolute;top:8px;right:8px;width:10px;height:10px;border-radius:50%;background:var(--ok)}

/* new-message banner (top of the screen, tap to open) */
.mx-banner{position:fixed;left:12px;right:12px;top:calc(10px + env(safe-area-inset-top,0px));z-index:20;display:flex;align-items:center;gap:10px;text-align:left;
  background:rgba(11,15,30,.96);border:1px solid #1e3550;border-radius:16px;padding:10px 12px;color:var(--fg);box-shadow:0 10px 30px rgba(0,0,0,.6);
  cursor:pointer;animation:mx-drop .3s ease-out both;transition:opacity .6s,transform .6s}
.mx-banner-out{opacity:0;transform:translateY(-20px)}
.mx-banner-text{display:flex;flex-direction:column;min-width:0}
.mx-banner-text span{color:var(--muted);font-size:.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@keyframes mx-drop{from{opacity:0;transform:translateY(-16px)}to{opacity:1;transform:none}}

/* call screen (design; calling is switched on in a later round) — sits under Secret, inside the chat frame */
.mx-call{position:fixed;left:0;right:0;bottom:0;top:calc(min(34vw,140px) + 14px + env(safe-area-inset-top,0px));z-index:15;
  display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:28px 16px calc(36px + env(safe-area-inset-bottom,0px));
  background:#000}
.mx-call-who{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:4vh}
.mx-call-rings{position:relative;display:grid;place-items:center;border-radius:50%}
.mx-call-rings::before,.mx-call-rings::after{content:'';position:absolute;inset:-14px;border-radius:50%;border:1px solid rgba(95,227,240,.35);animation:mx-ring 2.4s ease-out infinite}
.mx-call-rings::after{animation-delay:1.2s}
@keyframes mx-ring{from{transform:scale(.9);opacity:.9}to{transform:scale(1.35);opacity:0}}
.mx-call-name{font-size:1.5rem;font-weight:500}
.mx-call-status{color:var(--muted);font-variant-numeric:tabular-nums}
.mx-call-btns{display:flex;gap:28px;justify-content:center}
.mx-call-btn{appearance:none;display:flex;flex-direction:column;align-items:center;gap:6px;background:transparent;border:0;color:var(--fg);font-size:.8rem;cursor:pointer}
.mx-call-btn svg{width:64px;height:64px;padding:18px;border-radius:50%;background:var(--panel-2);border:1px solid var(--line);box-sizing:border-box}
.mx-call-btn.mx-red svg{background:#d6384f;border-color:#d6384f;color:#fff}
.mx-call-btn.mx-green svg{background:#2fbf71;border-color:#2fbf71;color:#fff}

@media (prefers-reduced-motion:reduce){.mx-banner,.mx-call-rings::before,.mx-call-rings::after{animation:none}}
