/* Dream v4: a stable intake grid and a persistent, server-confirmed result dock. */
.dream-preview .xn-dream-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.025em;
  font-size: clamp(1.36rem, 4.5vw, 2.75rem);
  line-height: 1.18;
}

.dream-preview .xn-dream-title-row::after {
  content: "";
  display: block;
  flex: 1 1 3.5rem;
  min-width: 2.1rem;
  height: 1px;
  margin-left: clamp(0.55rem, 2vw, 1rem);
  background: linear-gradient(90deg, rgba(32, 97, 112, 0.42), rgba(32, 97, 112, 0));
}

.dream-preview .dream-preview__form {
  gap: 0.9rem;
}

.dream-preview .dream-preview__form-section {
  overflow: hidden;
  border: 1px solid rgba(26, 80, 93, 0.16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 0.4rem 1.35rem rgba(24, 64, 78, 0.045);
}

.dream-preview .dream-preview__form-section > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: baseline;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(26, 80, 93, 0.1);
  background: linear-gradient(90deg, rgba(229, 242, 241, 0.6), rgba(255, 255, 255, 0.35));
}

.dream-preview .dream-preview__form-section > header > p,
.dream-preview .dream-preview__form-section > header > span {
  margin: 0;
  color: #797665;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.dream-preview .dream-preview__form-section > header h2 {
  margin: 0;
  color: #183b4f;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}

.dream-preview .dream-preview__form-body {
  display: grid;
  gap: 0.9rem;
  padding: 1.05rem 1.1rem 1.15rem;
}

.dream-preview .dream-preview__two-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.dream-preview .dream-preview__detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.dream-preview .dream-preview__field,
.dream-preview .dream-preview__textarea,
.dream-preview .dream-preview__option-grid {
  min-width: 0;
}

.dream-preview .dream-preview__form input,
.dream-preview .dream-preview__form textarea,
.dream-preview .dream-preview__form select {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.8rem;
  border-color: rgba(24, 72, 86, 0.19);
  background: rgba(252, 254, 253, 0.92);
}

.dream-preview .dream-preview__form textarea {
  resize: vertical;
}

.dream-preview .dream-preview__form input:focus,
.dream-preview .dream-preview__form textarea:focus,
.dream-preview .dream-preview__form select:focus {
  outline: 2px solid rgba(46, 133, 145, 0.24);
  outline-offset: 1px;
  border-color: rgba(30, 109, 123, 0.52);
}

.dream-preview .dream-preview__form-section .dream-preview__field > div,
.dream-preview .dream-preview__option-grid > div {
  gap: 0.45rem;
}

.dream-preview .dream-preview__form-section button[type="button"] {
  min-height: 2.25rem;
  border-radius: 0.65rem;
}

.dream-preview .dream-preview__submit-row {
  position: sticky;
  bottom: 0.75rem;
  z-index: 2;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(23, 81, 95, 0.17);
  border-radius: 0.9rem;
  background: rgba(249, 252, 251, 0.94);
  box-shadow: 0 0.65rem 1.7rem rgba(22, 59, 75, 0.12);
  backdrop-filter: blur(10px);
}

.xn-dream-output-dock {
  width: min(100%, 75rem);
  margin: 1.25rem auto 0;
}

.xn-dream-output {
  display: grid;
  gap: 0.8rem;
  box-sizing: border-box;
  padding: clamp(1rem, 3.2vw, 1.6rem);
  border: 1px solid rgba(25, 82, 94, 0.18);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, rgba(252, 254, 253, 0.98), rgba(239, 247, 246, 0.92));
  color: #173c4f;
  box-shadow: 0 0.75rem 2.2rem rgba(23, 67, 79, 0.09);
}

.xn-dream-output--stream {
  border-color: rgba(160, 120, 58, 0.3);
}

.xn-dream-output--failure {
  border-color: rgba(155, 92, 72, 0.32);
  background: rgba(255, 249, 246, 0.94);
}

.xn-dream-output__eyebrow,
.xn-dream-output__status,
.xn-dream-result-card p {
  margin: 0;
}

.xn-dream-output__eyebrow {
  color: #9a743a;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.xn-dream-output__title {
  margin: 0;
  color: #173b4f;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  letter-spacing: 0.025em;
}

.xn-dream-output__status,
.xn-dream-result-card__description,
.xn-dream-result-card__meta {
  color: #5b7180;
  font-family: var(--xn-inner-sans, inherit);
  font-size: 0.9rem;
  line-height: 1.78;
}

.xn-dream-output__stream-body,
.xn-dream-result-list {
  display: grid;
  gap: 0.72rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.xn-dream-output__waiting {
  margin: 0;
  color: #768b94;
  font-size: 0.9rem;
}

.xn-dream-output__stream-card,
.xn-dream-result-card {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(25, 83, 95, 0.12);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.78);
}

.xn-dream-output__stream-title,
.xn-dream-result-card__title {
  margin: 0 0 0.42rem;
  color: #1b5060;
  font-size: 1rem;
}

.xn-dream-output__stream-text {
  margin: 0;
  color: #385b69;
  font-family: var(--xn-inner-sans, inherit);
  font-size: 0.92rem;
  line-height: 1.88;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.xn-dream-result-list > li {
  position: relative;
  padding: 0.12rem 0 0.12rem 1rem;
  color: #385b69;
  font-family: var(--xn-inner-sans, inherit);
  font-size: 0.92rem;
  line-height: 1.78;
}

.xn-dream-result-list > li::before {
  position: absolute;
  top: 0.66rem;
  left: 0.1rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #7fa6a2;
  content: "";
}

.xn-dream-result-list strong {
  display: block;
  color: #1d4d5d;
  font-weight: 700;
}

.xn-dream-result-list p {
  margin: 0.18rem 0 0;
}

.xn-dream-result-list--questions > li,
.xn-dream-result-list--actions > li {
  border-top: 1px solid rgba(25, 83, 95, 0.09);
  padding-top: 0.58rem;
}

@media (max-width: 780px) {
  .dream-preview .dream-preview__hero > div:first-child {
    min-width: 0;
  }

  .dream-preview .xn-dream-title-row {
    font-size: clamp(1.24rem, 6.2vw, 1.7rem);
  }

  .dream-preview .xn-dream-title-row::after {
    min-width: 1.25rem;
  }

  .dream-preview .dream-preview__two-columns,
  .dream-preview .dream-preview__detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dream-preview .dream-preview__submit-row {
    bottom: 0.4rem;
  }
}

@media (max-width: 480px) {
  .dream-preview .dream-preview__form-section > header,
  .dream-preview .dream-preview__form-body {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .dream-preview .dream-preview__form-section > header {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }

  .dream-preview .dream-preview__two-columns,
  .dream-preview .dream-preview__detail-grid {
    grid-template-columns: 1fr;
  }

  .dream-preview .xn-dream-title-row {
    font-size: clamp(1.12rem, 6vw, 1.38rem);
  }

  .dream-preview .xn-dream-title-row::after {
    display: none;
  }

  .xn-dream-output-dock {
    margin-top: 0.9rem;
  }

  .xn-dream-output {
    border-radius: 0.92rem;
  }
}
