@layer features {

.plans-detail-phase {
  margin-top: 8px;
}

.plans-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.plans-back-btn {
  padding: 8px 12px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
  color: var(--c-neutral-900);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  font-size: var(--font-size-sm);
  box-shadow: none;
}

/* Override global button / button:hover (white text on dark) */
.plans-back-btn:hover {
  background: var(--color-bg-surface-alt);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.plans-breadcrumb {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.plans-breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
}

.plans-breadcrumb a:hover {
  text-decoration: underline;
}

/* Work-item info card (top of the detail view). Single row: title + ADO
 * icon on the LEFT (grows to fill), state + type chips on the RIGHT
 * (intrinsic width). Action buttons live outside the card.
 *
 * `flex-direction: row` is required to override `.ds-card { flex-direction:
 * column }` from the components layer — without it children stack
 * vertically and the title+chips end up centered on separate lines. */
.plans-detail-card {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  margin-bottom: 16px;
}
.plans-detail-card__main {
  flex: 1 1 auto;
  min-width: 0;             /* allows title to shrink/truncate instead of pushing chips */
  display: flex;
  align-items: center;
  gap: 8px;
}
.plans-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;             /* lets the inner h2 truncate cleanly */
}
.plans-detail-title {
  margin: 0;
  font-family: "Noto Sans", sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
  color: var(--color-text-primary);
  /* Truncate with ellipsis if the title is wider than the available row
   * space (chips on the right always stay visible). */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
/* External-link icon button — opens the work item in Azure DevOps. */
.plans-detail-ado-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.plans-detail-ado-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-accent);
}
.plans-detail-ado-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.plans-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;          /* keeps chips on the right; title section grows instead */
}

.plans-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-bg-surface-alt);
  color: var(--color-text-primary);
}

/* (Legacy `.plans-detail-actions` rule was here — the standalone actions
 * row was removed; buttons now live inside their respective section
 * headers, see plans-bugs.css and plans-generation.css.) */

/* Plans work-item action button — compact (now lives inline in section
 * headers next to the Issue List / Test Cases For Review titles). */
.plans-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.4;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.plans-action-btn__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.plans-action-btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
  box-shadow: 0 2px 6px rgba(88, 80, 236, 0.35);
}

.plans-action-btn:focus-visible {
  outline: 2px solid var(--c-brand-200);
  outline-offset: 2px;
}

.plans-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.plans-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.plans-detail-col {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--color-bg-surface);
  min-height: 120px;
  min-width: 0;
}

.plans-detail-col--tests {
  align-self: start;
}

.plans-detail-col-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: var(--font-weight-bold);
}

.plans-ac-title {
  margin-top: 20px;
}

.plans-html-block {
  font-size: var(--font-size-sm);
  line-height: 1.55;
  color: var(--color-text-primary);
  max-height: min(52vh, 520px);
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.plans-html-block p {
  margin: 0 0 10px;
}

.plans-html-plain-preview {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--font-size-sm);
  line-height: 1.55;
  color: var(--color-text-primary);
}

.plans-field-truncated-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface-alt);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
}

.plans-field-truncated-hint a {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.plans-field-truncated-hint a:hover {
  text-decoration: underline;
}

.plans-field-empty {
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.plans-tests-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
}

.plans-tests-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.plans-tests-table th,
.plans-tests-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.plans-tests-table th {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  background: var(--color-bg-surface-alt);
}

.plans-tests-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.plans-tests-col-actions {
  width: 52px;
}

.plans-tests-row--clickable {
  cursor: pointer;
  outline: none;
}

.plans-tests-row--clickable:hover {
  background: var(--color-bg-surface-alt);
}

.plans-tests-row--clickable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.plans-tests-actions {
  text-align: center;
  vertical-align: middle;
  padding: 8px 6px;
}

.plans-test-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 0;
}

.plans-test-delete-btn:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

.plans-test-delete-btn:focus-visible {
  outline: 2px solid var(--color-danger-bg);
  outline-offset: 2px;
}


/* Merged from legacy styles.css */
@media (max-width: 900px) {
  .plans-detail-grid {
    grid-template-columns: 1fr;
  }
}
} /* end @layer features */
