:root {
  --bg-color: #f2f2f7;
  --bubble-sent: #007aff;
  --bubble-sent-text: #fff;
  --bubble-received: #e5e5ea;
  --bubble-received-text: #000;
  --phone-width: 393px;
  --phone-height: 852px;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

/* Controls (Not part of screenshot) */
.controls {
  margin-bottom: 20px;
  text-align: center;
  color: #fff;
}

button {
  background: #007aff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

button:hover {
  background: #0056b3;
}

/* Phone Frame */
.phone-frame {
  width: var(--phone-width);
  height: var(--phone-height);
  background: #000;
  border-radius: 50px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #333,
    0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

/* Screen Content */
.screen {
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  border-radius: 38px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Status Bar */
.status-bar {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #000;
  background: var(--bg-color);
  z-index: 10;
}

.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 30px;
  background: #000;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 20;
}

/* Chat Header */
.chat-header {
  height: 60px;
  background: rgba(242, 242, 247, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 0 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.back-arrow {
  color: #007aff;
  font-size: 24px;
  margin-right: 5px;
}

.contact-name {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
}

.contact-info {
  width: 40px;
}

/* Chat Area */
.chat-area {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none; /* Firefox */
}

.chat-area::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Message Bubbles */
.message-row {
  display: flex;
  width: 100%;
}

.message-row.me {
  justify-content: flex-end;
}

.message-row.them {
  justify-content: flex-start;
}

.message {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* Sent Message Styles */
.message.me {
  background: var(--bubble-sent);
  color: var(--bubble-sent-text);
  border-bottom-right-radius: 6px;
}

.message.me::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--bubble-sent);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

/* Received Message Styles */
.message.them {
  background: var(--bubble-received);
  color: var(--bubble-received-text);
  border-bottom-left-radius: 6px;
}

.message.them::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 12px;
  height: 12px;
  background: var(--bubble-received);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.message-text {
  display: block;
}

.message-meta {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.7;
  text-align: right;
}

/* Input Bar (Fake) */
.input-bar {
  height: 60px;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 10px;
}

.input-field {
  flex: 1;
  height: 32px;
  background: #f0f0f0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: #888;
  font-size: 14px;
}

.send-icon {
  color: #007aff;
  font-size: 20px;
}
#messagesEditor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.message-item {
  display: grid;
  grid-template-columns: 90px 1fr 90px 70px;
  gap: 8px;
  align-items: center;
  background: #2a2a2a;
  padding: 10px;
  border-radius: 10px;
}

.message-item select,
.message-item input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #444;
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.message-item button {
  background: #ff3b30;
  padding: 8px 10px;
  font-size: 14px;
}

.message-item button:hover {
  background: #d93229;
}

.controls label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  text-align: left;
  font-size: 14px;
  color: #ddd;
}

.controls input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #444;
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 8px;
}
a {
  color: white;
}
