:root {
  color-scheme: light;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: #f4f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top right,
      rgba(116, 144, 190, 0.14),
      transparent 34rem
    ),
    #f4f7fb;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding: 0 34px;

  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #dfe5ee;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  width: 180px;
  max-height: 54px;
  object-fit: contain;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.language-switcher {
  display: flex;
  gap: 5px;
}

.language-switcher button {
  border: 0;
  background: transparent;
  color: #667085;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.language-switcher button.active {
  background: #e8edf5;
  color: #172033;
}

.page {
  min-height: calc(100vh - 76px);
}

.login-layout {
  min-height: calc(100vh - 76px);

  display: grid;
  place-items: center;

  padding: 42px 20px;
}

.login-card {
  width: min(470px, 100%);
  padding: 42px;

  background: white;
  border: 1px solid #dfe5ee;
  border-radius: 24px;

  box-shadow:
    0 24px 70px rgba(29, 45, 72, 0.10);
}

.kevin-avatar {
  width: 78px;
  height: 78px;

  margin-bottom: 24px;

  border-radius: 24px;
  overflow: hidden;

  background: #eaf0f8;
}

.kevin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 8px;

  color: #6b7890;
  font-size: 12px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.login-card h1 {
  margin: 0 0 12px;

  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.06;
}

.intro {
  margin: 0 0 30px;
  color: #637086;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;

  border: 1px solid #cfd7e4;
  border-radius: 13px;

  background: white;
  color: #172033;

  outline: none;
}

input {
  height: 50px;
  padding: 0 14px;
}

textarea {
  resize: none;
  min-height: 48px;
  max-height: 160px;

  padding: 13px 15px;

  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: #647b9d;
  box-shadow:
    0 0 0 3px rgba(100, 123, 157, 0.13);
}

.primary-button,
.secondary-button,
.new-conversation,
.send-button {
  border: 0;
  border-radius: 12px;

  font-weight: 750;
}

.primary-button {
  height: 50px;

  margin-top: 5px;

  background: #172033;
  color: white;
}

.secondary-button {
  padding: 10px 14px;

  background: #edf1f6;
  color: #27364f;
}

.text-button {
  border: 0;
  background: transparent;

  padding: 7px;

  color: #61718b;
}

.status {
  min-height: 22px;

  margin: 16px 0 0;

  color: #637086;
  font-size: 14px;
  line-height: 1.5;
}

.portal {
  height: calc(100vh - 76px);
  min-height: 600px;

  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);

  background: white;
}

.conversation-sidebar {
  display: flex;
  flex-direction: column;

  min-width: 0;

  border-right: 1px solid #dfe5ee;

  background: #f8fafc;
}

.contact-identity {
  padding: 24px 22px 18px;

  border-bottom: 1px solid #e3e8ef;
}

.contact-identity strong {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 17px;
}

.contact-identity small {
  display: block;

  margin-top: 5px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: #6d788a;
}

.new-conversation {
  margin: 18px;
  padding: 13px 15px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  background: #172033;
  color: white;
}

.history-heading {
  padding: 0 22px 10px;

  color: #7a8698;
  font-size: 12px;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.conversation-list {
  min-height: 0;
  overflow-y: auto;

  padding: 0 10px 18px;
}

.conversation-row {
  position: relative;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;

  margin-bottom: 4px;

  border-radius: 11px;
}

.conversation-row.active,
.conversation-row:hover {
  background: #e9eef5;
}

.conversation-open {
  min-width: 0;

  border: 0;
  background: transparent;

  padding: 12px 9px 12px 12px;

  text-align: left;
}

.conversation-open strong {
  display: block;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: #28374e;
  font-size: 14px;
}

.conversation-open small {
  display: block;

  margin-top: 4px;

  color: #7c8798;
  font-size: 11px;
}

.conversation-archive {
  width: 36px;

  border: 0;
  background: transparent;

  color: #8792a3;
}

.conversation-empty {
  padding: 18px 12px;
  color: #8490a2;
  font-size: 13px;
}

.chat-shell {
  min-width: 0;
  min-height: 0;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;

  background: white;
}

.chat-header {
  height: 78px;

  display: flex;
  align-items: center;
  gap: 13px;

  padding: 0 25px;

  border-bottom: 1px solid #e1e6ed;
}

.chat-avatar {
  width: 43px;
  height: 43px;

  overflow: hidden;
  border-radius: 14px;

  background: #edf2f8;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header h1 {
  margin: 0;
  font-size: 18px;
}

.chat-header p {
  margin: 3px 0 0;

  color: #7b8698;
  font-size: 12px;
}

.chat-body {
  min-height: 0;
  overflow-y: auto;

  padding: 30px clamp(20px, 6vw, 90px);
}

.welcome {
  width: min(680px, 100%);

  margin: 70px auto 20px;

  text-align: center;
}

.welcome-mark {
  width: 90px;
  height: 90px;

  margin: 0 auto 22px;

  overflow: hidden;
  border-radius: 28px;

  background: #edf2f8;
}

.welcome-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome h2 {
  margin: 0 0 9px;

  font-size: clamp(28px, 4vw, 42px);
}

.welcome p {
  width: min(620px, 100%);

  margin: 0 auto;

  color: #6e7a8d;
  line-height: 1.6;
}

.messages {
  width: min(900px, 100%);
  margin: 0 auto;
}

.message {
  width: fit-content;
  max-width: min(78%, 720px);

  margin: 13px 0;

  padding: 13px 16px;

  border-radius: 17px;

  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-user {
  margin-left: auto;

  border-bottom-right-radius: 5px;

  background: #172033;
  color: white;
}

.message-assistant {
  margin-right: auto;

  border-bottom-left-radius: 5px;

  background: #edf1f6;
  color: #253248;
}

.message-error {
  margin-right: auto;

  background: #fff1f1;
  color: #9d3434;
}

.composer-wrap {
  padding: 17px clamp(20px, 6vw, 90px) 15px;

  border-top: 1px solid #e1e6ed;

  background: rgba(255, 255, 255, 0.97);
}

.composer {
  width: min(900px, 100%);
  margin: 0 auto;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.send-button {
  min-width: 96px;
  height: 48px;

  padding: 0 16px;

  background: #172033;
  color: white;
}

.privacy-note {
  width: min(900px, 100%);

  margin: 8px auto 0;

  color: #9099a8;
  font-size: 11px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  .topbar {
    height: 68px;
    padding: 0 16px;
  }

  .brand img {
    width: 145px;
  }

  .portal {
    height: auto;
    min-height: calc(100vh - 68px);

    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(600px, 1fr);
  }

  .conversation-sidebar {
    max-height: 270px;

    border-right: 0;
    border-bottom: 1px solid #dfe5ee;
  }

  .contact-identity {
    padding: 15px 18px 12px;
  }

  .new-conversation {
    margin: 10px 16px;
  }

  .history-heading {
    padding-left: 18px;
  }

  .conversation-list {
    max-height: 120px;
  }

  .chat-body {
    padding: 22px 16px;
  }

  .composer-wrap {
    padding: 12px 14px;
  }

  .message {
    max-width: 90%;
  }

  .login-card {
    padding: 30px 24px;
  }
}
