.app-phase,
.app-summary,
.uat-readiness,
.generated-files,
.uat-report-panel,
.workflow-history {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.app-summary,
.uat-readiness,
.generated-files-panel,
.uat-report-panel,
.workflow-history {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: linear-gradient(145deg, rgba(16, 34, 58, 0.92), rgba(7, 20, 38, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.app-summary-heading,
.uat-readiness-heading,
.generated-files-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.app-summary-heading h2,
.uat-readiness-heading h2,
.generated-files-heading h2,
.uat-report-heading,
.workflow-history-heading {
  margin-bottom: 0.35rem;
}

.app-summary-heading p,
.uat-readiness-heading p,
.generated-files-heading p,
.uat-report-intro,
.workflow-history-intro {
  margin-bottom: 0;
}

.app-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem;
}

.app-summary-item,
.generated-file-card,
.publication-record,
.workflow-history-record {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: rgba(4, 12, 24, 0.4);
}

.app-summary-item dt,
.publication-label {
  margin-bottom: 0.25rem;
  color: var(--color-text-quiet);
  font-size: 0.8rem;
  font-weight: 700;
}

.app-summary-item dd {
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.generated-file-list,
.publication-list,
.workflow-history-stage ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.generated-file-card h3,
.publication-record h3,
.workflow-history-record h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.generated-file-meta,
.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--color-text-quiet);
  font-size: var(--font-size-small);
}

.generated-file-path,
.publication-target {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.generated-file-preview,
.workflow-history-content pre {
  max-height: 24rem;
  overflow: auto;
  margin-top: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: rgba(4, 12, 24, 0.72);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.uat-readiness {
  border-color: rgba(125, 227, 172, 0.4);
  background: linear-gradient(135deg, rgba(18, 57, 50, 0.58), rgba(7, 20, 38, 0.96));
}

.uat-readiness[data-status="pending"],
.uat-readiness[data-status="in-progress"],
.uat-readiness[data-status="needs_review"] {
  border-color: rgba(240, 198, 116, 0.4);
}

.uat-readiness[data-status="failed"],
.uat-readiness[data-status="needs_attention"] {
  border-color: rgba(240, 138, 138, 0.45);
}

.uat-readiness-note,
.uat-report-help {
  margin: 0;
  color: var(--color-text-quiet);
  font-size: var(--font-size-small);
}

.uat-report-panel {
  border-color: rgba(155, 199, 239, 0.3);
}

.uat-report-form {
  display: grid;
  gap: 0.75rem;
}

.uat-report-label {
  display: grid;
  gap: 0.4rem;
  color: var(--color-text);
}

.uat-report-form textarea {
  width: 100%;
  min-height: 8rem;
  background: rgba(4, 12, 24, 0.72);
}

.uat-report-status:empty {
  display: none;
}

.uat-report-status:not(:empty) {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: rgba(4, 12, 24, 0.4);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.uat-report-form button,
.uat-readiness button {
  justify-self: start;
}

.workflow-history-nav,
.app-phase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.workflow-history-nav button,
.app-phase-actions button,
.app-phase-actions .button {
  min-height: 2.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.86rem;
}

.workflow-history-stage,
.workflow-history-view {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.workflow-history-summary,
.workflow-history-record p {
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.workflow-history-content summary {
  color: var(--color-accent);
  font-weight: 700;
  cursor: pointer;
}

.uat-readiness button:focus-visible,
.uat-report-form button:focus-visible,
.workflow-history-nav button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.app-phase-empty {
  padding: 1.25rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-medium);
  color: var(--color-text-quiet);
  text-align: center;
}

@media (max-width: 680px) {
  .app-summary,
  .uat-readiness,
  .generated-files-panel,
  .uat-report-panel,
  .workflow-history {
    padding: 1rem;
  }

  .app-summary-heading,
  .uat-readiness-heading,
  .generated-files-heading {
    flex-direction: column;
  }

  .workflow-history-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-history-nav button,
  .uat-report-form button,
  .uat-readiness button {
    width: 100%;
  }
}
