:root {
  --color-primary: #14324a;
  --color-sand: #f5f0e8;
  --color-white: #ffffff;
  --color-accent: #2d7faa;
  --color-text: #25384a;
  --color-muted: #6f7f8c;
  --color-border: #d9e0e5;
  --shadow-soft: 0 18px 48px rgba(20, 50, 74, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background:
    linear-gradient(180deg, rgba(238, 246, 249, 0.93) 0%, rgba(245, 240, 232, 0.97) 100%),
    radial-gradient(circle at 20% 0%, rgba(45, 127, 170, 0.13), transparent 30%);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 32px));
  margin: 16px auto;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid rgba(20, 50, 74, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-soft), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 34px;
  color: var(--color-white);
  background: var(--color-primary);
}

.chat-header h1 {
  margin: 3px 0 4px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.chat-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.chat-kicker {
  font-size: 13px;
  text-transform: uppercase;
}

.chat-status {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 13px;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 28px 34px;
  background: var(--color-sand);
}

.chat-bubble {
  max-width: min(72%, 680px);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  animation: bubble-in 160ms ease-out;
  white-space: pre-wrap;
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 20px rgba(20, 50, 74, 0.07);
}

.chat-bubble--user {
  align-self: flex-end;
  color: var(--color-white);
  background: var(--color-accent);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 34px;
  background: #fbfaf8;
  border-top: 1px solid var(--color-border);
}

.suggestions[hidden] {
  display: none;
}

.suggestions button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--color-primary);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.suggestions button:hover {
  border-color: var(--color-accent);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 34px 22px;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}

.chat-form textarea {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  padding: 13px 14px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
}

.chat-form textarea:focus {
  border-color: var(--color-accent);
  outline: 3px solid rgba(45, 127, 170, 0.16);
}

.chat-form button {
  min-width: 86px;
  min-height: 48px;
  color: var(--color-white);
  background: var(--color-primary);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.chat-form button:disabled,
.chat-form textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}

.chat-form button:not(:disabled):hover {
  background: #214864;
}

.chat-notice {
  align-self: center;
  padding: 7px 11px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
}

.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.typing span {
  width: 7px;
  height: 7px;
  background: var(--color-muted);
  border-radius: 50%;
  animation: typing 900ms infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 120ms;
}

.typing span:nth-child(3) {
  animation-delay: 240ms;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 720px) {
  .chat-shell {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .chat-header,
  .chat-messages,
  .suggestions,
  .chat-form {
    padding-right: 18px;
    padding-left: 18px;
  }

  .chat-header h1 {
    font-size: 31px;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
