* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vw;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #fdfbfb 0%, #e9f3ff 40%, #ffe9f3 100%);
  background-attachment: fixed;
}

.chat-window {
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.1), 0 6px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 28px;
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.chat-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c2f36;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.lang-switch a,
.lang-switch span {
  color: #6b7280;
}

.lang-switch a {
  opacity: 0.6;
}

.lang-switch a:hover {
  opacity: 1;
}

.lang-switch .active {
  color: #2c2f36;
}

.lang-switch .lang-divider {
  color: #6b7280;
  opacity: 0.4;
}

.chat-body {
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.bubble {
  max-width: 75%;
  padding: 22px 30px;
  border-radius: 26px;
  font-size: 1.8rem;
  line-height: 1.4;
  word-wrap: break-word;
  cursor: pointer;
}

.bubble.incoming {
  align-self: flex-start;
  background: #eef1f5;
  color: #2c2f36;
  border-bottom-left-radius: 4px;
  text-decoration: none;
}

.bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, #6a8dff, #8f6bff);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.bubble.outgoing:nth-child(6n+3) { background: linear-gradient(135deg, #0ba360, #3cba92); }
.bubble.outgoing:nth-child(6n+4) { background: linear-gradient(135deg, #f857a6, #ff5858); }
.bubble.outgoing:nth-child(6n+5) { background: linear-gradient(135deg, #a770ef, #f6489a); }
.bubble.outgoing:nth-child(6n) { background: linear-gradient(135deg, #f2994a, #cc4e5c); }
.bubble.outgoing:nth-child(6n+1) { background: linear-gradient(135deg, #4e54c8, #47c9ff); }

a {
  text-decoration: none;
}

.bubble-title {
  display: block;
  font-weight: 600;
}

.bubble.outgoing .bubble-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.bubble-desc {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .chat-body {
    padding: 32px 20px;
  }

  .bubble {
    max-width: 85%;
    padding: 16px 20px;
    font-size: 1.3rem;
  }

  .bubble-desc {
    font-size: 0.85rem;
  }
}
