/* * { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  color: #111;
}

.wrap { max-width: 1200px; margin: 24px auto; padding: 0 18px; }
h1 { text-align: center; margin: 10px 0 24px; font-size: 44px; }

.status-row{
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid #eee; padding:14px 16px; border-radius:12px;
  margin-bottom: 18px;
}

.status-pill{ display:flex; gap:10px; align-items:center; }
.badge{
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.badge-green{ background:#e9f8ef; color:#0a7b35; }
.badge-red{ background:#fdecec; color:#b42318; }

.grid{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}

.panel{
  border:1px solid #eee;
  border-radius: 14px;
  padding: 16px;
}

.hint{ color:#666; margin-top:4px; margin-bottom:12px; }
.sep{ border:none; border-top:1px solid #eee; margin: 16px 0; }

.qr-box{
  position: relative;
  height: 320px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#fafafa;
}

#qrImg{
  max-width: 300px;
  max-height: 300px;
  display:none;
}

.qr-placeholder{ color:#999; }

.input{
  width:100%;
  padding: 12px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 14px;
}

.btn{
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled{ opacity:.5; cursor:not-allowed; }

.btn-outline{
  background: #fff;
  border-color: #ddd;
  color:#111;
}

.btn-danger{
  background:#fff;
  border-color:#ffb4b4;
  color:#c1121f;
}

.mt{ margin-top: 18px; }

.saved-list{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.saved-item{
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.saved-item:hover{ background:#fafafa; }
.saved-item.active{ border-color:#111; background:#f6f6f6; }

.saved-left{ display:flex; flex-direction:column; gap: 2px; }
.saved-name{ font-weight: 800; }
.saved-phone{ font-size: 12px; color:#777; }
.saved-last{ font-size: 12px; color:#666; margin-top:4px; }
.unread{
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background:#111;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 800;
}

.chat-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.chat-title{ font-size: 24px; font-weight: 900; }
.chat-sub{ font-size: 13px; }
.chat-actions{ display:flex; gap: 10px; }

.chat-box{
  height: 520px;
  background: #0b0f14;
  border-radius: 14px;
  padding: 14px;
  overflow-y:auto;
  border: 1px solid #111;
}

.muted{ color:#8b8b8b; }

.bubble-row{ display:flex; margin: 8px 0; }
.bubble{
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.in{
  background:#1b2430;
  color:#fff;
  border-top-left-radius: 6px;
}
.bubble.out{
  background:#2f78ff;
  color:#fff;
  border-top-right-radius: 6px;
}
.bubble-row.in{ justify-content:flex-start; }
.bubble-row.out{ justify-content:flex-end; }

.bubble-time{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

.composer{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}

.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background:#111;
  color:#fff;
  padding: 10px 12px;
  border-radius: 12px;
  display:none;
  font-weight: 700;
} */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  color: #111;
}

.wrap { max-width: 1200px; margin: 24px auto; padding: 0 18px; }
h1 { text-align: center; margin: 10px 0 24px; font-size: 44px; }

/* Device Selection Section */
.device-section {
  border: 2px solid #4a90e2;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 18px;
  background: #f8fbff;
}

.device-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #333;
}

.device-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.device-input-row .input {
  flex: 1;
  margin-top: 0;
}

.device-input-row .btn {
  margin-top: 0;
  white-space: nowrap;
}

.current-device {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.current-device .device-id {
  font-weight: 700;
  color: #4a90e2;
}

.status-row{
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid #eee; padding:14px 16px; border-radius:12px;
  margin-bottom: 18px;
}

.status-pill{ display:flex; gap:10px; align-items:center; }
.badge{
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.badge-green{ background:#e9f8ef; color:#0a7b35; }
.badge-red{ background:#fdecec; color:#b42318; }
.badge-yellow{ background:#fff4e6; color:#f59e0b; }

.grid{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}

.panel{
  border:1px solid #eee;
  border-radius: 14px;
  padding: 16px;
}

.hint{ color:#666; margin-top:4px; margin-bottom:12px; }
.sep{ border:none; border-top:1px solid #eee; margin: 16px 0; }

.qr-box{
  position: relative;
  height: 320px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#fafafa;
}

#qrImg{
  max-width: 300px;
  max-height: 300px;
  display:none;
}

.qr-placeholder{ color:#999; }

.input{
  width:100%;
  padding: 12px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 14px;
}

.btn{
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled{ opacity:.5; cursor:not-allowed; }

.btn-outline{
  background: #fff;
  border-color: #ddd;
  color:#111;
}

.btn-danger{
  background:#fff;
  border-color:#ffb4b4;
  color:#c1121f;
}

.mt{ margin-top: 18px; }

.saved-list{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.saved-item{
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.saved-item:hover{ background:#fafafa; }
.saved-item.active{ border-color:#111; background:#f6f6f6; }

.saved-left{ display:flex; flex-direction:column; gap: 2px; }
.saved-name{ font-weight: 800; }
.saved-phone{ font-size: 12px; color:#777; }
.saved-last{ font-size: 12px; color:#666; margin-top:4px; }
.unread{
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background:#111;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 800;
}

.chat-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.chat-title{ font-size: 24px; font-weight: 900; }
.chat-sub{ font-size: 13px; }
.chat-actions{ display:flex; gap: 10px; }

.chat-box{
  height: 520px;
  background: #0b0f14;
  border-radius: 14px;
  padding: 14px;
  overflow-y:auto;
  border: 1px solid #111;
}

.muted{ color:#8b8b8b; }

.bubble-row{ display:flex; margin: 8px 0; }
.bubble{
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.in{
  background:#1b2430;
  color:#fff;
  border-top-left-radius: 6px;
}
.bubble.out{
  background:#2f78ff;
  color:#fff;
  border-top-right-radius: 6px;
}
.bubble-row.in{ justify-content:flex-start; }
.bubble-row.out{ justify-content:flex-end; }

.bubble-time{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

.composer{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}

.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background:#111;
  color:#fff;
  padding: 10px 12px;
  border-radius: 12px;
  display:none;
  font-weight: 700;
  z-index: 9999;
}