* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #111827;
  --bubble: #ffffff;
  --user: #111827;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 760px;
  height: 100dvh;
  margin: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* HEADER */

.header {
  height: 76px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #111827;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}

.header-info {
  flex: 1;
}

.name {
  font-weight: 800;
  font-size: 16px;
}

.status {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
}

.track-button {
  border: 1px solid var(--border);
  background: white;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
}

/* MESSAGES */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 16px 10px;
}

.message {
  display: flex;
  margin-bottom: 12px;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(82%, 560px);
  padding: 12px 15px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.henry .bubble {
  background: var(--bubble);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.message.user .bubble {
  background: var(--user);
  color: white;
  border-bottom-right-radius: 5px;
}

/* TRACKING */

.tracking-card {
  margin: 8px 16px 10px;
  padding: 15px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.hidden {
  display: none;
}

.tracking-title {
  font-weight: 800;
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tracking-status {
  font-weight: 700;
}

.tracking-location {
  margin-top: 4px;
  color: #374151;
}

.tracking-time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* SUGGESTIONS */

.suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
}

.suggestions button {
  flex: 0 0 auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* INPUT */

.input-area {
  display: flex;
  gap: 9px;
  padding: 10px 14px 14px;
  background: var(--bg);
}

#messageInput {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  outline: none;
  padding: 13px 16px;
}

#messageInput:focus {
  border-color: #9ca3af;
}

#sendButton {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #111827;
  color: white;
  cursor: pointer;
  font-size: 19px;
}

#sendButton:disabled {
  opacity: 0.5;
}

/* MOBILE */

@media (max-width: 600px) {
  .app {
    max-width: none;
  }

  .bubble {
    max-width: 88%;
  }

  .track-button {
    padding: 8px;
    font-size: 13px;
  }
}