/* Environment Studio — the creator-facing describe → generate → preview →
   revise → use surface. Built on the existing dashboard tokens and card
   styles; nothing here restyles anything outside this page. */

.env-capability {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #9aa3b2);
  font-size: 0.92rem;
  line-height: 1.5;
}

.env-capability:empty {
  display: none;
}

.env-capability.is-warning {
  border-color: rgba(255, 176, 92, 0.35);
  color: #ffce9a;
}

/* The description is the primary input on the page, so it is given the room
   to look like one rather than a normal form field. */
.env-description {
  min-height: 8.5rem;
  resize: vertical;
  line-height: 1.55;
}

.env-hint {
  margin: -0.25rem 0 0;
  color: var(--text-muted, #9aa3b2);
  font-size: 0.88rem;
  line-height: 1.55;
}

.env-examples {
  margin: 0;
}

.env-examples summary {
  cursor: pointer;
  color: var(--text-muted, #9aa3b2);
  font-size: 0.9rem;
}

.env-example {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.env-example:hover,
.env-example:focus-visible {
  border-style: solid;
  background: rgba(255, 255, 255, 0.05);
}

.env-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.env-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.env-failure {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(226, 86, 76, 0.4);
  background: rgba(226, 86, 76, 0.08);
  color: #ff9c94;
  font-size: 0.92rem;
}

.env-unrecognised {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 191, 107, 0.35);
  background: rgba(255, 191, 107, 0.07);
  color: #ffce9a;
  font-size: 0.92rem;
}

.env-preview {
  margin: 1.25rem 0;
}

.env-preview-mount {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.env-preview-mount canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.env-preview-note {
  margin: 0.6rem 0 0;
  color: var(--text-muted, #9aa3b2);
  font-size: 0.86rem;
}

/* "What we understood" — a definition list, because that is exactly what it
   is: the creator's words on the left, our reading on the right. */
.env-spec {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.93rem;
}

.env-spec dt {
  color: var(--text-muted, #9aa3b2);
}

.env-spec dd {
  margin: 0;
}

.env-revise {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.env-revise-label {
  flex: 1 1 22rem;
  display: block;
}

.env-revisions {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-muted, #9aa3b2);
}

.env-revisions-head {
  font-weight: 600;
  color: inherit;
  margin-bottom: 0.35rem;
}

.env-revisions li + li {
  padding-left: 1rem;
  position: relative;
}

.env-revisions li + li::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: 0.5;
}

.env-detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.env-danger {
  color: #ff9c94;
}

.env-library {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.env-library-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.env-library-open {
  flex: 1 1 auto;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.env-library-open:hover,
.env-library-open:focus-visible {
  text-decoration: underline;
}

.env-library-meta {
  color: var(--text-muted, #9aa3b2);
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .env-spec {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .env-spec dd {
    margin-bottom: 0.6rem;
  }

  .env-detail-actions .btn,
  .env-actions .btn {
    flex: 1 1 100%;
  }
}
