:root{
  --bg:#05060a;
  --panel:#0b0f17;
  --panel2:#101726;
  --line:rgba(255,255,255,.08);
  --line2:rgba(42,209,255,.20);
  --text:#f5f7ff;
  --muted:#aeb7c8;
  --gold:#d6b34c;
  --gold2:#ffdd77;
  --blue:#1b74e4;
  --blue2:#0f5fd1;
  --neon:#2ad1ff;
  --green:#31c56b;
  --danger:#ff5f72;
  --shadow:0 16px 36px rgba(0,0,0,.32);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;width:100%;min-height:100%}

body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(900px 600px at 12% 10%, rgba(42,209,255,.08), transparent 55%),
    radial-gradient(700px 500px at 85% 18%, rgba(214,179,76,.06), transparent 55%),
    radial-gradient(900px 700px at 50% 90%, rgba(255,221,119,.04), transparent 60%),
    var(--bg);
  color:var(--text);
  overflow-x:hidden;
}

a{
  color:inherit;
  text-decoration:none;
}

img{
  display:block;
  max-width:100%;
}

button,input{
  font-family:inherit;
}

.app{
  width:100%;
  min-height:100vh;
}

/* TOPBAR */
.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  width:100%;
  border-bottom:1px solid var(--line);
  background:rgba(8,10,16,.95);
  backdrop-filter:blur(10px);
}

.topbar-inner{
  max-width:1400px;
  margin:0 auto;
  padding:10px 16px;
  display:grid;
  grid-template-columns:280px 1fr 280px;
  align-items:center;
  gap:16px;
}

.brand-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.brand{
  font-size:18px;
  font-weight:900;
  color:var(--gold2);
  letter-spacing:.5px;
  text-transform:uppercase;
  white-space:nowrap;
  cursor:pointer;
}

.search{
  flex:1;
  min-width:0;
}

.search input{
  width:100%;
  height:44px;
  border:none;
  outline:none;
  border-radius:999px;
  padding:0 16px;
  color:#fff;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
  font-size:15px;
}

.search input:focus{
  border-color:rgba(42,209,255,.5);
  box-shadow:0 0 0 3px rgba(42,209,255,.12);
}

.top-icons{
  display:flex;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
}

.nav-btn{
  width:48px;
  height:48px;
  border:none;
  border-radius:14px;
  color:#fff;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.06);
  cursor:pointer;
  font-size:18px;
  transition:.15s ease;
}

.nav-btn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.11);
}

.nav-btn.active{
  background:rgba(27,116,228,.18);
  box-shadow:inset 0 -3px 0 var(--neon);
}

.top-right{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  align-items:center;
}

.profile-mini{
  width:42px;
  height:42px;
  border-radius:50%;
  overflow:hidden;
  border:2px solid rgba(255,255,255,.08);
  cursor:pointer;
}

.profile-mini img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* MAIN */
.main{
  max-width:1400px;
  margin:0 auto;
  padding:18px 16px 30px;
  display:grid;
  grid-template-columns:290px minmax(0,1fr) 310px;
  gap:18px;
  align-items:start;
}

.card{
  background:rgba(11,15,23,.88);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
}

.pad{
  padding:16px;
}

.left-col,.right-col{
  position:sticky;
  top:78px;
}

/* LEFT */
.menu-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.menu-item{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:48px;
  padding:10px 12px;
  border-radius:14px;
  transition:.15s ease;
  color:#fff;
  cursor:pointer;
}

.menu-item:hover{
  background:rgba(255,255,255,.06);
}

.menu-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.07);
  font-size:18px;
  flex:0 0 38px;
}

.menu-text{
  font-weight:800;
  line-height:1.2;
}

.section-label{
  font-size:15px;
  font-weight:900;
  color:#fff;
  margin:18px 0 10px;
}

.left-footer{
  margin-top:16px;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

.shortcut-tools{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.shortcut-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.shortcut-form input{
  flex:1;
  min-width:140px;
  height:40px;
  border:none;
  outline:none;
  border-radius:12px;
  padding:0 12px;
  color:#fff;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
}

.shortcut-form button{
  height:40px;
  padding:0 14px;
  border:none;
  border-radius:12px;
  background:linear-gradient(180deg,#39c7ff,#168ee8);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.shortcut-list-dynamic{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.shortcut-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 8px;
  border-radius:14px;
  transition:.15s ease;
  background:rgba(255,255,255,.03);
}

.shortcut-row:hover{
  background:rgba(255,255,255,.05);
}

.shortcut-row-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  cursor:pointer;
}

.shortcut-badge{
  width:40px;
  height:40px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.07);
  color:#fff;
  font-size:18px;
  flex:0 0 40px;
}

.shortcut-row-left span{
  color:#fff;
  font-weight:800;
  line-height:1.2;
  word-break:break-word;
}

.remove-shortcut{
  border:none;
  background:rgba(255,95,114,.14);
  color:#ff9cab;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:800;
}

/* CENTER */
.composer{
  margin-bottom:16px;
}

.composer-top{
  display:flex;
  align-items:center;
  gap:12px;
}

.avatar-sm{
  width:42px;
  height:42px;
  border-radius:50%;
  overflow:hidden;
  flex:0 0 42px;
}

.avatar-sm img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.composer-input{
  flex:1;
  min-height:44px;
  display:flex;
  align-items:center;
  padding:0 16px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.85);
  border:1px solid rgba(255,255,255,.08);
  font-size:16px;
  cursor:pointer;
}

.emoji-link-btn{
  min-width:44px;
  height:44px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  font-size:20px;
}

.emoji-link-btn:hover{
  background:rgba(255,255,255,.12);
}

.stories{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:12px;
}

.story{
  position:relative;
  height:190px;
  overflow:hidden;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:#111;
  cursor:pointer;
}

.story img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.story::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,.08));
}

.story-name{
  position:absolute;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:2;
  color:#fff;
  font-weight:900;
  line-height:1.1;
  font-size:15px;
}

.create-story{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:linear-gradient(180deg,#13223b,#0c1220);
}

.create-story .plus{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:44px;
  z-index:2;
  width:44px;
  height:44px;
  border-radius:50%;
  background:linear-gradient(180deg,#1b74e4,#145fc0);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:900;
  color:#fff;
  border:4px solid #101726;
}

.create-story .story-name{
  text-align:center;
}

.feed{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.post{
  overflow:hidden;
}

.post-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px 10px;
}

.post-head-left{
  display:flex;
  gap:12px;
  align-items:flex-start;
  min-width:0;
}

.post-author{
  font-weight:900;
  font-size:18px;
  color:#fff;
  line-height:1.1;
}

.post-meta{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.post-menu{
  width:38px;
  height:38px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,.05);
  color:#fff;
  font-size:22px;
  cursor:pointer;
}

.post-text{
  padding:0 14px 12px;
  color:#fff;
  font-size:16px;
  line-height:1.45;
}

.post-media{
  width:100%;
  background:#111;
  overflow:hidden;
}

.post-media img{
  width:100%;
  height:420px;
  object-fit:cover;
  object-position:center;
  display:block;
}

.reactions{
  padding:10px 14px 0;
  color:#dfe7ff;
  font-size:14px;
  font-weight:700;
  display:flex;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}

.post-actions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  padding:12px 14px 14px;
  border-top:1px solid rgba(255,255,255,.08);
  margin-top:10px;
}

.post-action{
  min-height:42px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.05);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.post-action:hover{
  background:rgba(255,255,255,.1);
}

.post-action.liked{
  background:rgba(27,116,228,.18);
  color:#7fd3ff;
}

/* RIGHT */
.contact-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.contact-title{
  font-size:18px;
  font-weight:900;
  color:#fff;
}

.contact-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.contact-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 8px;
  border-radius:14px;
  transition:.15s ease;
  cursor:pointer;
}

.contact-item:hover{
  background:rgba(255,255,255,.05);
}

.contact-avatar{
  position:relative;
  width:40px;
  height:40px;
  border-radius:50%;
  overflow:hidden;
  flex:0 0 40px;
}

.contact-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.dot-online{
  position:absolute;
  right:1px;
  bottom:1px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#31c56b;
  border:2px solid #0b0f17;
}

/* EMOJI PANEL */
.emoji-panel{
  position:fixed;
  top:0;
  right:-420px;
  width:400px;
  max-width:100%;
  height:100vh;
  background:rgba(8,10,16,.98);
  border-left:1px solid rgba(255,255,255,.08);
  box-shadow:-18px 0 40px rgba(0,0,0,.45);
  z-index:3000;
  transition:right .25s ease;
  display:flex;
  flex-direction:column;
}

.emoji-panel.open{
  right:0;
}

.emoji-panel-header{
  height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
}

.emoji-panel-close{
  width:40px;
  height:40px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  font-size:20px;
}

.emoji-frame{
  flex:1;
  width:100%;
  border:none;
  background:#0b0f17;
}

.emoji-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:2900;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
}

.emoji-backdrop.show{
  opacity:1;
  pointer-events:auto;
}

.jk-toast{
  animation:fadeInToast .18s ease;
}

@keyframes fadeInToast{
  from{
    opacity:0;
    transform:translateX(-50%) translateY(10px);
  }
  to{
    opacity:1;
    transform:translateX(-50%) translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width:1200px){
  .main{
    grid-template-columns:250px minmax(0,1fr) 270px;
  }

  .stories{
    grid-template-columns:repeat(4, minmax(0,1fr));
  }
}

@media (max-width:980px){
  .topbar-inner{
    grid-template-columns:1fr;
    gap:10px;
  }

  .brand-wrap{
    width:100%;
  }

  .top-icons{
    justify-content:flex-start;
  }

  .top-right{
    justify-content:flex-start;
  }

  .main{
    grid-template-columns:1fr;
  }

  .left-col,
  .right-col{
    position:relative;
    top:auto;
  }

  .stories{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }
}

@media (max-width:640px){
  .topbar{
    position:relative;
    top:auto;
  }

  .topbar-inner{
    padding:10px;
  }

  .brand{
    font-size:22px;
  }

  .search input{
    height:42px;
    font-size:14px;
  }

  .nav-btn{
    width:42px;
    height:42px;
    border-radius:12px;
  }

  .main{
    padding:10px;
    gap:12px;
  }

  .pad{
    padding:12px;
  }

  .stories{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:10px;
  }

  .story{
    height:170px;
  }

  .composer-top{
    gap:10px;
  }

  .composer-input{
    min-height:42px;
    font-size:15px;
    padding:0 14px;
  }

  .post-head{
    padding:12px 12px 10px;
  }

  .post-author{
    font-size:16px;
  }

  .post-text{
    padding:0 12px 10px;
    font-size:15px;
  }

  .post-media img{
    height:260px;
  }

  .post-actions{
    grid-template-columns:1fr 1fr 1fr;
    gap:6px;
    padding:10px 12px 12px;
  }

  .post-action{
    min-height:38px;
    font-size:13px;
    padding:0 6px;
  }

  .left-col,
  .right-col{
    display:none;
  }

  .emoji-panel{
    width:100%;
    right:-100%;
  }
}