/* Generated H5 desktop override: keeps h5.php in the mobile application layout at every viewport width. */
body.client-h5.is-standard-member #peerIp,
body.client-h5.is-standard-member #peerLocation,
body.client-h5.is-standard-member #peerLastLogin,
body.client-h5.is-standard-member .profile-sensitive-location { display:none!important; }
/* ui.css mobile block 1: @media (max-width: 860px) */

  .shell { height: 100vh; height: 100dvh; min-height: 0; padding: 0; }
  .auth { grid-template-columns: 1fr; gap: 28px; padding: 26px; }
  .brand { text-align: center; }
  .brand .logo { margin: auto; }
  .brand h1 { margin-top: 18px; font-size: 48px; }
  .brand p { font-size: 16px; }
  .auth-card { width: min(410px,100%); margin: auto; }
  .chat-app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: minmax(0,1fr);
    border: 0;
    border-radius: 0;
  }
  .app-rail { display: none; }
  .conversation { display: none; }
  .chat-app.chat-open .sidebar { display: none; }
  .chat-app.chat-open .conversation { display: block; }
  .side-head { padding: 16px 14px 12px; }
  .chat-panel { height: 100vh; height: 100dvh; grid-template-rows: 88px minmax(0,1fr) auto; }
  .chat-head { height: 88px; min-height: 88px; padding: 8px 12px; }
  .back { display: block; }
  .messages { padding: 20px 12px; }
  .msg-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .bubble { max-width: 78%; }
  .compose-area { background: #f3f5f4; }
  .composer {
    min-height: 0;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 9px 10px max(9px, env(safe-area-inset-bottom));
  }
  .compose-tools { flex: 0 0 auto; gap: 1px; }
  .tool-btn { width: 34px; height: 42px; }
  .composer textarea {
    width: auto;
    min-width: 0;
    min-height: 42px;
    max-height: 100px;
    flex: 1;
    padding: 10px;
    border: 1px solid #dfe3e0;
    border-radius: 13px;
    background: #fff;
  }
  .message-field { flex: 1; align-self: stretch; }
  .message-field textarea { width: 100%; }
  .send { width: 54px; height: 42px; flex: 0 0 auto; }
  .emoji-panel {
    right: 10px;
    left: 10px;
    width: auto;
    grid-template-columns: repeat(7,minmax(36px,1fr));
    padding: 12px;
  }
  .pending-attachment { max-width: calc(100% - 20px); margin: 9px 10px 0; }
  .image-message img { max-width: 100%; max-height: 290px; }
  .file-message { min-width: min(225px,65vw); }
  .batch-bar { right: 10px; bottom: 72px; }

/* ui.css mobile block 2: @media (max-width: 860px) */

  .is-auth { background-position: 36% center; }
  .is-auth .auth { grid-template-columns: 1fr; gap: 18px; }
  .is-auth .auth-card { grid-column: 1; }
  .is-auth .brand { align-self: auto; margin: 0 auto; padding: 12px 18px; text-align: center; }
  .is-auth .brand h1 { font-size: 28px; }
  .is-auth .brand p { display: none; }
  .is-auth .auth-card { padding: 28px; }

/* ui.css mobile block 3: @media (max-width: 860px) */

  html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
  .shell{width:100%;height:100%;height:var(--h5-height,100dvh);overflow:hidden;overscroll-behavior:none}
  body.is-chat .shell{position:fixed;top:var(--h5-offset-top,0px);right:0;bottom:auto;left:0}
  .is-auth .shell{display:flex;align-items:center;justify-content:center;padding:14px}
  .is-auth .auth{width:100%;max-width:100%;display:block;padding:0}
  .is-auth .auth-card{width:min(100%,400px);margin:0 auto;background:rgba(255,255,255,.96)}
  body{-webkit-tap-highlight-color:transparent}
  button{touch-action:manipulation}
  .chat-app{position:relative;height:100%;grid-template-rows:minmax(0,1fr) calc(62px + env(safe-area-inset-bottom));background:#edf5fb}
  .sidebar{grid-row:1;min-height:0;border:0}
  .side-head{padding:calc(14px + env(safe-area-inset-top)) 16px 12px;background:rgba(239,247,253,.94);backdrop-filter:blur(18px)}
  .side-title{margin-bottom:12px}
  .h5-page-brand{display:flex;align-items:center;gap:10px}
  .h5-page-brand>img{width:38px;height:38px;display:block;border-radius:12px;object-fit:cover;mix-blend-mode:multiply;filter:drop-shadow(0 5px 9px rgba(32,111,171,.13))}
  .h5-page-brand>div{display:grid;gap:1px}
  .h5-page-brand strong{font-size:20px;color:#18334d;line-height:1.15}
  .h5-page-brand small{display:block;color:#86a0b5;font-size:10px;letter-spacing:.08em}
  .add-contact{width:38px;height:38px;border-radius:12px;color:#187fc8;background:#dceffc}
  .search{height:44px;border-radius:14px;background:#fff;box-shadow:0 3px 14px rgba(40,93,137,.06)}
  .contacts{padding-bottom:8px;overscroll-behavior:contain}
  .contact{min-height:76px;padding:11px 15px;border-radius:0;border-bottom:1px solid rgba(64,105,137,.07);transition:background .12s,transform .12s}
  .contact:active{background:#dcecf8;transform:scale(.992)}
  .contact.active{color:#fff;background:linear-gradient(135deg,#2298ed,#2478e8);box-shadow:0 8px 22px rgba(34,126,221,.2)}
  .contact.active .contact-copy strong{color:#fff}
  .contact.active .contact-copy small,
  .contact.active time>span{color:rgba(255,255,255,.78)}
  .contact.active .pinned-label{color:#fff;background:rgba(255,255,255,.18)}
  .contact.active .contact-muted{color:rgba(255,255,255,.9)}
  .contact.active .unread-dot{background:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.18)}
  .contact .avatar{width:52px;height:52px;border-radius:16px;box-shadow:0 5px 14px rgba(33,82,120,.12)}
  .contact-copy strong{font-size:16px}
  .contact-copy small{margin-top:6px;font-size:13px}
  .contact time>span{font-size:12px}
  .contact .unread-badge,.contact .unread-badge svg{width:24px;height:24px}
  .contact .unread-badge circle{fill:#ff4054;stroke:#fff;stroke-width:1.7}
  .contact .unread-badge text{fill:#fff;font-size:11px;font-weight:750}
  .h5-new-friends{display:block;flex:0 0 auto;padding:10px 10px 5px;background:#edf5fb}
  .h5-new-friend-card,.h5-new-friends-entry{width:100%;min-height:66px;display:flex;align-items:center;gap:10px;padding:9px 11px;border:0;border-radius:15px;background:#fff;box-shadow:0 5px 18px rgba(32,75,109,.06);text-align:left}
  .h5-new-friend-card>div,.h5-new-friends-entry>span:nth-child(2){min-width:0;display:grid;gap:4px;flex:1}
  .h5-new-friend-card strong,.h5-new-friends-entry strong{overflow:hidden;color:#203649;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
  .h5-new-friend-card small,.h5-new-friends-entry small{overflow:hidden;color:#8b9aa7;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
  .h5-new-friend-avatar{width:43px;height:43px;display:grid;place-items:center;flex:0 0 43px;overflow:hidden;border-radius:13px;color:#fff;background:linear-gradient(145deg,#53b8f9,#2b7ddd);font-weight:700}
  .h5-new-friend-avatar img{width:100%;height:100%;object-fit:cover}
  .h5-new-friend-card>button{height:32px;flex:0 0 auto;padding:0 10px;border:0;border-radius:9px;font-size:12px;font-weight:600}
  .h5-new-friend-card>button.accept{color:#fff;background:#218de0}
  .h5-new-friend-card>button.ignore{color:#6f7f8c;background:#edf2f5}
  .h5-new-friend-card>button:disabled{opacity:.55}
  .h5-new-friends-icon{width:43px;height:43px;display:grid!important;place-items:center;flex:0 0 43px!important;border-radius:13px;color:#fff;background:linear-gradient(145deg,#44b783,#2d9c69)}
  .h5-new-friends-icon .ui-icon{width:23px;height:23px}
  .h5-request-avatars{display:flex!important;flex:0 0 auto!important;padding-left:12px}
  .h5-request-avatars .h5-new-friend-avatar{width:29px;height:29px;flex:0 0 29px;margin-left:-10px;border:2px solid #fff;border-radius:9px;font-size:9px}
  .h5-new-friends-entry>b{min-width:20px;height:20px;padding:0 5px;border-radius:10px;color:#fff;background:#ff4357;text-align:center;font-size:11px;line-height:20px}
  .h5-new-friends-entry>.arrow{width:15px;height:15px;flex:0 0 auto;color:#a8b4bd}
  .h5-new-friends-entry:active{background:#f3f7f9}
  .h5-nav{grid-row:2;display:grid;grid-template-columns:repeat(4,1fr);padding:5px 10px max(5px,env(safe-area-inset-bottom));border-top:1px solid rgba(36,86,128,.1);background:rgba(250,253,255,.97);box-shadow:0 -10px 28px rgba(32,76,112,.08);backdrop-filter:blur(20px);z-index:20}
  .h5-nav>button{position:relative;display:grid;place-items:center;align-content:center;gap:3px;border:0;border-radius:15px;color:#8295a6;background:transparent;font-size:11px;transition:color .15s,background .15s,transform .12s}
  .h5-nav>button:active{transform:scale(.92)}
  .h5-nav .ui-icon{width:23px;height:23px}
  .h5-nav>button.active{color:#1688e2;background:linear-gradient(180deg,rgba(55,166,239,.1),rgba(55,166,239,.025))}
  .h5-icon-wrap{position:relative;display:grid}
  .h5-message-badge{position:absolute;z-index:3;top:-9px;right:-13px;width:25px;height:25px;display:block;pointer-events:none}
  .h5-message-badge svg{width:25px;height:25px;display:block;overflow:visible}
  .h5-message-badge circle{fill:#ff4054;stroke:#fff;stroke-width:1.6;filter:drop-shadow(0 2px 5px rgba(224,45,66,.42))}
  .h5-message-badge text{fill:#fff;stroke:none;text-anchor:middle;dominant-baseline:middle;font:700 10.5px "Segoe UI",sans-serif}
  .h5-icon-wrap i{position:absolute;top:-3px;right:-6px;width:9px;height:9px;border:2px solid #fff;border-radius:50%;background:#ff4056;box-shadow:0 0 8px rgba(255,64,86,.75)}
  .h5-mini-avatar{width:24px;height:24px;display:grid;place-items:center;overflow:hidden;border-radius:8px;color:#fff;background:linear-gradient(145deg,#4eb7fb,#2577dc);font-size:11px;font-weight:700}
  .h5-mini-avatar img{width:100%;height:100%;object-fit:cover}
  .h5-logout{display:block;width:100%;height:44px;margin-top:22px;border:1px solid #e1e7ec;border-radius:12px;color:#b9565d;background:#f8fafb;font-weight:600}
  .h5-section{grid-row:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#f2f5f7}
  .h5-section-head{flex:0 0 auto;padding:calc(18px + env(safe-area-inset-top)) 18px 14px;background:rgba(248,251,253,.96);border-bottom:1px solid rgba(46,86,118,.07)}
  .h5-section-head h1{margin:0;color:#172d40;font-size:23px;line-height:1.2}
  .h5-section-body{min-height:0;flex:1;overflow-y:auto;padding:14px 12px calc(20px + env(safe-area-inset-bottom));overscroll-behavior:contain}
  .h5-profile-hero{width:100%;min-height:108px;display:flex;align-items:center;gap:15px;padding:17px;border:0;border-radius:17px;background:#fff;box-shadow:0 6px 24px rgba(30,67,97,.06);text-align:left}
  .h5-profile-avatar{width:68px;height:68px;display:grid;place-items:center;flex:0 0 68px;overflow:hidden;border-radius:18px;color:#fff;background:linear-gradient(145deg,#4db7fb,#2879df);font-size:23px;font-weight:700;box-shadow:0 8px 20px rgba(42,116,181,.17)}
  .h5-profile-avatar img{width:100%;height:100%;object-fit:cover}
  .h5-profile-copy{min-width:0;display:grid;gap:8px;flex:1}
  .h5-profile-copy strong{overflow:hidden;color:#172c3f;text-overflow:ellipsis;white-space:nowrap;font-size:21px}
  .h5-profile-copy small{overflow:hidden;color:#7c8f9f;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
  .h5-menu-group{margin-top:14px;overflow:hidden;border-radius:15px;background:#fff;box-shadow:0 5px 20px rgba(31,68,98,.045)}
  .h5-menu-group>button{width:100%;min-height:58px;display:flex;align-items:center;gap:12px;padding:8px 14px;border:0;border-bottom:1px solid #edf1f4;background:#fff;text-align:left;font-size:15px}
  .h5-menu-group>button:last-child{border-bottom:0}
  .h5-menu-group>button:active{background:#f1f5f7}
  .h5-menu-group>button>span:nth-child(2){flex:1;color:#243747}
  .h5-menu-group>button>small{color:#9aa8b3;font-size:12px}
  .h5-menu-icon{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:10px;color:#fff}
  .h5-menu-icon .ui-icon{width:19px;height:19px}
  .h5-menu-icon.blue{background:#3c9eef}.h5-menu-icon.green{background:#35b77b}.h5-menu-icon.purple{background:#8474e8}.h5-menu-icon.amber{background:#efa943}.h5-menu-icon.gray{background:#7d8c99}
  .h5-section .arrow,.h5-settings-list .ui-icon{width:17px;height:17px;flex:0 0 auto;color:#abb7c0}
  .h5-settings-list{overflow:hidden;border:1px solid #e8edf1;border-radius:14px;background:#fff}
  .h5-settings-list>button{width:100%;height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 13px;border:0;border-bottom:1px solid #edf1f4;background:#fff;font-size:15px}
  .h5-settings-list>button:last-child{border-bottom:0}
  .h5-settings-list>button:active{background:#f2f5f7}
  .conversation{position:absolute;inset:0;z-index:30;display:block!important;height:100%;visibility:hidden;transform:translate3d(100%,0,0);transition:transform .26s cubic-bezier(.22,.8,.24,1),visibility 0s linear .26s;will-change:transform;box-shadow:-14px 0 34px rgba(30,72,107,.13);touch-action:pan-y}
  .chat-app.chat-open{grid-template-rows:minmax(0,1fr)}
  .chat-app.chat-open .sidebar{display:flex}
  .chat-app.chat-open .h5-nav{display:none}
  .chat-app.chat-open .conversation{grid-row:1;height:100%;visibility:visible;transform:translate3d(var(--h5-swipe-x,0px),0,0);transition:transform .26s cubic-bezier(.22,.8,.24,1),visibility 0s}
  .chat-panel{height:100%;grid-template-rows:calc(56px + env(safe-area-inset-top)) minmax(0,1fr) auto}
  .chat-head{position:relative;height:calc(56px + env(safe-area-inset-top));min-height:calc(56px + env(safe-area-inset-top));display:flex;align-items:center;justify-content:center;padding:env(safe-area-inset-top) 58px 0;border-bottom:1px solid rgba(40,88,127,.08);background:rgba(248,252,255,.98);box-shadow:0 3px 12px rgba(35,75,108,.045)}
  .back{position:absolute;bottom:2px;left:5px;width:44px;height:52px;margin:0;color:#263d50;font-size:27px}
  .chat-head .avatar{display:none!important}
  .peer-heading{width:100%;min-width:0;display:block!important;grid-template-columns:none!important;grid-template-rows:none!important;text-align:center;overflow:hidden}
  .peer-heading strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;color:#172e43;font-size:17px;font-weight:700;line-height:56px}
  .peer-heading .h5-chat-subtitle{display:none!important}
  .peer-heading>span,.peer-heading>.peer-account{display:none!important}
  .history-entry{position:absolute;right:7px;bottom:7px;width:42px;height:42px;padding:0;display:grid;place-items:center;border:0;border-radius:12px;color:#3978aa;background:transparent;box-shadow:none}
  .history-entry:active{background:#e5f1fa}
  .history-entry span{display:none}
  .history-entry .ui-icon{width:21px;height:21px}
  .back:active,.history-entry:active,.tool-btn:active,.send:active{transform:scale(.9)}
  .messages{padding:16px 11px max(18px,env(safe-area-inset-bottom));overscroll-behavior:contain}
  .message-row{width:100%;max-width:100%;margin:12px 0;gap:8px}
  .msg-avatar{width:36px;height:36px;flex:0 0 36px;border-radius:11px}
  .bubble{min-width:0;max-width:calc(76% - 4px);flex:0 1 auto;font-size:15px;line-height:1.55}
  .bubble:not(.attachment-bubble){border-radius:14px}
  .text-bubble{padding:10px 13px;border-radius:14px}
  .bubble time{margin-top:3px;font-size:10px}
  .bubble.emoji-only{min-width:44px;min-height:44px;padding:9px 11px 7px;text-align:center;font-size:20px;line-height:1.2}
  .bubble.emoji-only time{display:none}
  .quoted-message{max-width:min(62vw,260px);padding:7px 8px;margin:-2px 0 7px}
  .quoted-message span{display:block;max-width:100%;font-size:12px}
  .attachment-bubble{max-width:calc(100% - 52px)}
  .image-message img{width:auto!important;max-width:min(72vw,320px)!important;max-height:44vh!important;height:auto!important;object-fit:contain}
  .image-bubble.has-quote{max-width:min(76vw,330px)}
  .image-bubble.has-quote .image-message img{max-width:100%!important}
  .file-message{width:min(66vw,280px);min-width:0}
  .composer{padding:7px 8px max(8px,env(safe-area-inset-bottom));gap:5px;background:rgba(239,246,251,.97)}
  body.is-chat.h5-keyboard-open .composer{padding-bottom:7px}
  .compose-tools{gap:0}
  .tool-btn{width:38px;height:44px}
  .message-field{overflow:hidden;border:1px solid #d8e3ec;border-radius:14px;background:#fff;box-shadow:0 2px 8px rgba(35,77,110,.04);transition:border-color .15s,box-shadow .15s}
  .message-field:focus-within{border-color:#70b7eb;box-shadow:0 0 0 3px rgba(43,151,229,.1)}
  .composer textarea{min-height:44px;max-height:112px;padding:10px 34px 10px 12px;border:0!important;border-radius:0;background:transparent;font-size:16px;box-shadow:none!important}
  .composer textarea:focus{border:0!important;box-shadow:none!important}
  .clear-message{top:8px;right:6px}
  .send{width:54px;height:44px;border-radius:12px}
  .emoji-panel{bottom:calc(64px + env(safe-area-inset-bottom));max-height:min(310px,42vh);overflow-y:auto;grid-template-columns:repeat(7,1fr);border-radius:18px}
  .pending-attachment,.reply-preview{margin-left:8px;margin-right:8px}
  .modal{align-items:end;padding:0;background:rgba(17,35,52,.42)}
  .modal-card{width:100%!important;max-width:none;max-height:calc(92dvh - env(safe-area-inset-top));margin:0;padding:22px 18px max(20px,env(safe-area-inset-bottom));border-radius:22px 22px 0 0;overflow-y:auto;animation:h5-sheet-in .22s ease-out}
  .modal-card::before{content:"";display:block;width:38px;height:4px;margin:-10px auto 15px;border-radius:3px;background:#d5dde4}
  input,textarea,select,
  .modal-card input,.modal-card textarea,.modal-card select,
  .auth-card input,.auth-reset input,.composer textarea{font-size:16px!important}
  .history-card{height:calc(94dvh - env(safe-area-inset-top));display:flex;flex-direction:column}
  .history-results{min-height:0;flex:1}
  .avatar-lightbox{padding:16px}
  .message-menu,.contact-menu{position:fixed!important;right:10px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;left:10px!important;top:auto!important;width:auto;grid-template-columns:repeat(3,1fr);padding:10px;border-radius:18px}
  .message-menu button,.contact-menu button{min-height:54px;justify-content:center}
  .confirm-layer{align-items:end;padding:12px 12px max(12px,env(safe-area-inset-bottom))}
  .confirm-card{width:100%;border-radius:20px}

/* ui.css mobile block 4: @media(max-width:860px) */
.message-delivery{margin-top:2px;font-size:10px}.image-bubble>.message-delivery,.file-bubble>.message-delivery{padding:2px 4px}
/* ui-v2.css mobile block 1: @media(max-width:820px) */
.copy-toast{bottom:calc(76px + env(safe-area-inset-bottom))}
/* ui-v2.css mobile block 2: @media(max-width:860px) */

  html,body{max-width:100%;overflow-x:hidden}
  body.is-chat .shell{right:auto;left:var(--h5-offset-left,0px);width:var(--h5-width,100%);max-width:none}
  body.is-chat .chat-app,body.is-chat .conversation,body.is-chat .chat-panel,body.is-chat .compose-area,body.is-chat #messageForm.composer,body.is-chat .message-field{width:100%;max-width:100%;min-width:0}
  /* Keep all five APP sections on the same white surface. */
  body.is-chat .chat-app,body.is-chat .sidebar,body.is-chat .contacts,body.is-chat .h5-new-friends{background:#fff}
  body.is-chat .side-head{border-bottom-color:#edf1f4;background:rgba(255,255,255,.98)}
  body.is-chat .peer-heading{display:flex!important;align-items:center;justify-content:center}
  body.is-chat .peer-heading>.peer-title-line{width:100%;height:56px;display:flex!important;align-items:center;justify-content:center;gap:6px;max-width:100%}
  body.is-chat .peer-title-line strong{min-width:0;max-width:100%;flex:0 1 auto;font-size:clamp(13px,4vw,16px);line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.is-chat .peer-gender{width:20px;height:20px;flex-basis:20px}
  body.is-chat .peer-gender svg{width:14px;height:14px}

/* ui-v2.css mobile block 3: @media(max-width:820px) */

  body.is-chat #messageForm.composer{padding:0 8px max(8px,env(safe-area-inset-bottom))}
  body.is-chat.h5-keyboard-open #messageForm.composer{padding-bottom:7px}
  body.is-chat .compose-toolbar{height:46px;gap:4px}
  body.is-chat .compose-tools{width:100%;justify-content:space-between;gap:1px}
  body.is-chat .tool-btn{height:38px;gap:4px;padding:0 5px;font-size:11px}
  body.is-chat .tool-btn .ui-icon{width:17px;height:17px}
  body.is-chat .compose-shortcut{display:none}
  body.is-chat .message-field{height:104px;border-radius:14px}
  body.is-chat #messageInput{height:100%!important;min-height:0;max-height:none;padding:14px 82px 32px 13px;font-size:16px!important}
  body.is-chat .paste-hint{left:12px;bottom:11px;font-size:10px}
  body.is-chat .clear-message{top:7px;right:7px}
  body.is-chat .send{right:7px;bottom:7px;width:68px;min-width:68px;height:36px;border-radius:10px;font-size:13px}
  body.is-chat .send .ui-icon{width:14px;height:14px}
  body.is-chat .emoji-panel{bottom:calc(158px + env(safe-area-inset-bottom));left:8px}

/* ui-v2.css mobile block 4: @media(max-width:820px) */

  body.is-chat .contact-avatar-shell{display:contents}
  body.is-chat .contact-online-dot,
  body.is-chat .contact-online-label{display:none}

/* ui-v2.css mobile block 5: @media(max-width:820px) */

  body.is-chat .gc-group-avatar-shell{width:52px;height:52px;flex-basis:52px}
  body.is-chat .gc-group-avatar-shell>.avatar{width:52px;height:52px}
  body.is-chat .gc-group-avatar-mark{right:-4px;bottom:-4px}

/* ui-v2.css mobile block 6: @media(max-width:820px) */

  body.is-chat .modal,
  body.is-chat .gc-dialog,
  body.is-chat .gc-info-modal,
  body.is-chat .gc-action-dialog{align-items:end;padding:0}
  body.is-chat .modal-card,
  body.is-chat .gc-dialog-card,
  body.is-chat .gc-info-card,
  body.is-chat .gc-action-card{
    width:100%!important;
    max-width:none;
    padding:20px 18px max(18px,env(safe-area-inset-bottom));
    border-width:1px 0 0;
    border-radius:12px 12px 0 0;
    box-shadow:0 -8px 28px rgba(0,0,0,.14);
  }
  body.is-chat .modal-card::before{background:#c8c8c8}
  body.is-chat .confirm-layer{align-items:end;padding:12px 12px max(12px,env(safe-area-inset-bottom))}
  body.is-chat .confirm-card{width:100%;border-radius:10px}
  body.is-chat .message-menu,
  body.is-chat .contact-menu{border-radius:10px}

/* ui-v2.css mobile block 7: @media(max-width:820px) */

  body.is-chat .group-chat-mode .chat-panel.gc-has-announcement{grid-template-rows:calc(56px + env(safe-area-inset-top)) 38px minmax(0,1fr) auto}
  body.is-chat .gc-announcement-bar{height:38px;padding:0 10px}
  body.is-chat .gc-announcement-track span{font-size:12px}

/* ui-v2.css mobile block 8: @media(max-width:820px) */

  body.is-chat{--v2-blue:#07c160;--v2-blue-deep:#06ad56;--bubble:#95ec69}
  body.is-chat .h5-section,body.is-chat .h5-section-head{background:#fff}
  body.is-chat .contact.active,body.is-chat .contact.pinned.active{color:#162033;border-bottom-color:#ededed;background:#fff;box-shadow:none}
  body.is-chat .contact.active .contact-copy strong,body.is-chat .contact.pinned.active .contact-copy strong{color:#162033}
  body.is-chat .contact.active .contact-copy small,body.is-chat .contact.active time>span,body.is-chat .contact.pinned.active .contact-copy small,body.is-chat .contact.pinned.active time>span{color:#8290a5}
  body.is-chat .contact.active .pinned-label,body.is-chat .contact.pinned.active .pinned-label{color:#4d7398;background:#deedfb}
  body.is-chat .contact.active:active,body.is-chat .contact.pinned.active:active{background:#ededed}
  body.is-chat .h5-nav>button.active{color:#07c160;background:transparent}
  body.is-chat .chat-panel,body.is-chat .messages{background:#ededed}
  body.is-chat .chat-head{border-bottom-color:#dcdcdc;background:rgba(247,247,247,.98);box-shadow:none}
  body.is-chat .bubble{border-color:#ddd;border-radius:5px;background:#fff;box-shadow:none}
  body.is-chat .bubble::before{background:#fff;filter:none}
  body.is-chat .message-row.mine .bubble{border-color:#86d75e;background:#95ec69;box-shadow:none}
  body.is-chat .message-row.mine .bubble::before{background:#95ec69;filter:none}
  body.is-chat .compose-area{border-top-color:#ddd;background:#f7f7f7;box-shadow:none}
  body.is-chat .message-field{border-color:#ddd;background:#fff;box-shadow:none}
  body.is-chat .send{background:#07c160;box-shadow:none}
  body.is-chat .send:disabled{color:#aaa;background:#e9e9e9;opacity:1}

/* ui-v2.css mobile block 9: @media(max-width:820px) */

  body.is-chat .compose-area{
    border-top:1px solid #dedede;
    background:#f7f7f7;
    box-shadow:none;
  }
  body.is-chat #messageForm.composer{
    position:relative;
    display:grid;
    grid-template-columns:40px minmax(0,1fr) 40px 40px auto;
    grid-template-rows:auto;
    align-items:end;
    gap:7px;
    min-height:0;
    padding:8px 8px max(8px,env(safe-area-inset-bottom));
    background:#f7f7f7;
  }
  body.is-chat.h5-keyboard-open #messageForm.composer{padding-bottom:7px}
  body.is-chat .compose-toolbar,
  body.is-chat .compose-tools,
  body.is-chat .message-field{display:contents}
  body.is-chat .compose-shortcut,
  body.is-chat .paste-hint,
  body.is-chat .clear-message{display:none!important}
  body.is-chat .tool-btn{
    width:40px;
    height:40px;
    min-width:0;
    display:grid;
    place-items:center;
    gap:0;
    padding:0;
    border:0;
    border-radius:5px;
    color:#222;
    background:transparent;
  }
  body.is-chat .tool-btn:hover{color:#222;background:transparent}
  body.is-chat .tool-btn .ui-icon{width:28px;height:28px;stroke-width:1.65}
  body.is-chat .tool-btn>span{display:none}
  body.is-chat .tool-image{grid-column:1;grid-row:1;color:#222}
  body.is-chat #messageInput{
    grid-column:2;
    grid-row:1;
    align-self:end;
    width:100%;
    height:40px!important;
    min-height:40px;
    max-height:100px;
    overflow-y:auto;
    padding:9px 11px;
    border:0!important;
    border-radius:5px;
    color:#222;
    background:#fff;
    box-shadow:none!important;
    font-size:16px!important;
    line-height:22px;
  }
  body.is-chat #messageInput::placeholder{color:#b2b2b2}
  body.is-chat .tool-emoji{grid-column:3;grid-row:1;color:#222}
  body.is-chat .h5-more-tool{grid-column:4;grid-row:1;display:grid;color:#222}
  body.is-chat .send{
    grid-column:5;
    grid-row:1;
    position:static;
    align-self:end;
    width:auto;
    min-width:54px;
    height:40px;
    padding:0 13px;
    border-radius:5px;
    color:#fff;
    background:#07c160;
    box-shadow:none;
    font-size:14px;
    font-weight:500;
  }
  body.is-chat .send .ui-icon{display:none}
  body.is-chat .send:not(:disabled):hover{background:#06ad56;filter:none}
  body.is-chat .send:disabled{color:#aaa;background:#e5e5e5;opacity:1}
  body.is-chat .tool-video,
  body.is-chat .tool-audio,
  body.is-chat .tool-file{
    position:absolute;
    z-index:8;
    bottom:56px;
    display:none;
    width:64px;
    height:58px;
    padding:6px 4px 4px;
    border:1px solid #e4e4e4;
    border-radius:7px;
    background:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,.13);
  }
  body.is-chat .compose-tools.h5-more-open .tool-video,
  body.is-chat .compose-tools.h5-more-open .tool-audio,
  body.is-chat .compose-tools.h5-more-open .tool-file{display:flex;flex-direction:column}
  body.is-chat .compose-tools.h5-more-open .tool-video{right:142px}
  body.is-chat .compose-tools.h5-more-open .tool-audio{right:76px}
  body.is-chat .compose-tools.h5-more-open .tool-file{right:10px}
  body.is-chat .compose-tools.h5-more-open .tool-video>span,
  body.is-chat .compose-tools.h5-more-open .tool-audio>span,
  body.is-chat .compose-tools.h5-more-open .tool-file>span{display:block;color:#555;font-size:11px;line-height:1}
  body.is-chat .emoji-panel{
    right:8px;
    bottom:calc(64px + env(safe-area-inset-bottom));
    left:8px;
    width:auto;
  }

/* ui-v2.css mobile block 10: @media(max-width:820px) */
.peer-title-line{justify-content:center}.peer-typing{position:absolute;top:28px;left:50%;margin:0;transform:translateX(-50%);font-size:10px}
/* ui-v2.css mobile block 11: @media(max-width:820px) */

  body.is-chat .h5-nav{grid-template-columns:repeat(5,minmax(0,1fr));padding:5px 4px max(5px,env(safe-area-inset-bottom));border-top:1px solid #dedede;background:rgba(247,247,247,.97);box-shadow:none}
  body.is-chat .h5-nav>button{border-radius:0;color:#7d8890;background:transparent;font-size:11px}
  body.is-chat .h5-nav>button.active{color:#07c160;background:transparent}

  body.is-chat #h5MePage{background:#ededed}
  body.is-chat #h5MePage .h5-me-head{display:none}
  body.is-chat #h5MePage .h5-section-body{padding:0 0 calc(24px + env(safe-area-inset-bottom));background:#ededed}
  body.is-chat #h5MePage .h5-profile-hero{
    min-height:245px;
    gap:18px;
    padding:calc(54px + env(safe-area-inset-top)) 24px 38px;
    border-radius:0;
    background:#fff;
    box-shadow:none;
  }
  body.is-chat #h5MePage .h5-profile-avatar{
    width:72px;
    height:72px;
    flex-basis:72px;
    border-radius:7px;
    box-shadow:none;
    font-size:24px;
  }
  body.is-chat #h5MePage .h5-profile-copy{align-self:center;gap:8px}
  body.is-chat #h5MePage .h5-profile-copy strong{color:#111;font-size:22px;font-weight:600;line-height:1.2}
  body.is-chat #h5MePage .h5-profile-copy small{color:#737373;font-size:15px;line-height:1.25}
  body.is-chat #h5MePage .h5-profile-status{display:flex;align-items:center;gap:8px;margin-top:1px}
  body.is-chat #h5MePage .h5-profile-status i{height:27px;display:inline-flex;align-items:center;padding:0 9px;border:1px solid #dedede;border-radius:14px;color:#777;background:#fff;font-size:13px;font-style:normal;line-height:1}
  body.is-chat #h5MePage .h5-profile-status i:last-child{width:27px;justify-content:center;padding:0;font-size:16px}
  body.is-chat #h5MePage .h5-profile-actions{display:flex;align-items:center;gap:13px;flex:0 0 auto;color:#9b9b9b}
  body.is-chat #h5MePage .h5-profile-qr{width:21px;height:21px;fill:#687582}
  body.is-chat #h5MePage .h5-profile-actions .arrow{width:18px;height:18px;color:#aaa}

  body.is-chat #h5MePage .h5-menu-group{margin:10px 0 0;border-radius:0;background:#fff;box-shadow:none}
  body.is-chat #h5MePage .h5-menu-group>button{min-height:57px;gap:14px;padding:0 17px;border-bottom:1px solid #e5e5e5;background:#fff;font-size:16px}
  body.is-chat #h5MePage .h5-menu-group>button:last-child{border-bottom:0}
  body.is-chat #h5MePage .h5-menu-group>button:active{background:#e5e5e5}
  body.is-chat #h5MePage .h5-menu-group>button>span:nth-child(2){color:#171717;font-weight:400}
  body.is-chat #h5MePage .h5-menu-group .arrow{width:17px;height:17px;color:#aaa}
  body.is-chat #h5MePage .h5-menu-line-icon{width:27px;height:27px;display:grid;place-items:center;flex:0 0 27px;background:transparent}
  body.is-chat #h5MePage .h5-menu-line-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
  body.is-chat #h5MePage .h5-menu-line-icon.service{color:#10b981}
  body.is-chat #h5MePage .h5-menu-line-icon.favorite{color:#ffb529}
  body.is-chat #h5MePage .h5-menu-line-icon.moments{color:#169bd5}
  body.is-chat #h5MePage .h5-menu-line-icon.emoji{color:#ffc21a}
  body.is-chat #h5MePage .h5-menu-line-icon.files{color:#2f94dc}
  body.is-chat #h5MePage .h5-menu-line-icon.settings{color:#2397df}
  body.is-chat #h5MePage .h5-me-main-group,
  body.is-chat #h5MePage .h5-me-settings-group{margin-top:10px}

/* ui-v2.css mobile block 12: @media(max-width:820px) */
body.is-chat .user-profile-card{padding:0!important;border-radius:20px 20px 0 0}body.is-chat .user-profile-card::before{position:absolute;z-index:3;top:10px;left:50%;margin:0;transform:translateX(-50%)}body.is-chat .profile-identity{grid-template-columns:76px minmax(0,1fr);gap:15px;padding:30px 54px 20px 18px}body.is-chat .profile-hero-avatar{width:76px;height:76px}body.is-chat .profile-info-list{padding:0 18px}body.is-chat .profile-action-list{padding:12px 14px max(16px,env(safe-area-inset-bottom))}
/* ui-v2.css mobile block 13: @media(max-width:820px) */
body.is-chat .gc-manage-panel{width:min(390px,94vw)}body.is-chat .gc-manage-panel>header{padding-top:max(14px,env(safe-area-inset-top))}body.is-chat .gc-manage-panel>footer{grid-template-columns:repeat(4,minmax(0,1fr));max-height:218px}
/* ui-v2.css mobile block 14: @media(max-width:820px) */
body.is-chat .user-profile-card{max-height:92dvh}body.is-chat .profile-identity{padding:36px 28px 24px}body.is-chat .profile-hero-avatar{width:116px;height:116px}body.is-chat .profile-meta-strip{margin:0 15px;padding:17px 0}body.is-chat .profile-meta-strip>div{gap:5px;padding:0 7px}body.is-chat .profile-meta-strip span{font-size:11px}body.is-chat .profile-meta-strip strong{font-size:12px}body.is-chat .profile-signature{margin:0 16px}body.is-chat .profile-action-list{padding:0 16px max(20px,env(safe-area-inset-bottom))}body.is-chat .gc-manage-panel{width:min(420px,96vw)}body.is-chat .gc-group-identity-card,body.is-chat .gc-member-preview-card{margin-right:10px;margin-left:10px}body.is-chat .gc-manage-panel>footer{padding-right:10px;padding-left:10px}
/* group-chat.css mobile block 1: @media(max-width:820px) */
.gc-dialog,.gc-info-modal{align-items:end;padding:0}.gc-dialog-card,.gc-info-card{width:100%;max-width:none;max-height:86vh;padding:18px;border-width:1px 0 0;border-radius:16px 16px 0 0}.gc-contact-list{max-height:42vh}
/* group-chat.css mobile block 2: @media(max-width:820px) */
.group-chat-mode .chat-panel.gc-has-announcement{grid-template-rows:calc(56px + env(safe-area-inset-top)) 36px minmax(0,1fr) auto}.gc-announcement-bar{height:36px;padding:0 10px;font-size:12px}.gc-manage-panel{position:fixed;z-index:1200;width:min(360px,92vw);top:0;height:100dvh}.gc-manage-panel>header{padding-top:max(14px,env(safe-area-inset-top))}
/* group-chat.css mobile block 3: @media(max-width:820px) */
.gc-action-dialog{align-items:end;padding:0}.gc-action-card{width:100%;padding:20px 18px max(20px,env(safe-area-inset-bottom));border-width:1px 0 0;border-radius:18px 18px 0 0}
/* group-chat.css mobile block 4: @media(max-width:820px) */
.gc-moderation-settings{top:auto;right:0;bottom:0;left:0;width:100%;max-height:82dvh;padding:20px 18px max(20px,env(safe-area-inset-bottom));transform:none;border-width:1px 0 0;border-radius:18px 18px 0 0}
/* group-chat.css mobile block 5: @media(max-width:820px) */
.gc-invitation{grid-template-columns:40px minmax(0,1fr);margin:8px 12px}.gc-invitation>.avatar{width:40px;height:40px}.gc-invitation>div{grid-column:2}.gc-mention-panel{position:fixed;right:8px;bottom:calc(66px + env(safe-area-inset-bottom));left:8px;max-height:38vh}
/* group-chat.css mobile block 6: @media(max-width:820px) */
.gc-sender-name{gap:4px;font-size:11px}.gc-role-badge{padding:2px 4px;font-size:9px}
/* group-chat.css mobile block 7: @media(max-width:820px) */
.gc-public-group-card{grid-template-columns:44px minmax(0,1fr) auto}.gc-public-group-avatar,.gc-public-group-avatar img,.gc-public-group-avatar>span{width:44px;height:44px}.gc-public-identity{margin-top:10px}
/* group-extras.css mobile block 1: @media(max-width:820px) */
.gx-modal{align-items:end;padding:0}.gx-card{width:100%;max-height:88dvh;border-width:1px 0 0;border-radius:18px 18px 0 0}.gx-card>header{padding-top:max(18px,env(safe-area-inset-top))}.gx-body{padding-bottom:max(18px,env(safe-area-inset-bottom))}.gx-request-list article{grid-template-columns:42px minmax(0,1fr)}.gx-request-list article>div{grid-column:2;justify-content:flex-end}
/* h5-discover.css mobile block 1: @media (max-width: 820px) */

  .h5-nav { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .h5-nav button { width: 100%; min-width: 0; padding-left: 2px; padding-right: 2px; font-size: 11px; }
  .h5-nav button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .h5-nav .ui-icon { width: 21px; height: 21px; }
  .h5-discover-list { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 20px; }
  .h5-discover-link { display: flex; align-items: center; min-height: 70px; gap: 13px; padding: 11px 14px; color: #172a42; text-decoration: none; background: #fff; border: 1px solid #e5ebf3; border-radius: 14px; box-shadow: 0 5px 15px rgba(31, 67, 109, .05); }
  .h5-discover-link:active { transform: scale(.985); background: #f7faff; }
  .h5-discover-logo,.h5-discover-logo-fallback { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; }
  .h5-discover-logo { object-fit: cover; background: #eef5ff; }
  .h5-discover-logo-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3b9cff, #2077ea); }
  .h5-discover-logo-fallback .ui-icon { width: 25px; height: 25px; }
  .h5-discover-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .h5-discover-arrow { flex: 0 0 auto; color: #9aabba; font-size: 23px; line-height: 1; }
  .h5-discover-state { padding: 48px 20px; color: #9ba8b8; font-size: 14px; text-align: center; }

@media (min-width: 861px) {
  body.client-h5.is-chat { background:#d8d8d8; }
  body.client-h5.is-chat .shell { position:relative!important; top:auto!important; right:auto!important; bottom:auto!important; left:auto!important; width:min(100%,560px)!important; max-width:560px!important; margin:0 auto; box-shadow:0 0 36px rgba(0,0,0,.16); }
}

/* Keep h5.php on the one-column mobile frame on wide physical screens. */
body.client-h5.is-chat .chat-app {
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) calc(62px + env(safe-area-inset-bottom))!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:0!important;
  background:#fff!important;
  box-shadow:none!important;
}
body.client-h5.is-chat .app-rail { display:none!important; }
body.client-h5.is-chat .sidebar {
  grid-column:1!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
}
body.client-h5.is-chat .h5-nav {
  grid-column:1!important;
  grid-row:2!important;
  width:100%!important;
  min-width:0!important;
}
body.client-h5.is-chat .conversation {
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  min-width:0!important;
}
body.client-h5.is-chat .chat-app.chat-open { grid-template-rows:minmax(0,1fr)!important; }
body.client-h5.is-chat .chat-app.chat-open .h5-nav { display:none!important; }
