* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  font-weight: 500;
  background: #eef2f7;
  color: #1a1a2e;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
}

.app-header {
  position: relative;
  padding: 22px 24px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  overflow: hidden;
}

.app-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("ocean-pattern.svg");
  background-size: auto 100%;
  background-position: right center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.app-header.staff-mode {
  background: linear-gradient(135deg, #c2410c, #f97316);
}

.app-header.staff-mode::after {
  display: none;
}

.app-header h1,
.app-header .mode-badge {
  position: relative;
  z-index: 1;
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  display: inline-block;
}

.mode-badge {
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
}

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

.message-body {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  min-width: 0;
}

.message.user .message-body {
  align-items: flex-end;
}

.bubble {
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.65;
  font-size: 15px;
  font-weight: 700;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.bot .bubble {
  background: #f0f2f6;
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sources {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

#chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

#chat-input:focus {
  border-color: #2563eb;
}

.chat-form button {
  padding: 10px 22px;
  border: none;
  border-radius: 20px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.chat-form button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.typing {
  color: #9ca3af;
  font-style: italic;
}
