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

body {
  background: #0a0a0a;
  color: #d0d0d0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 14px;
  min-height: 100vh;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #222;
  margin-bottom: 24px;
}

.logo {
  font-size: 18px;
  font-weight: bold;
  color: #00ff88;
}

.status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}

.status.connected {
  color: #00ff88;
  border: 1px solid #00ff88;
}

.status.connecting {
  color: #ffaa00;
  border: 1px solid #ffaa00;
}

.status.disconnected {
  color: #ff4444;
  border: 1px solid #ff4444;
}

/* QR Section */
#qr-section {
  text-align: center;
  padding: 40px 0;
}

#qr-section p {
  margin-bottom: 20px;
  color: #888;
}

#qr-img {
  border-radius: 8px;
}

/* Search */
.search-area {
  position: relative;
  margin-bottom: 20px;
}

#search-input,
.text-input {
  width: 100%;
  padding: 10px 16px;
  background: #141414;
  border: 1px solid #333;
  border-radius: 6px;
  color: #d0d0d0;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

#search-input:focus,
.text-input:focus {
  border-color: #00ff88;
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.contact-item {
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid #222;
}

.contact-item:hover {
  background: #252525;
  color: #00ff88;
}

.contact-item:last-child {
  border-bottom: none;
}

/* Compose */
.selected-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #333;
  color: #00ff88;
  font-weight: bold;
}

.clear-btn {
  background: transparent;
  color: #666;
  border: 1px solid #444;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: normal;
}

.clear-btn:hover {
  color: #ff4444;
  border-color: #ff4444;
}

#message-input {
  width: 100%;
  padding: 10px 16px;
  background: #141414;
  border: 1px solid #333;
  border-radius: 6px;
  color: #d0d0d0;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  outline: none;
}

#message-input:focus {
  border-color: #00ff88;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  background: #00ff88;
  color: #0a0a0a;
  font-weight: bold;
}

button:hover {
  background: #00dd77;
}

button.secondary {
  background: transparent;
  color: #888;
  border: 1px solid #444;
}

button.secondary:hover {
  color: #d0d0d0;
  border-color: #666;
}

/* Feedback */
#send-feedback {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
}

#send-feedback.success {
  color: #00ff88;
}

#send-feedback.error {
  color: #ff4444;
}

/* Replies */
#replies-section {
  margin-top: 24px;
  border-top: 1px solid #222;
  padding-top: 16px;
}

.replies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#replies-section h3 {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.message-row {
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.message-row .sender {
  color: #00ff88;
  font-weight: bold;
  white-space: nowrap;
}

.message-row .sender.them {
  color: #88aaff;
}

.message-row .text {
  flex: 1;
  word-break: break-word;
}

.message-row .time {
  color: #555;
  font-size: 12px;
  white-space: nowrap;
}

.no-messages {
  color: #555;
  font-style: italic;
}

/* Utility */
.hidden {
  display: none !important;
}
