* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0f0f10;
  color: #e8e8ea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #1f1f22;
  background: #0f0f10;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 17px;
}

.iconbtn {
  background: transparent;
  border: 1px solid #2a2a2e;
  color: #cfcfd2;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iconbtn:hover { background: #1a1a1d; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.empty-state {
  margin: auto;
  text-align: center;
  opacity: 0.7;
}
.empty-state h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}
.empty-state p { font-size: 16px; }

.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: #2a72e8;
  color: white;
  border-bottom-right-radius: 4px;
}
.msg.assistant {
  align-self: flex-start;
  background: #1a1a1d;
  color: #e8e8ea;
  border: 1px solid #232327;
  border-bottom-left-radius: 4px;
}
.msg.thinking {
  opacity: 0.6;
  font-style: italic;
}

.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(15,15,16,0) 0%, #0f0f10 30%);
  padding: 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.composer > * {
  font-family: inherit;
  font-size: 16px;
}

.input {
  flex: 1;
  max-width: 760px;
  resize: none;
  background: #1a1a1d;
  border: 1px solid #2a2a2e;
  color: #e8e8ea;
  border-radius: 18px;
  padding: 14px 18px;
  outline: none;
  max-height: 200px;
}
.input:focus { border-color: #2a72e8; }

.sendbtn {
  background: #2a72e8;
  color: white;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
}
.sendbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.sendbtn:hover:not(:disabled) { background: #1f5cc7; }

@media (max-width: 600px) {
  .messages { padding: 16px 12px 100px; }
  .composer { padding: 12px; }
}
