* {
  box-sizing: border-box;
}

:root {
  --background: #080808;
  --text: #f5f5f5;
  --muted: #a0a0a0;
  --border: rgba(255, 255, 255, 0.18);
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.background-glow {
  position: fixed;
  z-index: 0;
  width: 72vw;
  height: 72vw;
  max-width: 900px;
  max-height: 900px;
  top: 3vh;
  right: -18vw;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.075) 0%,
      rgba(255, 255, 255, 0.035) 34%,
      rgba(255, 255, 255, 0) 72%
    );
  filter: blur(22px);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 0;
}

.brand {
  flex: 0 0 auto;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 5px 0 22px;
}

.chat {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 20px 0 125px;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat::-webkit-scrollbar {
  display: none;
}

.message-row {
  display: flex;
  width: 100%;
  margin: 0 0 18px;
}

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

.message {
  max-width: min(78%, 650px);
  line-height: 1.55;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-row.user .message {
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
}

.message-row.ai {
  justify-content: flex-start;
}

.message-row.ai .message {
  padding: 2px 0;
  color: var(--text);
}

.composer {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(850px, calc(100% - 32px));
  display: flex;
  gap: 9px;
  padding: 0;
}

input,
button {
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(8, 8, 8, 0.94);
  color: var(--text);
  font: inherit;
  outline: none;
}

input {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus,
button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.055);
}

button {
  padding: 0 20px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .app {
    padding: 18px 18px 0;
  }

  .brand {
    font-size: 14px;
    letter-spacing: 0.2em;
    padding-bottom: 18px;
  }

  .chat {
    padding-top: 14px;
    padding-bottom: 115px;
  }

  .message {
    max-width: 84%;
    font-size: 16px;
  }

  .composer {
    width: calc(100% - 28px);
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  input,
  button {
    height: 48px;
  }

  button {
    padding: 0 16px;
  }
}
