/* Release 2 Phase 1 — Scope Builder styles. Scoped so they do not
   affect other tabs. Mirrors the existing styles.css token usage. */

.scope-tab {
  gap: 1.25rem;
}

.scope-sections {
  gap: 1rem;
}

.scope-section {
  border-left: 4px solid var(--color-accent, #c9a84c);
}

.scope-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.scope-section__title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 12rem;
}

.scope-section__title {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.125rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.25rem 0.5rem;
  flex: 1 1 auto;
}

.scope-section__title:focus {
  border-color: var(--color-border, #e5e7eb);
  background: #fff;
}

.scope-section__actions {
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.scope-section__empty {
  color: var(--color-text-muted, #6b7280);
  font-style: italic;
  padding: 0.75rem 0;
}

.scope-section__footer {
  margin-top: 0.75rem;
  gap: 0.5rem;
}

.scope-items {
  display: grid;
  gap: 0.5rem;
}

.scope-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
}

.scope-item__main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scope-item__name {
  flex: 1 1 auto;
  font-weight: 500;
}

.scope-item__source-badge {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.5rem;
  border-radius: 0.25rem;
  background: #eef2f7;
}

.scope-item__fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.scope-item__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 4rem;
}

.scope-item__field--number input {
  max-width: 6rem;
}

.scope-item__label {
  font-size: 0.7rem;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scope-item__remove {
  margin-left: auto;
}

.scope-item__notes {
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
  padding: 0.25rem 0.5rem;
  background: #fff;
  border-radius: 0.25rem;
  border: 1px dashed var(--color-border, #e5e7eb);
}

.badge--muted {
  background: #eef2f7;
  color: var(--color-text-muted, #6b7280);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border, #e5e7eb);
  color: var(--color-text, #2d2d2d);
}

.btn--ghost:hover:not(:disabled) {
  background: #f3f4f6;
}

.btn--ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.btn--danger:hover:not(:disabled) {
  background: #fef2f2;
}

.btn--icon {
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
}
