/* MsgYap product UI refresh — v0.8
   Presentation-only layer. Existing actions, crypto, transport and data contracts are unchanged. */
:root{
  --brand-blue:#0b8cff;--brand-violet:#6a2cff;--brand-pink:#ef0a8f;--brand-orange:#ff9800;
  --brand-grad:linear-gradient(135deg,var(--brand-blue) 0%,var(--brand-violet) 45%,var(--brand-pink) 74%,var(--brand-orange) 100%);
  --bg:#f6f7fb;--panel:#fff;--ink:#14151a;--ink-soft:#6c7280;--line:#e8eaf0;
  --header-bg:rgba(255,255,255,.92);--side-bg:#fff;--chat-bg:#efe9e2;
  --accent:#6557e8;--accent-dark:#5547d4;--accent-soft:#f0edff;
  --bubble-out:#dff7d7;--bubble-in:#fff;--success:#17b26a;
  --shadow-soft:0 10px 30px rgba(25,22,54,.08);
  --shadow-float:0 24px 70px rgba(25,22,54,.14);
}
html,body,#app,#screen{background:var(--bg)}
body{font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-.005em}

/* auth */
.auth-wrap{
  position:relative;overflow:hidden;
  background:
    radial-gradient(700px 420px at 10% 5%,rgba(11,140,255,.14),transparent 68%),
    radial-gradient(700px 420px at 95% 95%,rgba(239,10,143,.12),transparent 68%),
    #f7f8fc;
}
.auth-wrap:before,.auth-wrap:after{content:"";position:absolute;border-radius:50%;filter:blur(10px);pointer-events:none}
.auth-wrap:before{width:380px;height:380px;right:-170px;top:-180px;background:radial-gradient(circle,rgba(255,152,0,.22),rgba(239,10,143,.08) 48%,transparent 72%)}
.auth-wrap:after{width:420px;height:420px;left:-210px;bottom:-220px;background:radial-gradient(circle,rgba(11,140,255,.2),rgba(106,44,255,.07) 55%,transparent 72%)}
.auth-card{
  position:relative;z-index:1;max-width:455px;padding:34px 32px 30px;border:1px solid rgba(230,231,239,.9);
  border-radius:30px;box-shadow:0 30px 90px rgba(28,24,67,.13);backdrop-filter:blur(18px);
}
.brand-logo{width:48px;height:48px;border-radius:16px;color:#fff;background:var(--brand-grad);display:grid;place-items:center;box-shadow:0 12px 28px rgba(105,44,255,.26)}
.brand-logo .ic{width:26px;height:26px}
.brand-name{font-size:28px;font-weight:850;letter-spacing:-.04em}
.tagline{font-size:14px;line-height:1.6;max-width:340px;margin:10px auto 18px}
.launch-note{border-radius:14px;background:#f7f5ff;border-color:#e2dcff;color:#504967}
.tabs{border:1px solid #ebeaf3;background:#f7f7fb;border-radius:14px}
.tab{min-height:42px;border-radius:10px}
.tab.active{box-shadow:0 8px 18px rgba(34,30,73,.08);color:var(--accent-dark)}
.auth-card input,.auth-card textarea{border-radius:14px;min-height:46px;background:#fbfbfd;border-color:#e4e5eb}
.auth-card input:focus,.auth-card textarea:focus{background:#fff;box-shadow:0 0 0 4px rgba(101,87,232,.1)}
.auth-card .btn.primary{min-height:48px;border-radius:14px;background:var(--brand-grad);box-shadow:0 12px 28px rgba(101,87,232,.22)}
.proto-badge{border-radius:12px;background:#faf9ff;color:#77718e}

/* desktop messenger shell */
.main{background:#eef0f4}
.sidebar{width:390px;border-right:1px solid #e4e6eb;box-shadow:2px 0 18px rgba(19,22,31,.025);z-index:3}
.side-head,.chat-head{
  background:rgba(255,255,255,.94);backdrop-filter:blur(18px) saturate(150%);
  border-bottom:1px solid #e8eaf0;box-shadow:none
}
.side-head{height:68px;min-height:68px;padding:10px 14px}
.me-chip{border-radius:14px;padding:6px 8px}
.me-chip:hover{background:#f4f4f8}
#net-chip{border-radius:999px;background:#eefaf4;color:#168458;padding:5px 10px}
.cat-pills{padding:10px 12px 7px;gap:7px;background:#fff}
.cat-pill{padding:7px 12px;border-radius:999px;background:#f6f7f9;border-color:transparent;color:#525866;font-size:12px}
.cat-pill:hover{border-color:#dcdde5;background:#fff}
.cat-pill.active{background:#ebe7ff;color:#5747d3;border-color:#dcd4ff}
.search{margin:8px 12px 10px;padding:10px 14px;border-radius:12px;background:#f4f5f7}
.chat-list{background:#fff}
.chat-item{min-height:76px;padding:10px 14px;border-bottom:1px solid #f0f1f4}
.chat-item:hover{background:#f7f8fa}
.chat-item.active{background:#f0edff}
.avatar{box-shadow:none}
.ci-name{font-size:15px;font-weight:680}
.ci-preview{font-size:13px;color:#7a808c}
.ci-time{font-size:11.5px}
.unread{background:var(--brand-grad);box-shadow:0 4px 10px rgba(101,87,232,.18)}
.side-foot{background:#fff;border-top:1px solid #edf0f3}

.chat-pane{position:relative;background-color:#eee8e1}
.chat-pane:before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.32;background-image:radial-gradient(circle at 1px 1px,rgba(106,99,92,.18) 1px,transparent 0);background-size:22px 22px}
.chat-head{height:68px;min-height:68px;padding:9px 16px;z-index:12}
.chat-head-main{border-radius:14px}
.chat-head-main:hover{background:#f5f5f8}
.ch-name{font-size:15.5px;font-weight:700}
.ch-sub{font-size:12px}
.head-actions .icon-btn{background:transparent}
.head-actions .icon-btn:hover{background:#f0eff8}
.messages{position:relative;z-index:1;padding:22px 4.8% 14px;background:transparent!important;background-image:none!important}
.day-sep{border-radius:10px;background:rgba(255,255,255,.88);box-shadow:0 2px 8px rgba(30,25,20,.07);padding:5px 12px}
.msg-row{margin:3px 0}
.bubble{max-width:min(66%,600px);border-radius:15px;padding:8px 11px 7px;box-shadow:0 1px 1px rgba(25,20,16,.09),0 2px 8px rgba(25,20,16,.03)}
.bubble.in{border-top-left-radius:5px}
.bubble.out{border-top-right-radius:5px;background:#dff6d8}
.bubble .text{font-size:14.5px;line-height:1.42}
.composer{position:relative;z-index:12;padding:9px 12px max(9px,env(safe-area-inset-bottom));background:rgba(247,248,250,.95);backdrop-filter:blur(16px);border-top:1px solid #e6e8ed}
.composer textarea{min-height:44px;border:0;background:#fff;border-radius:22px;box-shadow:0 1px 4px rgba(20,20,35,.06);padding:11px 16px}
.composer textarea:focus{box-shadow:0 0 0 3px rgba(101,87,232,.10)}
.composer .send{background:var(--brand-grad);box-shadow:0 8px 18px rgba(101,87,232,.24)}

/* desktop empty state */
.empty-state{position:relative;z-index:1;background:linear-gradient(180deg,rgba(255,255,255,.35),rgba(255,255,255,.1))}
.empty-art{width:92px;height:92px;border-radius:28px;color:#fff;background:var(--brand-grad);display:grid;place-items:center;opacity:1;box-shadow:0 24px 55px rgba(101,87,232,.22)}
.empty-state h3{font-size:22px;letter-spacing:-.03em}
.empty-state p{font-size:13.5px;color:#747985}

/* mobile app shell */
.mobile-content{background:#f7f8fb}
.mobile-head{height:68px;min-height:68px;padding:10px 16px;background:rgba(255,255,255,.95);backdrop-filter:blur(18px);border-bottom:1px solid #eceef2}
.mobile-title{font-size:24px;letter-spacing:-.045em;font-weight:820}
.mobile-actions{gap:3px}
.mobile-actions .icon-btn{background:transparent}
.encrypt-banner,.info-banner{border:1px solid #e7e2ff;background:#f4f1ff;color:#47405f;border-radius:14px}
.section-label{color:#5b4ed1;font-weight:800}
.settings-card{border-radius:18px;border-color:#e9ebef;box-shadow:0 4px 16px rgba(24,25,35,.035)}
.settings-item{min-height:66px}
.fab{width:58px;height:58px;background:var(--brand-grad);box-shadow:0 14px 28px rgba(101,87,232,.3)}
.tab-nav{height:70px;background:rgba(255,255,255,.96);backdrop-filter:blur(18px);border-top:1px solid #e9ebef}
.tab-nav-item{gap:4px;font-size:11px;font-weight:650}
.tab-nav-item.active{color:#5a4bd1}
.tab-nav-item.active:before{display:none}
.tab-nav-item.active .tab-icon{width:44px;height:29px;border-radius:15px;background:#ece9ff}
.tab-nav-item .tab-icon{transition:.18s ease}

/* call UI */
.call-screen,.call-panel{background:
 radial-gradient(500px 420px at 50% 30%,rgba(101,87,232,.18),transparent 64%),
 #0d1016}
.call-avatar{width:128px;height:128px;border:0;background:var(--brand-grad);box-shadow:0 0 0 10px rgba(255,255,255,.04),0 24px 60px rgba(0,0,0,.24)}
.call-btn-circle{background:#242830}
.call-btn-circle.active{background:#fff;color:#14171d}
.call-end-btn{box-shadow:0 12px 30px rgba(239,68,68,.34)}

/* overlays */
.modal-backdrop{background:rgba(16,17,24,.46);backdrop-filter:blur(8px)}
.modal{border-radius:24px;border:1px solid rgba(236,237,242,.9);box-shadow:0 30px 80px rgba(14,14,30,.2)}
.toast{border-radius:999px;padding:11px 18px;box-shadow:0 14px 30px rgba(20,20,30,.16)}
.btn{border-radius:12px}
.btn.primary{background:var(--brand-grad);box-shadow:0 8px 20px rgba(101,87,232,.18)}
.btn.ghost{border-color:#dddfe6;background:#fff;color:#343741}

/* dark mode tuning */
@media (prefers-color-scheme:dark){
 :root{--bg:#0c0f14;--panel:#12161c;--ink:#eef0f4;--ink-soft:#99a1ad;--line:#252b33;--header-bg:rgba(24,29,36,.94);--side-bg:#12161c;--chat-bg:#0f1519;--bubble-in:#20262d;--bubble-out:#174f46;--accent-soft:#27233f}
 .main,.mobile-content{background:#0c0f14}.sidebar,.chat-list,.side-foot,.cat-pills{background:#12161c}.chat-item:hover{background:#171c23}.chat-item.active{background:#25213c}
 .search{background:#1c2229}.chat-pane{background:#0f1519}.chat-pane:before{opacity:.18}.composer{background:rgba(25,30,36,.95)}.composer textarea{background:#20262d}.mobile-head{background:rgba(18,22,28,.96)}
 .tab-nav{background:rgba(18,22,28,.96)}.auth-wrap{background:#0d1015}.auth-card{background:#151920;border-color:#272d36}.auth-card input,.auth-card textarea{background:#10141a;border-color:#2b313a}.auth-card input:focus,.auth-card textarea:focus{background:#12171e}
 .tabs{background:#10141a;border-color:#292e37}.tab.active{background:#222833}.launch-note,.encrypt-banner,.info-banner{background:#211d31;border-color:#342e4e;color:#d7d0f6}.settings-card{background:#151a21;border-color:#282e36}
}

/* responsive */
@media(min-width:769px){
 .mobile-content{display:none!important}
 .main{max-width:1680px;margin:0 auto;border-left:1px solid #e7e9ee;border-right:1px solid #e7e9ee}
}
@media(max-width:768px){
 .main{height:var(--vvh,100dvh);background:#f7f8fb}
 .mobile-content{display:block;flex:1;min-width:0;padding-bottom:70px}
 .chat-pane{display:none;position:fixed;inset:0;z-index:60}
 body.chat-open .chat-pane{display:flex}
 body.chat-open .mobile-content,body.chat-open .tab-nav,body.chat-open .fab{display:none!important}
 .messages{padding:14px 10px 10px}
 .bubble{max-width:82%}
 .back{display:inline-flex}
 .auth-wrap{padding:18px}.auth-card{padding:28px 22px;border-radius:26px}
 .cat-pills{padding:9px 12px;background:transparent}
}
@media(max-width:420px){
 .mobile-title{font-size:22px}.cat-pill{padding:7px 10px}.auth-card{padding:26px 18px}
}
