* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: Arial, Helvetica, sans-serif; }
body { background: #0b141a; color: #e9edef; }
button, textarea, input { font: inherit; }
.hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(390px, 100%);
  background: #111b21;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: #8696a0; }
.login-card input {
  width: 100%;
  margin: 7px 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #2a3942;
  background: #202c33;
  color: #e9edef;
}
.login-card button {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: #00a884;
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.error { margin-top: 10px; color: #ff7b72; min-height: 20px; }

.inbox { height: 100vh; display: grid; grid-template-columns: 330px 1fr; }
.sidebar { background: #111b21; border-right: 1px solid #2a3942; min-width: 0; }
.sidebar-header, .chat-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #202c33;
}
.small-button, .secondary-button {
  border: 0;
  border-radius: 7px;
  background: #2a3942;
  color: #e9edef;
  padding: 7px 10px;
  cursor: pointer;
}
.contact-list { height: calc(100vh - 60px); overflow-y: auto; }
.contact {
  padding: 12px 14px;
  border-bottom: 1px solid #202c33;
  cursor: pointer;
}
.contact:hover, .contact.active { background: #202c33; }
.contact-name { font-weight: 700; }
.contact-id, .contact-last { margin-top: 4px; font-size: 12px; color: #8696a0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat { min-width: 0; display: grid; grid-template-rows: 60px 1fr auto; }
.messages {
  overflow-y: auto;
  padding: 18px;
  background: #0b141a;
}
.empty { color: #8696a0; text-align: center; margin-top: 40px; }
.message {
  max-width: min(680px, 82%);
  margin: 8px 0;
  padding: 9px 11px;
  border-radius: 9px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,.18);
}
.message.in { background: #202c33; margin-right: auto; }
.message.out { background: #005c4b; margin-left: auto; }
.original { white-space: pre-wrap; }
.translation {
  white-space: pre-wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.translation-label { font-size: 11px; font-weight: 700; color: #7cd7c2; margin-bottom: 2px; }
.message-meta { margin-top: 5px; font-size: 10px; color: #8696a0; text-align: right; }
.translation-error { color: #ff7b72; font-size: 11px; margin-top: 5px; }

.composer {
  background: #202c33;
  padding: 12px 14px;
  border-top: 1px solid #2a3942;
}
.composer label { display: block; font-size: 12px; color: #8696a0; margin-bottom: 5px; }
.composer textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid #2a3942;
  border-radius: 8px;
  background: #2a3942;
  color: #e9edef;
  outline: none;
}
.composer-actions { display: flex; gap: 8px; margin-top: 8px; }
.composer-actions button {
  border: 0;
  border-radius: 7px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 700;
}
#translateButton, .send-button { background: #00a884; color: white; }
.preview {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #394952;
}
.preview small { display: block; color: #8696a0; margin-top: 7px; }
.status { min-height: 20px; margin-top: 7px; font-size: 12px; color: #8696a0; }
.setup-warning { max-width: 760px; margin: 60px auto; padding: 20px; }

@media (max-width: 800px) {
  .inbox { grid-template-columns: 240px 1fr; }
}
