:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b10;
  color: #f4f6fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(97, 64, 180, .22), transparent 35rem),
    #090b10;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: .65rem;
  background: #7c5cff;
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: .7rem 1rem;
}

button:hover {
  background: #8e74ff;
}

.shell {
  display: grid;
  grid-template-rows: auto auto minmax(20rem, 1fr) auto auto;
  gap: 1rem;
  margin: 0 auto;
  max-width: 56rem;
  min-height: 100vh;
  padding: 2rem 1rem 1rem;
}

header,
.identity,
.message-heading,
#composer {
  align-items: center;
  display: flex;
  gap: .75rem;
}

header {
  justify-content: space-between;
}

h1 {
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  letter-spacing: -.04em;
  margin: 0;
}

header p,
.privacy {
  color: #999fad;
  margin: .25rem 0 0;
}

.identity {
  background: #151821;
  border: 1px solid #282c38;
  border-radius: .8rem;
  color: #b5bac8;
  padding: .55rem .7rem;
}

.identity input {
  background: transparent;
  border: 0;
  color: #f4f6fb;
  max-width: 10rem;
  outline: none;
}

.identity button {
  background: transparent;
  color: #aaa1ff;
  font-size: 1.15rem;
  padding: .25rem;
}

.spacer {
  flex: 1;
}

.status-dot {
  background: #eab044;
  border-radius: 50%;
  height: .55rem;
  width: .55rem;
}

.status-dot.connected {
  background: #4fd18b;
  box-shadow: 0 0 .8rem rgba(79, 209, 139, .7);
}

#messages {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  list-style: none;
  margin: 0;
  overflow-y: auto;
  padding: 1rem 0;
}

#messages li {
  align-self: flex-start;
  background: #171a23;
  border: 1px solid #282c38;
  border-radius: .85rem;
  max-width: min(85%, 40rem);
  padding: .75rem 1rem;
}

.message-heading {
  color: #b9adff;
  font-size: .83rem;
}

.message-heading time {
  color: #777e8f;
}

#messages p {
  line-height: 1.5;
  margin: .3rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#composer input {
  background: #171a23;
  border: 1px solid #303544;
  border-radius: .75rem;
  color: white;
  flex: 1;
  min-width: 0;
  outline: none;
  padding: .85rem 1rem;
}

#composer input:focus {
  border-color: #7c5cff;
}

.privacy {
  font-size: .8rem;
  text-align: center;
}

.privacy code {
  color: #c2b9ff;
}

.visually-hidden {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

@media (max-width: 38rem) {
  .shell {
    padding-top: 1rem;
  }

  header {
    align-items: flex-start;
  }

  header p {
    font-size: .85rem;
  }

  .identity label {
    display: none;
  }

  #messages li {
    max-width: 95%;
  }
}

