:root {
  --blue-deep: #0d2d7a;
  --blue-primary: #1b4fd1;
  --blue-bb: #6fb7ff;
  --blue-soft: #eaf4ff;
  --ink: #143058;
  --line: #cfe1f8;
  --surface: #ffffff;
  --surface-alt: #f7fbff;
  --user: #e8f3ff;
  --bot: #f2f8ff;
  --shadow: 0 22px 56px rgba(16, 43, 110, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, #8fc6ff 0%, transparent 34%),
    radial-gradient(circle at 86% 88%, #c8e3ff 0%, transparent 34%),
    linear-gradient(160deg, #edf6ff 0%, #dceeff 100%);
  display: flex;
  justify-content: center;
  padding: 18px;
}

.app-shell {
  width: min(960px, 100%);
  height: min(93vh, 920px);
  background: linear-gradient(180deg, #fdfefe 0%, var(--surface-alt) 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, #f7fbff 0%, #eef5ff 100%);
}

.brand-logo {
  width: 90px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #9dc2ef;
  box-shadow: 0 6px 16px rgba(19, 56, 129, 0.18);
  padding: 2px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: .2px;
}

.brand-copy p {
  margin: 2px 0 0;
  color: #42638f;
  font-size: .89rem;
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.msg {
  max-width: min(82%, 760px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  line-height: 1.43;
  white-space: pre-wrap;
  box-shadow: 0 8px 24px rgba(19, 56, 129, 0.08);
  animation: slideIn .2s ease;
}

.msg.user {
  align-self: flex-end;
  background: var(--user);
  border-color: #b9d4f3;
}

.msg.bot {
  align-self: flex-start;
  background: var(--bot);
  border-color: #c9dbf4;
}

.msg.bot a {
  color: #0d2d7a;
  font-weight: 700;
  text-decoration: underline;
  word-break: break-all;
}

.composer {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  background: var(--surface);
}

.composer textarea {
  width: 100%;
  min-height: 48px;
  max-height: 140px;
  resize: none;
  border: 1px solid #bdd6f4;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  outline: none;
  background: #fcfeff;
  color: var(--ink);
}

.composer textarea:focus {
  border-color: #6aaef7;
  box-shadow: 0 0 0 3px rgba(69, 151, 244, 0.22);
}

.composer button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-deep));
  cursor: pointer;
}

.composer button:hover { filter: brightness(1.02); }
.composer button:disabled { opacity: .6; cursor: not-allowed; }

.status {
  min-height: 18px;
  font-size: .84rem;
  color: #3b5f8f;
  padding: 0 14px 12px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  body { padding: 0; }
  .app-shell {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }
  .msg { max-width: 90%; }
}
