.dashboard-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: 76px;
  background: var(--night-bg);
  color: #ececf1;
}

.dreams-workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  min-width: 0;
  min-height: calc(100vh - 76px);
  overflow: hidden;
  background: var(--night-bg);
  padding: 28px 24px 76px;
}

.dreams-workspace > :not(.night-sky) {
  position: relative;
  z-index: 1;
}

.workspace-heading {
  width: min(820px, 100%);
  justify-self: center;
  text-align: center;
}

.workspace-kicker {
  margin: 0 0 8px;
  color: #b4b4b4;
  font-weight: 800;
}

.workspace-heading h1 {
  margin: 0;
  color: #f5f5f5;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.workspace-heading .disclaimer {
  margin: 12px auto 0;
  color: #a8a8a8;
}

.dream-chat {
  display: flex;
  width: min(860px, 100%);
  flex-direction: column;
  gap: 18px;
  justify-self: center;
  overflow-y: auto;
  padding: 16px 2px 28px;
  scrollbar-color: #555 var(--night-bg);
}

.chat-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #b4b4b4;
  font-weight: 700;
  text-align: center;
}

.chat-message {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  border-radius: 18px;
  padding: 16px 18px;
}

.chat-message p {
  margin: 0;
  color: #f5f5f5;
  white-space: pre-wrap;
}

.chat-message__label {
  color: #b4b4b4;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-message--user {
  align-self: flex-end;
  width: fit-content;
  max-width: min(620px, 88%);
  background: #2f2f2f;
}

.chat-message--ai {
  align-self: flex-start;
  background: transparent;
  border: 1px solid #333;
}

.chat-message--loading p {
  color: #c6c6c6;
}

.dreams-workspace .dream-entry {
  position: sticky;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: min(860px, 100%);
  justify-self: center;
  border: 1px solid #424242;
  border-radius: 24px;
  background: #2f2f2f;
  padding: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.dreams-workspace .dream-entry textarea {
  min-height: 52px;
  max-height: 180px;
  border: 0;
  background: transparent;
  color: #f5f5f5;
  padding: 12px 14px;
  box-shadow: none;
}

.dreams-workspace .dream-entry textarea::placeholder {
  color: #b4b4b4;
}

.dreams-workspace .dream-entry .button {
  align-self: end;
  min-width: 74px;
  border-radius: 18px;
  background: #f5f5f5;
  color: #111;
}

.dreams-workspace .dream-entry .button:hover {
  background: #d7d7d7;
}

.terms-fixed {
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: #c6c6c6;
}

.settings-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  padding: 96px 24px 48px;
}

.settings-panel {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(248, 245, 237, 0.96);
  box-shadow: var(--shadow);
  padding: 44px;
}

.settings-panel h1 {
  margin: 0 0 28px;
  text-align: center;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.settings-form label {
  font-weight: 900;
}

.settings-form input {
  height: 48px;
  padding: 0 14px;
}

.inline-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
}

.inline-control input {
  border-radius: var(--radius) 0 0 var(--radius);
}

.inline-control .button {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.danger-button {
  width: 100%;
  min-height: 54px;
  margin-top: 34px;
  border: 1px solid rgba(180, 59, 70, 0.35);
  border-radius: var(--radius);
  background: #fff2f3;
  color: var(--danger);
  font-size: 1.25rem;
  font-weight: 900;
}

@media (max-width: 820px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dreams-workspace {
    min-height: auto;
    padding: 28px 14px 78px;
  }

  .workspace-heading {
    text-align: left;
  }

  .chat-message--user {
    max-width: 96%;
  }

  .dreams-workspace .dream-entry {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .terms-fixed {
    left: 16px;
    right: auto;
  }
}
