@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root{
  --bg:#070A10;
  --card:#0E1420;
  --muted:#8A97AD;
  --fg:#EAF1FF;
  --line:#1E2A3D;

  --accent:#2F81FF;
  --accent2:#33D6FF;
  --secure:#2DE2A2;
  --ok:#39FF14;

  --btn2:#0F1A2B;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(47,129,255,.22) 0%, rgba(7,10,16,0) 60%),
    radial-gradient(780px 520px at 82% 18%, rgba(51,214,255,.14) 0%, rgba(7,10,16,0) 62%),
    radial-gradient(900px 640px at 50% 92%, rgba(45,226,162,.08) 0%, rgba(7,10,16,0) 60%),
    var(--bg);
  color:var(--fg);
}

body.inChat{overflow:hidden}
body.inChat #appShell{
  transform:none !important;
  translate:0 !important;
  max-width:none !important;
  width:100vw !important;
  height:var(--vvh, 100dvh) !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
}
body.inChat main{padding:0 !important}
.wrap{max-width:820px;margin:0 auto;padding:20px}
.top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.brand{font-weight:600;letter-spacing:.2px}
.status{color:var(--muted);font-size:13px}
.waiting #entrySub{opacity:.72}
.waiting #entrySub{filter:drop-shadow(0 0 8px rgba(0,243,255,.12))}
.card{
  background:rgba(17,21,27,.86);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  margin:12px 0;
  backdrop-filter: blur(10px);
}
h1{font-size:16px;margin:0 0 12px 0;font-weight:600}
.row{display:flex;gap:10px;align-items:center;margin:10px 0}
.lbl{min-width:160px;color:var(--muted);font-size:13px}
.in{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#0d1117;
  color:var(--fg);
  outline:none;
}
.in:focus{border-color:#2b78ff66;box-shadow:0 0 0 3px #2b78ff22}
.actions{display:flex;gap:10px;margin-top:12px}
.btn{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(47,129,255,.45);
  background:linear-gradient(180deg,var(--accent),#1F5FE0);
  color:white;
  cursor:pointer;
  font-weight:600;
}
.btn.invite{
  border-color:rgba(0,243,255,.55);
  background:rgba(0,243,255,1);
  color:#001316;
}
.btn.ghost{background:transparent;border-color:var(--line);color:var(--fg)}
.hint{margin:12px 0 0 0;color:var(--muted);font-size:13px;line-height:1.35}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.k{color:var(--muted);font-size:12px;margin-bottom:6px}
.v{font-weight:700;font-size:18px;letter-spacing:.6px}
.status-ok{background-color:var(--ok) !important}
.chat{
  position:fixed;
  inset:0;
  width:100vw;
  height:var(--vvh, 100dvh);
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  min-height:0;
  z-index:50;
  background:var(--bg);
}
.chatHead{
  position:sticky;
  top:0;
  z-index:60;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  padding:calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  background:rgba(14,20,32,.92);
  border-bottom:1px solid var(--line);
}
.chatHeadInner{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;justify-self:center}
.chatTitle{color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.2px;text-align:center}
.chatStatus{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-wrap:nowrap;white-space:nowrap}
.chatStatus > span{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.chatStatusText{display:inline-block;color:var(--fg);font-size:13px;font-weight:800;letter-spacing:.3px;line-height:1.1;white-space:nowrap;overflow:visible;text-overflow:unset;word-break:normal;vertical-align:middle;text-align:center}
.chatLeave{justify-self:end}

#chatStatusPill > span:first-child{width:10px !important;height:10px !important;margin-right:8px}
#chatStatusDot{width:10px !important;height:10px !important}
.msgs{
  flex:1;
  min-height:0;
  overflow:auto;
  border:0;
  border-radius:0;
  padding:12px;
  padding-bottom:calc(84px + env(safe-area-inset-bottom, 0px));
  background:rgba(13,17,23,.72);
}
.bubble{
  border:0;
  border-radius:0;
  padding:0;
  margin:10px 0;
  display:flex;
  background:transparent;
  width:100%;
}
.bubble.fromMe{justify-content:flex-start}
.bubble.fromPeer{justify-content:flex-end}
.msgWrap{display:flex;flex-direction:column;min-width:0;max-width:90%}
.bubble.fromMe .msgWrap{align-items:flex-start;text-align:left}
.bubble.fromPeer .msgWrap{align-items:flex-start;text-align:left}
.meta{color:var(--muted);font-size:12px;margin-bottom:6px}
.content{display:flex;align-items:center;gap:10px;min-width:0;max-width:100%}
.bubble.fromPeer .content{color:#33D6FF}
.msgText{display:inline;white-space:pre-wrap;word-break:normal;overflow-wrap:break-word;min-width:0;max-width:100%}
.bubble.isText .content{align-items:flex-start}
.content.hasReply{flex-direction:column}
.bubble.isText .content{display:block;width:100%}
.msgInlineActions{display:inline-flex;gap:6px;align-items:baseline;vertical-align:baseline;margin-left:6px;white-space:nowrap}
.replyPreview{font-size:11px;color:rgba(255,255,255,.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bubble.fromPeer .replyPreview{color:rgba(51,214,255,.55)}
.bubble.isText .msgWrap{padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08)}
.bubble.isText.fromPeer .msgWrap{background:rgba(51,214,255,.08);border-color:rgba(51,214,255,.18)}
.bubble.isFile .msgWrap{width:90%;max-width:90%;padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08)}
.bubble.isFile.fromPeer .msgWrap{background:rgba(51,214,255,.08);border-color:rgba(51,214,255,.18)}
.deliveredStyleD .bubble.fromMe .msgWrap{transition:border-color .18s ease, box-shadow .18s ease}
.deliveredStyleD .bubble.fromMe.pending .msgWrap{border-color:rgba(255,255,255,.10)}
.deliveredStyleD .bubble.fromMe.delivered .msgWrap{border-color:rgba(43,120,255,.35)}

.deliveredStyleA .bubble.fromMe .msgWrap{position:relative}
.deliveredStyleA .bubble.fromMe.pending .msgWrap::after{content:none}
.deliveredStyleA .bubble.fromMe.delivered .msgWrap::after{content:none}

.deliveryDot{display:inline-block;width:6px;height:6px;border-radius:999px;margin-left:6px;vertical-align:baseline}
.bubble.fromMe.pending .deliveryDot{background:rgba(255,59,48,.9)}
.bubble.fromMe.delivered .deliveryDot{background:rgba(52,199,89,.9)}
.fileContent{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.fileRow{display:flex;align-items:center;justify-content:center;gap:10px;text-align:center}
.fileTitle{color:var(--muted);font-size:11px;font-weight:600;line-height:1.2}
.media{max-width:100%;border-radius:12px;border:1px solid var(--line)}
img.media{cursor:zoom-in}
.fileActions{display:flex;justify-content:center;gap:10px;margin-top:2px}
.open{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--btn2);
  color:var(--fg);
  cursor:pointer;
  font-weight:600;
  font-size:12px;
}
.prog{margin-top:8px}
.bar{height:8px;border-radius:999px;border:1px solid var(--line);background:#0b1220;overflow:hidden}
.fill{height:100%;width:0%;background:linear-gradient(90deg,#2b78ff,#7c5cff)}
.pct{margin-top:6px;color:var(--muted);font-size:12px}
.msgDel{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:rgba(255,255,255,.65);
  font-size:12px;
  opacity:.85;
  background:transparent;
  border:0;
  padding:0;
  cursor:pointer;
}
.msgDel,.msgReply{flex:0 0 auto}
.msgDel:active{transform:translateY(1px)}
.msgDel .material-symbols-outlined{font-size:18px;line-height:1;vertical-align:baseline}

.msgReply{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:rgba(255,255,255,.65);
  background:transparent;
  border:0;
  padding:0;
  cursor:pointer;
}
.msgActions .msgDel,.msgActions .msgReply{width:34px;height:34px;border-radius:12px}
.msgActions .msgDel:hover,.msgActions .msgReply:hover{background:rgba(255,255,255,.06)}
.msgReply:active{transform:translateY(1px)}
.msgReply .material-symbols-outlined{font-size:18px;line-height:1;vertical-align:baseline}

.msgInlineActions button{vertical-align:baseline}

.bubble.isText .msgDel{vertical-align:middle}
.bubble.isFile .msgDel{vertical-align:middle}
.composer{
  position:sticky;
  bottom:0;
  z-index:60;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:0;
  width:100%;
  padding:10px 12px;
  border-radius:0;
  border-top:1px solid var(--line);
  background:rgba(14,20,32,.92);
}
.replyBar{
  position:relative;
  width:100%;
  order:-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.35);
  border-radius:10px;
  backdrop-filter: blur(8px);
}
.replyText{font-size:11px;color:rgba(255,255,255,.65);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.replyCancel{background:transparent;border:0;color:rgba(255,255,255,.55);cursor:pointer;font-size:16px;line-height:1;padding:0 4px}
.grow{flex:1}
.file{display:none}
.attach{
  width:44px;
  height:44px;
  min-width:44px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--btn2);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:22px;
  color:var(--fg);
  user-select:none;
}
.attach:active{transform:translateY(1px)}
.msgin{
  width:100%;
  padding:0 4px;
  border:0;
  background:transparent;
  color:var(--fg);
  outline:none;
  font-size:15px;
}
.msgin:focus{outline:none;box-shadow:none}
.msgin::placeholder{color:var(--muted)}
.send{
  width:44px;
  height:44px;
  min-width:44px;
  border-radius:999px;
  border:1px solid rgba(0,243,255,.55);
  background:rgba(0,243,255,1);
  color:#001316;
  cursor:pointer;
  font-weight:800;
  font-size:22px;
  line-height:44px;
  text-align:center;
  padding:0;
}
.send:active{transform:translateY(1px)}
.siteFooter{margin-top:12px;text-align:center;font-size:11px;color:var(--muted)}
.siteFooter a{color:var(--muted);text-decoration:none;border-bottom:1px solid transparent}
.siteFooter a:hover{color:var(--fg);border-bottom-color:rgba(0,243,255,.35)}
.siteFooter .sep{opacity:.6;margin:0 8px}
@media (max-width:720px){
  .grid2{grid-template-columns:1fr}
  .lbl{min-width:110px}
  .attach{width:44px}
}
