*{box-sizing:border-box}body{margin:0;font-family:Arial,sans-serif;background:#0f172a;color:#e5e7eb}a{color:inherit;text-decoration:none}.messenger-shell{display:flex;min-height:100vh}.chat-list{width:360px;background:#111827;border-right:1px solid rgba(255,255,255,.08);padding:16px;overflow:auto}.brand-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.chat-list h2{font-size:20px;margin:0 0 12px}.chat-list h3{font-size:13px;color:#94a3b8;margin:18px 0 8px;text-transform:uppercase;letter-spacing:.04em}.privacy-link,.back-text{color:#93c5fd;font-size:13px}.search-box{width:100%;border:1px solid rgba(255,255,255,.08);background:#0f172a;color:#fff;border-radius:14px;padding:12px;margin:6px 0 12px}.friend-row,.chat-row{display:flex;gap:10px;align-items:center;padding:10px;border-radius:14px;cursor:pointer;color:#e5e7eb}.friend-row:hover,.chat-row:hover{background:rgba(255,255,255,.08)}.friend-row img,.chat-avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#334155;display:inline-flex;align-items:center;justify-content:center}.row-main{flex:1;min-width:0}.row-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row-sub{font-size:12px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge{background:#ef4444;color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 6px;font-size:12px;display:flex;align-items:center;justify-content:center}.chat-panel{flex:1;display:flex;align-items:center;justify-content:center}.empty-state{color:#94a3b8;text-align:center}.single-chat{min-height:100vh;display:flex;flex-direction:column;background:#0f172a;position:relative}.chat-header{height:60px;display:flex;align-items:center;gap:12px;padding:10px 14px;background:#111827;border-bottom:1px solid rgba(255,255,255,.08);position:sticky;top:0;z-index:2}.chat-header small{display:block;color:#94a3b8;font-size:12px;margin-top:2px}.back-btn{font-size:32px;line-height:1;color:#fff}.chat-header>div{flex:1}.chat-header button,.chat-menu button{border:0;background:#1f2937;color:#fff;border-radius:999px;padding:8px 12px}.chat-menu{position:absolute;right:12px;top:62px;background:#111827;border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:8px;z-index:5;box-shadow:0 20px 50px rgba(0,0,0,.35);display:grid;gap:6px}.hidden{display:none!important}.messages{flex:1;padding:16px;overflow:auto}.msg{max-width:75%;padding:10px 12px;border-radius:16px;margin:6px 0;background:#1f2937;overflow-wrap:anywhere}.msg.me{margin-left:auto;background:#2563eb}.msg small{display:block;color:#cbd5e1;font-size:10px;margin-top:5px;text-align:right}.msg img,.msg video{max-width:260px;max-height:280px;border-radius:12px;display:block;margin-top:8px}.typing-hint{height:18px;color:#94a3b8;font-size:12px;padding:0 16px}#sendForm{display:flex;gap:8px;padding:12px;background:#111827;align-items:center}#messageInput{flex:1;border:0;border-radius:999px;padding:12px 16px;background:#1f2937;color:#fff;min-width:0}button,.attach-btn{border:0;border-radius:999px;padding:12px 18px;background:#2563eb;color:white;font-weight:700;cursor:pointer}.attach-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0}.settings-page{max-width:520px;margin:0 auto;padding:24px}.privacy-form{display:grid;gap:14px;background:#111827;border-radius:18px;padding:18px}.privacy-form label{display:grid;gap:7px;color:#cbd5e1}.privacy-form select{border:1px solid rgba(255,255,255,.08);background:#0f172a;color:#fff;border-radius:12px;padding:12px}@media(max-width:700px){.messenger-shell{display:block}.chat-list{width:100%;border-right:0}.chat-panel{display:none}.msg{max-width:86%}.msg img,.msg video{max-width:220px}.chat-header{height:56px}}
.auth-card{max-width:420px;margin:12vh auto;padding:28px;border-radius:24px;background:#fff;box-shadow:0 20px 60px rgba(21,33,70,.14);font-family:system-ui,-apple-system,Segoe UI,sans-serif}.auth-card h1{margin:0 0 18px;color:#111827}.auth-card input{width:100%;box-sizing:border-box;margin:8px 0;padding:14px 16px;border:1px solid #e5e7eb;border-radius:14px;font-size:16px}.auth-card button{width:100%;margin-top:10px;padding:14px 16px;border:0;border-radius:16px;background:linear-gradient(135deg,#6d35ff,#00aeff);color:#fff;font-weight:800;font-size:16px}.error{color:#e11d48;font-weight:700}

.quick-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:8px 0 12px}.quick-actions button{padding:10px 12px;font-size:13px;background:linear-gradient(135deg,#6d35ff,#00aeff)}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:20000;display:flex;align-items:center;justify-content:center;padding:18px}.modal-card{width:min(560px,100%);background:#111827;border:1px solid rgba(255,255,255,.12);border-radius:22px;padding:18px;box-shadow:0 20px 60px rgba(0,0,0,.45);position:relative}.modal-card h2{margin:0 0 14px}.modal-close{position:absolute;right:10px;top:10px;width:34px;height:34px;padding:0;background:#1f2937}.modal-form{display:grid;gap:10px}.modal-form input,.modal-form textarea,.modal-form select,.channel-post-form textarea{width:100%;border:1px solid rgba(255,255,255,.1);background:#0f172a;color:#fff;border-radius:14px;padding:12px}.modal-form textarea,.channel-post-form textarea{min-height:90px;resize:vertical}
.channel-page{min-height:100vh;background:#0f172a;color:#e5e7eb}.channel-post-form{display:grid;gap:10px;padding:14px;background:#111827;border-bottom:1px solid rgba(255,255,255,.08)}.mini-attach{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:10px 12px;background:#1f2937;color:#e5e7eb;font-weight:700;width:max-content}.channel-posts{padding:14px;display:grid;gap:12px}.channel-post{background:#111827;border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:14px;box-shadow:0 10px 30px rgba(0,0,0,.15)}.post-meta,.post-stats{font-size:12px;color:#94a3b8}.post-body{font-size:16px;margin:10px 0;white-space:pre-wrap;overflow-wrap:anywhere}.channel-post img,.channel-post video{max-width:100%;border-radius:14px;margin-top:8px}.channel-post audio{width:100%;margin-top:8px}.channel-row .chat-avatar{background:linear-gradient(135deg,#6d35ff,#00aeff)}
@media(max-width:700px){.quick-actions{grid-template-columns:1fr 1fr}.quick-actions button:nth-child(3){grid-column:1/-1}.modal-overlay{align-items:flex-end;padding:0}.modal-card{border-radius:22px 22px 0 0}}

/* Fix: Telegram action buttons in one neat row on top */
.quick-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  align-items:center!important;
  overflow-x:auto!important;
  padding:2px 0 8px!important;
  -webkit-overflow-scrolling:touch;
}
.quick-actions button{
  flex:1 0 0!important;
  min-width:0!important;
  white-space:nowrap!important;
  padding:11px 10px!important;
  font-size:13px!important;
  line-height:1.1!important;
  border-radius:18px!important;
}
@media(max-width:420px){
  .quick-actions{gap:6px!important;}
  .quick-actions button{font-size:12px!important;padding:10px 7px!important;border-radius:16px!important;}
}
/* Group/channel UX fixes */
.modal-sep{border:0;border-top:1px solid rgba(255,255,255,.12);margin:14px 0}.group-modal-list{display:grid;gap:8px;max-height:260px;overflow:auto;margin:8px 0}.channel-post-title{font-size:18px;font-weight:800;margin:6px 0;color:#fff}.channel-post-desc{white-space:pre-wrap;color:#e2e8f0;line-height:1.45;margin:6px 0}.channel-post .post-body{white-space:pre-wrap;color:#cbd5e1;line-height:1.45}.channel-post img,.channel-post video{max-width:100%;border-radius:14px;margin-top:10px}.channel-post audio{width:100%;margin-top:10px}


/* Channel post real actions */
.channel-post{position:relative;}
.channel-post-head{display:flex;align-items:flex-start;gap:10px;}
.channel-post-head .post-meta{flex:1;min-width:0;}
.channel-post-actions{position:relative;flex:none;z-index:20;}
.channel-post-menu-btn{display:inline-flex!important;align-items:center;justify-content:center;border:0;border-radius:999px;background:#1f2937;color:#fff;width:38px;height:34px;font-weight:900;font-size:17px;line-height:1;}
.channel-post-menu{position:absolute;right:0;top:40px;background:#fff;color:#0f172a;border-radius:14px;box-shadow:0 16px 40px rgba(0,0,0,.35);padding:6px;min-width:132px;z-index:9999;}
.channel-post-menu button{display:block;width:100%;border:0;background:transparent;color:#0f172a;text-align:left;padding:10px 12px;border-radius:10px;font-weight:800;}
.channel-post-menu button:hover{background:#f1f5f9;}
.post-delete-action{color:#dc2626!important;}
.post-action-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;color:#94a3b8;}
.post-action-bar button{border:1px solid rgba(255,255,255,.12);background:#111827;color:#e5e7eb;border-radius:999px;padding:7px 10px;font-weight:800;}
.post-like-btn.active{background:#2563eb;color:#fff;border-color:#2563eb;}
.post-view-count{margin-left:auto;color:#94a3b8;font-weight:700;}
.reaction-strip{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;}
.reaction-count{background:rgba(255,255,255,.08);border-radius:999px;padding:4px 8px;color:#e5e7eb;font-size:13px;}
.reaction-picker{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-top:10px;}
.reaction-picker button{border:0;border-radius:14px;background:#f1f5f9;font-size:24px;padding:10px;}
.comment-row{border-bottom:1px solid rgba(148,163,184,.22);padding:8px 0;}
.comment-row strong{display:block;color:#0f172a;}
.comment-row p{margin:4px 0;color:#334155;white-space:pre-wrap;}
.comment-row small{color:#64748b;}
@media(max-width:560px){.post-action-bar{gap:6px}.post-action-bar button{padding:6px 8px;font-size:13px}.post-view-count{margin-left:0;width:100%;}.reaction-picker{grid-template-columns:repeat(3,1fr)}}

/* WorldPalm settings/menu/i18n update */
.menu-btn{border:0;background:#1f2937;color:#fff;border-radius:14px;padding:8px 11px;font-size:20px;line-height:1}
.side-menu{position:fixed;left:12px;top:64px;width:min(310px,calc(100vw - 24px));background:#111827;border:1px solid rgba(255,255,255,.14);border-radius:22px;padding:12px;z-index:10000;box-shadow:0 24px 70px rgba(0,0,0,.55);display:grid;gap:6px}
.side-menu-head{display:flex;align-items:center;justify-content:space-between;padding:6px 6px 10px;color:#fff}
.side-menu-head button{width:34px;height:34px;padding:0;background:#1f2937}
.side-menu a{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;color:#e5e7eb;background:rgba(255,255,255,.03)}
.side-menu a:hover{background:rgba(37,99,235,.22)}
.settings-page input,.settings-page textarea{border:1px solid rgba(255,255,255,.08);background:#0f172a;color:#fff;border-radius:12px;padding:12px;width:100%}
.success{background:rgba(34,197,94,.12);color:#86efac;border:1px solid rgba(34,197,94,.3);border-radius:12px;padding:10px}
.menu-card,.legal-card{display:grid;gap:8px;background:#111827;border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:16px;margin-top:16px;color:#cbd5e1;line-height:1.6}
.menu-card a{padding:10px;border-radius:12px;background:rgba(255,255,255,.04)}
@media(max-width:700px){.brand-row h2{font-size:18px}.side-menu{left:8px;top:58px;width:calc(100vw - 16px)}}

.chat-avatar{overflow:hidden}.chat-avatar img{width:100%;height:100%;object-fit:cover;display:block}.privacy-form input,.privacy-form textarea{border:1px solid rgba(255,255,255,.08);background:#0f172a;color:#fff;border-radius:12px;padding:12px}

/* Group message three-dot button: show exact ... text */
.group-page .msg{
  position:relative!important;
  padding-right:52px!important;
}
.group-page .msg-action-btn{
  position:absolute!important;
  top:10px!important;
  right:10px!important;
  width:38px!important;
  height:32px!important;
  border:0!important;
  border-radius:999px!important;
  background:rgba(15,23,42,.72)!important;
  color:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:18px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:1px!important;
  padding:0!important;
  z-index:25!important;
}
.group-page .msg-action-menu{
  position:absolute!important;
  top:46px!important;
  right:10px!important;
  min-width:128px!important;
  background:#fff!important;
  color:#0f172a!important;
  border-radius:14px!important;
  padding:6px!important;
  box-shadow:0 16px 40px rgba(0,0,0,.35)!important;
  z-index:9999!important;
}
.group-page .msg-action-menu button{
  display:block!important;
  width:100%!important;
  border:0!important;
  background:transparent!important;
  color:#0f172a!important;
  text-align:left!important;
  padding:10px 12px!important;
  border-radius:10px!important;
  font-weight:800!important;
}
.group-page .msg-delete-action{color:#dc2626!important;}

/* Private chat media and call controls */
.chat-title{flex:1;min-width:0}.call-mini-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;background:#1f6bff;color:#fff;text-decoration:none;font-size:18px;margin-left:8px;box-shadow:0 8px 24px rgba(31,107,255,.25)}
.attachment-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#9fb0c9;margin-right:4px}.msg img{max-width:100%;border-radius:16px;margin-top:8px}.msg video{max-width:100%;border-radius:16px;margin-top:8px}.msg audio{width:230px;max-width:100%;margin-top:8px}
.call-screen{min-height:100vh;background:#071225;color:#fff;display:flex;flex-direction:column}.call-header{height:82px;display:flex;gap:14px;align-items:center;padding:18px;border-bottom:1px solid rgba(255,255,255,.08)}.call-header small{display:block;color:#9fb0c9;margin-top:3px}.call-videos{position:relative;flex:1;display:flex;align-items:center;justify-content:center;background:#030812;overflow:hidden}.call-videos video#remoteVideo{width:100%;height:100%;object-fit:cover}.call-videos video#localVideo{position:absolute;right:14px;bottom:14px;width:34%;max-width:170px;border-radius:18px;border:2px solid rgba(255,255,255,.25);background:#111}.audio-only{font-size:26px;background:rgba(255,255,255,.08);padding:24px;border-radius:24px}.call-controls{display:flex;gap:10px;justify-content:center;padding:16px;background:#0e1830}.call-controls button{border:0;border-radius:999px;padding:13px 18px;background:#23324f;color:#fff;font-weight:800}.call-controls .danger{background:#ef4444}.hidden{display:none!important}
@media(max-width:520px){.call-mini-btn{width:38px;height:38px;font-size:16px;margin-left:5px}.attachment-name{max-width:80px}.call-videos video#localVideo{width:38%}.call-controls button{padding:12px 14px}}

/* friends/search toolbar fix */
.search-row{display:flex;gap:8px;align-items:center;margin:0 0 12px}.search-row .search-box{flex:1;margin:0}.search-btn{background:linear-gradient(135deg,#6d5dfc,#00b7ff);color:#fff;border:0;border-radius:16px;font-weight:800}.friend-start-btn{width:100%;text-align:left;border:0;background:transparent;color:inherit}.search-result-list h3,.friend-modal-list h3{margin:14px 0 8px;color:#94a3b8;text-transform:uppercase;font-size:13px;letter-spacing:.06em}.modal-card .chat-row{width:100%;box-sizing:border-box}.modal-card .chat-row:hover{background:rgba(255,255,255,.06)}
@media(max-width:520px){.search-row{gap:6px}.search-btn{min-width:78px;font-size:12px;padding:10px 8px}.quick-actions button{font-size:12px!important}}

/* Messenger ad placements */
.wp-messenger-ad{margin:12px 0;padding:10px;border-radius:18px;background:#111827;border:1px solid rgba(255,255,255,.10);box-shadow:0 12px 28px rgba(0,0,0,.18);overflow:hidden}
.wp-messenger-ad .wp-ad-label{font-size:11px;color:#94a3b8;margin-bottom:7px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.wp-messenger-ad .wp-ad-link{display:block;color:#e5e7eb;text-decoration:none}
.wp-messenger-ad img,.wp-messenger-ad video{width:100%;max-height:320px;object-fit:contain;border-radius:14px;background:#020617;display:block}
.wp-messenger-ad .wp-ad-code{width:100%;overflow:hidden;border-radius:14px;background:#020617}
.wp-messenger-ad .wp-ad-title{font-size:13px;color:#cbd5e1;margin-top:8px;font-weight:700}
.wp-ad-placeholder{min-height:120px;border-radius:14px;background:linear-gradient(135deg,#1d4ed8,#7c3aed);display:grid;place-items:center;font-size:28px;font-weight:900;color:#fff}
.channel-posts>.wp-messenger-ad{margin:12px 0}
.group-messages>.wp-messenger-ad{align-self:center;width:min(92%,420px)}
@media(max-width:700px){.wp-messenger-ad img,.wp-messenger-ad video{max-height:260px}.wp-messenger-ad{border-radius:16px}}


/* Group settings / member management */
.group-settings-grid{display:grid;gap:12px}
.group-settings-grid label{display:grid;gap:6px;color:#cbd5e1;font-weight:700}
.group-settings-grid input,.group-settings-grid textarea,.group-settings-grid select{width:100%;border:1px solid rgba(255,255,255,.12);background:#0f172a;color:#fff;border-radius:14px;padding:12px}
.group-settings-grid textarea{min-height:78px;resize:vertical}
.member-row,.pending-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.08)}
.member-row .chat-avatar,.pending-row .chat-avatar{flex:0 0 auto}
.member-actions{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.member-actions button,.inline-small-btn{border:0;border-radius:999px;background:#1f2937;color:#fff;padding:7px 10px;font-size:12px}
.member-actions .danger{background:#7f1d1d}
.member-actions .primary,.inline-small-btn.primary{background:#2563eb}
.invite-box{display:grid;gap:8px;background:#0f172a;border:1px solid rgba(255,255,255,.1);border-radius:16px;padding:12px;margin:10px 0;overflow-wrap:anywhere}
.modal-sep{border:0;border-top:1px solid rgba(255,255,255,.12);margin:16px 0}
.btn-primary{display:inline-block;background:#2563eb;color:#fff;border-radius:999px;padding:12px 16px;font-weight:800}
@media(max-width:700px){.group-head-actions button{padding:8px 10px}.member-row,.pending-row{align-items:flex-start}.member-actions{width:100%;margin-left:0;justify-content:flex-start}}


/* Fix: message three-dot buttons must stay behind settings/invite modals */
.modal-overlay{z-index:20000!important;}
.modal-card{z-index:20001!important;max-height:92vh;overflow:auto;}
.invite-friend-list{display:grid;gap:8px;max-height:320px;overflow:auto;margin:10px 0;}
.invite-friend-row{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:rgba(255,255,255,.04);cursor:pointer;color:#e5e7eb;}
.invite-friend-row input{width:18px;height:18px;flex:none;}
.invite-search-row .search-box{margin:0;width:100%;}
.wide-btn{width:100%;margin-top:10px;}
.primary{background:#2563eb!important;color:#fff!important;}

/* ===== Fixed Messenger composer ===== */
html,
body {
    height: 100%;
}

.single-chat {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.single-chat .chat-header {
    flex: 0 0 auto;
    position: relative;
    top: auto;
}

.single-chat .messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
}

.single-chat .typing-hint {
    flex: 0 0 auto;
}

.single-chat #sendForm {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    flex: 0 0 auto;
    z-index: 20;
    margin: 0;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: #111827;
    border-top: 1px solid rgba(255,255,255,.08);
}

.single-chat #messageInput {
    min-height: 44px;
}

@media (max-width: 700px) {
    body:has(.single-chat) {
        overflow: hidden;
    }

    .single-chat {
        height: 100svh;
        height: 100dvh;
    }
}

/* ===== FINAL MOBILE CHAT INPUT FIX ===== */

body:has(.single-chat) {
    margin: 0 !important;
    overflow: hidden !important;
}

.single-chat {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    padding-bottom: 76px !important;
}

.single-chat .chat-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
}

.single-chat .messages {
    overflow-y: auto !important;
    min-height: 0 !important;
    padding-bottom: 100px !important;
    -webkit-overflow-scrolling: touch;
}

.single-chat #sendForm {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    min-height: 68px !important;
    margin: 0 !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: #111827 !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
    z-index: 99999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.single-chat #messageInput {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
}

.single-chat #sendForm button {
    flex: 0 0 auto !important;
}

@media (max-width: 700px) {
    .single-chat {
        padding-bottom: 82px !important;
    }

    .single-chat #sendForm {
        min-height: 72px !important;
    }
}


/* WORLD PALM AI TRANSLATION STYLES */
.msg-ai-translation {
    display: block;
    margin-top: 9px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(15, 23, 42, .22);
    border-left: 3px solid rgba(255, 255, 255, .65);
    line-height: 1.45;
}

.msg-ai-translation.hidden {
    display: none;
}

.msg-ai-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .75;
}

.msg-ai-text,
.msg-ai-loading,
.msg-ai-error {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.msg-ai-error {
    color: #fecaca;
}

.msg-translate-action:disabled {
    cursor: wait;
    opacity: .65;
}

/* WORLD PALM MULTI-LANGUAGE TRANSLATION MODAL */
.wp-translation-language-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(2, 6, 18, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.wp-translation-language-card {
    width: min(100%, 520px);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 26px 26px 0 0;
    background: #111827;
    color: #f8fafc;
    box-shadow: 0 -24px 70px rgba(0,0,0,0.48);
}

.wp-translation-language-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 12px;
}

.wp-translation-language-head h3 {
    margin: 0;
    font-size: 23px;
    line-height: 1.2;
}

.wp-translation-language-head p {
    margin: 5px 0 0;
    color: #94a3b8;
    font-size: 14px;
}

.wp-translation-language-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #1f2937;
    color: #ffffff;
    font-size: 27px;
    line-height: 1;
}

.wp-translation-language-search-wrap {
    padding: 0 18px 13px;
}

.wp-translation-language-search-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 15px;
    outline: none;
    background: #0b1220;
    color: #ffffff;
    font-size: 16px;
}

.wp-translation-language-search-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.wp-translation-language-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    overflow-y: auto;
    padding: 0 18px calc(20px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}

.wp-translation-language-option {
    display: flex;
    min-width: 0;
    min-height: 72px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    background: #1a2435;
    color: #ffffff;
    text-align: left;
}

.wp-translation-language-option.selected {
    border-color: #3b82f6;
    background: rgba(37,99,235,0.25);
}

.wp-translation-language-option:active {
    transform: scale(0.98);
}

.wp-translation-language-native {
    max-width: 100%;
    overflow: hidden;
    font-size: 17px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-translation-language-english {
    max-width: 100%;
    overflow: hidden;
    color: #9ca3af;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-ai-translate-again {
    align-self: flex-start;
    margin-top: 10px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    color: inherit;
    font-size: 12px;
    font-weight: 700;
}

@media (min-width: 700px) {
    .wp-translation-language-overlay {
        align-items: center;
        padding: 20px;
    }

    .wp-translation-language-card {
        border-radius: 26px;
    }
}

@media (max-width: 390px) {
    .wp-translation-language-list {
        grid-template-columns: 1fr;
    }

    .wp-translation-language-option {
        min-height: 62px;
    }
}
