.tool-overlay-dream_analysis .tool-panel {
  width: min(720px, 100%);
  max-height: min(94dvh, 900px);
  background: #050505;
  color: #ececec;
  border: 1px solid #222;
}

.tool-overlay-dream_analysis .tool-panel-header,
.tool-overlay-dream_analysis .tool-panel-header h2,
.tool-overlay-dream_analysis .tool-panel-header p,
.tool-overlay-dream_analysis .tool-panel-header small {
  color: #f2f2f2;
}

.tool-overlay-dream_analysis .tool-panel-header {
  border-bottom: 1px solid #1c1c1c;
  background: #0a0a0a;
}

.tool-overlay-dream_analysis .plain-icon,
.tool-overlay-dream_analysis .button.ghost {
  color: #ddd;
}

.dream-app {
  display: grid;
  min-height: min(70dvh, 640px);
}

.dream-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: min(70dvh, 640px);
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.dream-scroll {
  overflow: auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dream-empty {
  margin: 24px auto;
  color: #8a8a8a;
  text-align: center;
}

.dream-bubble {
  max-width: min(85%, 460px);
  padding: 12px 14px;
  border-radius: 16px;
  background: #2a2a2a;
  color: #f0f0f0;
  line-height: 1.45;
}

.dream-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.dream-bubble-left {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.dream-bubble-right {
  align-self: flex-end;
  background: #3a3a3a;
  border-bottom-right-radius: 6px;
}

.dream-typing {
  opacity: 0.75;
  font-style: italic;
}

.dream-status-error {
  margin: 0;
  padding: 8px 14px 0;
  color: #ffb4b4;
  font-size: 13px;
  line-height: 1.4;
}

.dream-composer {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid #1a1a1a;
  background: #0b0b0b;
}

.dream-composer-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.dream-composer textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid #333;
  border-radius: 14px;
  background: #171717;
  color: #f3f3f3;
  padding: 12px 14px;
  font: inherit;
}

.dream-composer textarea::placeholder {
  color: #7d7d7d;
}

.dream-composer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tool-overlay-dream_analysis .dream-composer .button.soft {
  background: #222;
  color: #eee;
  border-color: #333;
}

.tool-overlay-dream_analysis .dream-composer .button.primary {
  background: #4d4d4d;
  border-color: #4d4d4d;
  color: #fff;
}

.dream-final-card {
  color: #ececec;
  display: grid;
  gap: 12px;
  padding: 8px 4px 16px;
}

.dream-final-image {
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  min-height: 180px;
}

.dream-final-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.dream-final-image-pending {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #9a9a9a;
  font-style: italic;
}

.dream-long-meaning p {
  white-space: pre-wrap;
  line-height: 1.5;
}

.dream-final-card h3,
.dream-final-card h4 {
  margin: 0;
  color: #fff;
}

.dream-final-card p,
.dream-final-card li {
  color: #d6d6d6;
}

.dream-final-card ul {
  margin: 0;
  padding-left: 18px;
}

.dream-complete {
  background: #050505;
  border-radius: 16px;
  padding: 12px;
}

@media (max-width: 640px) {
  .tool-overlay-dream_analysis .tool-panel {
    width: 100%;
    max-height: 96dvh;
  }

  .dream-app,
  .dream-stage {
    min-height: min(78dvh, 720px);
  }
}
