*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,
  Apple SD Gothic Neo,Malgun Gothic,sans-serif
}
.bg{background:#0b0f14;color:#eaf4ff}

/* =========================
   Topbar (PC / Mobile 동일)
========================= */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  background:#0f1620;
  border-bottom:1px solid #1b2a3a;
  position:sticky;
  top:0;
  z-index:20;
}

.brand{font-weight:700}

.right{
  display:flex;
  gap:10px;
  align-items:center;
}

.user{
  opacity:.85;
  font-size:13px;
  white-space:nowrap;
}

/* ⋮ 메뉴 버튼 */
.menu-btn{
  background:none;
  border:none;
  color:#eaf4ff;
  font-size:22px;
  cursor:pointer;
  padding:4px 6px;
}

/* =========================
   ⋮ 드롭다운 메뉴 (공통)
========================= */
.menu{
  position:fixed;
  top:56px;
  right:14px;
  background:#0f1620;
  border:1px solid #1b2a3a;
  border-radius:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.6);
  min-width:180px;
  z-index:999;
}

.menu.hidden{display:none}

.menu a{
  display:block;
  padding:12px 14px;
  font-size:14px;
  color:#eaf4ff;
  text-decoration:none;
  border-bottom:1px solid #1b2a3a;
}

.menu a:last-child{border-bottom:none}

.menu a:hover{background:#17324a}

.menu hr{
  border:none;
  border-top:1px solid #1b2a3a;
  margin:6px 0;
}

/* =========================
   Chat Layout
========================= */
.wrap{
  max-width:920px;
  margin:0 auto;
  padding:14px;
  padding-bottom:90px; /* 입력창 공간 */
}

.log{
  height:calc(100vh - 170px);
  overflow:auto;
  padding:10px;
  border:1px solid #1b2a3a;
  border-radius:12px;
  background:#0f1620;
}

.bubble{
  white-space:pre-wrap;
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0;
  line-height:1.45;
}

.me{
  background:#17324a;
  margin-left:14%;
  border:1px solid #224a6d;
}

.bot{
  background:#121a24;
  margin-right:14%;
  border:1px solid #1b2a3a;
}

/* =========================
   Composer (하단 고정) ✅ 수정 핵심
========================= */
.composer{
  position:fixed;
  bottom:0;

  left:50%;
  transform:translateX(-50%);

  display:flex;
  gap:8px;
  padding:12px;

  width:100%;
  max-width:920px;

  background:#0f1620;
  border-top:1px solid #1b2a3a;
  z-index:15;
  box-sizing:border-box;
}

.composer input{
  flex:1;
  min-width:0; /* ⭐ PC flex 폭 버그 해결 */
}

.composer button{
  padding:12px 16px;
  border-radius:12px;
  border:1px solid #224a6d;
  background:#17324a;
  color:#eaf4ff;
  cursor:pointer;
  font-size:15px;
}

.hint{
  opacity:.7;
  font-size:12px;
  margin-top:10px;
}

/* =========================
   Login / Card
========================= */
.card{
  max-width:420px;
  margin:70px auto;
  padding:18px;
  border:1px solid #1b2a3a;
  background:#0f1620;
  border-radius:14px;
}

.card h1{margin:0 0 6px 0}
.sub{margin:0 0 14px 0;opacity:.8}

label{
  display:block;
  margin:10px 0 6px 0;
  font-size:13px;
  opacity:.9
}

input{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid #1b2a3a;
  background:#0b0f14;
  color:#eaf4ff;
  outline:none
}

button{
  width:100%;
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  border:1px solid #224a6d;
  background:#17324a;
  color:#eaf4ff;
  cursor:pointer
}

.error{
  background:#3a1b1b;
  border:1px solid #6d2222;
  padding:10px;
  border-radius:12px;
  margin:10px 0
}

/* =========================
   📱 Mobile
========================= */
@media (max-width:640px){

  .wrap{
    padding:10px;
    padding-bottom:90px;
  }

  .log{
    height:calc(100vh - 180px);
  }

  .composer{
    left:0;
    transform:none;
    max-width:none;
  }

  .composer input{
    font-size:16px; /* iOS 확대 방지 */
  }

  .composer button{
    width:64px;
    padding:12px 0;
    font-size:14px;
  }
}


/* =========================
   ✍ textarea 채팅 입력 보정
========================= */
.composer textarea{
  flex:1;
  min-width:0;

  height:44px;
  max-height:140px;

  padding:10px 12px;
  border-radius:12px;
  border:1px solid #1b2a3a;

  background:#0b0f14;
  color:#eaf4ff;

  font-size:15px;
  line-height:1.4;

  resize:none;
  overflow-y:auto;
  box-sizing:border-box;
}


/* =========================
   📩 전송 버튼 사이즈 고정
========================= */
.composer button{
  height:44px;          /* textarea 기본 높이와 동일 */
  min-width:80px;       /* 버튼 폭 안정화 */
  padding:0 18px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:15px;
  line-height:1;
}

/* =========================
   ✍ textarea flex 확장 강제
========================= */
.composer textarea{
  flex:1 1 auto;
  width:100%;            /* ⭐ 이게 핵심 */
  min-width:0;

  height:44px;
  max-height:140px;

  padding:10px 12px;
  border-radius:12px;
  border:1px solid #1b2a3a;

  background:#0b0f14;
  color:#eaf4ff;

  font-size:15px;
  line-height:1.4;

  resize:none;
  overflow-y:auto;
  box-sizing:border-box;

  appearance:none;
  -webkit-appearance:none;
}
