.dreams-header {
  background: var(--blue);
  color: white;
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  border-bottom: 4px solid var(--red-dark);
}

.dreams-header h1 {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 2.4rem;
  margin: 0 0 0.4rem;
}

.dreams-tagline {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
}

.dreams-quote {
  max-width: 34rem;
  margin: 0 auto;
  font-style: italic;
  color: #ffe4e6;
}

.dreams-quote p {
  margin: 0 0 0.3rem;
}
.dreams-quote cite {
  font-style: normal;
  font-weight: 700;
}

.dreams-main {
  width: 92%;
  max-width: 44rem;
  margin: 2rem auto 4rem;
}

.dreams-loading {
  text-align: center;
  color: #555;
}

.dreams-panel {
  background: var(--paper);
  border-radius: 20px;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dreams-panel h2,
.dreams-label {
  display: block;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 1rem;
}

.dreams-text {
  width: 100%;
  min-height: 20rem;
  font: inherit;
  font-size: 1.05rem; /* 16px+ stops iOS Safari zooming in on focus */
  line-height: 1.6;
  padding: 1rem;
  border: 2px solid #8a8f9c; /* 3.4:1 against white, above the 3:1 needed for input borders */
  border-radius: 12px;
  color: var(--ink);
  background: white;
  resize: vertical;
}

.dreams-text:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.dreams-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .dreams-footer-row { gap: 0.6rem; }
  .privacy-note, .save-status, .char-count { font-size: 0.875rem; }
}

/* If a phone is narrower still, the privacy note gives way first so the counter and save status stay readable. */
.privacy-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.privacy-note,
.save-status,
.char-count {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

.char-count.near-limit {
  color: var(--red-dark);
  font-weight: 700;
}
